Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Knute Snortum
  • Bear Bibeault
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Frits Walraven
  • Carey Brown
  • Tim Holloway

ejb3.0: calling a bean from servlet fails

 
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
 
ranger
Posts: 17344
11
Mac IntelliJ IDE 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!