• Post Reply Bookmark Topic Watch Topic
  • New Topic

@EJB annotation from a servlet

 
Sreedevi Vinod
Ranch Hand
Posts: 117
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,

I have deployed a EJB 3.0 bean in JBoss 5.0 and am trying to access it from a servlet deployed in Apache Tomcat 6.0 server. The code is
@EJB private NewHello hello; // NewHello is the business interface

The client jar of the EJB is in the classpath of the servlet and so is the jndi.properties file. However, the bean reference is not getting injected, the variable is null. Does @EJB annotation work if the client and the bean are on different servers? If it would, then what are the possible reasons why this isn't working for me?

Thanks,
Devi
 
Debu Panda
author
Ranch Hand
Posts: 100
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think spec does not mandate it. It's completely based on whether the server supports that

-Debu
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!