Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Dependency Injection Problem !!!

 
Vassili Vladimir
Ranch Hand
Posts: 1585
  • Mark post as helpful
  • send pies
  • 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 ...
 
Edvins Reisons
Ranch Hand
Posts: 364
  • Mark post as helpful
  • send pies
  • 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
  • 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
  • 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
  • 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 ...
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic