Win a copy of JDBC Workbook this week in the JDBC and Relational Databases forum
or A Day in Code in the A Day in Code forum!
  • 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 ...
  • Campbell Ritchie
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
  • Piet Souris
  • salvin francis
  • fred rosenberger

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
Posts: 17346
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?

Without subsidies, chem-ag food costs four times more than organic. Or this tiny ad:
Devious Experiments for a Truly Passive Greenhouse!
    Bookmark Topic Watch Topic
  • New Topic