• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Liutauras Vilda
Sheriffs:
  • Rob Spoor
  • Junilu Lacar
  • paul wheaton
Saloon Keepers:
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
  • Scott Selikoff
Bartenders:
  • Piet Souris
  • Jj Roberts
  • fred rosenberger

Dependency Injection Problem !!!

 
Ranch Hand
Posts: 1585
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I have created a simple stateless session bean which implements a simple local interface.

And I'm using a Servlet to act as client for my session bean, and in my Servlet class I'm using the @EJB annotation to fire dependency injection but it's giving me a null pointer exception, I'm using EJB 3.0, why I'm getting this exception since the container does the injection automatically and binds the EJB with my instance variable of the same type of the EJB ?

Did i miss something ?

Thanks in advance ...
 
Ranch Hand
Posts: 364
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Without knowing the details, one cannot be sure; still, the most frequent
answer to a question of this type is "your application server is not yet fully Java EE 5 compatible".
 
Vassili Vladimir
Ranch Hand
Posts: 1585
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm using Oracle JDeveloper with it's embedded OC4J, is not OC4J a fully J2EE 5 compliant application server ?

Thanks in advance ...
 
Edvins Reisons
Ranch Hand
Posts: 364
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
On the Oracle website, you can see the OC4J compatibility information.
Also, please post your code and the exception stack trace.
 
Vassili Vladimir
Ranch Hand
Posts: 1585
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I solved the problem by installing OC4J 11g which is a fully J2EE 5 compilant application server and it worked ...

Thank you guys ...
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic