• Post Reply Bookmark Topic Watch Topic
  • New Topic

ejb3.0: calling a bean from servlet fails  RSS feed

 
Asher Tarnopolski
Ranch Hand
Posts: 260
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i try to make a simple call to a stateless session bean business method from a servlet. when i make a jndi lookup on initialcontext object - everything works just fine. but when i try to inject an @EJB annotation, the code fails with a nullpointerexception - the remote reference seems to be null. here is the code:

thanks for you time
 
Mark Spritzler
ranger
Sheriff
Posts: 17309
11
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is Servlets up to the ability to use injection like that. I thought that was new in EJB 3.0 and maybe Servlets Spec hasn't gotten to implement that yet.

Do you need anythin gin the annotation to show that it is a remote lookup. And if you include the jar and war together in an ear, does it become a local lookup?

Mark
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!