aspose file tools*
The moose likes EJB and other Java EE Technologies and the fly likes Dependency Injection Problem !!! Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "Dependency Injection Problem !!!" Watch "Dependency Injection Problem !!!" New topic
Author

Dependency Injection Problem !!!

Vassili Vladimir
Ranch Hand

Joined: Mar 08, 2007
Posts: 1585
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 ...


Vassili ...
SCJP 5.0, SCWCD 1.4, SCJA 1.0
Edvins Reisons
Ranch Hand

Joined: Dec 11, 2006
Posts: 364
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

Joined: Mar 08, 2007
Posts: 1585
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

Joined: Dec 11, 2006
Posts: 364
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

Joined: Mar 08, 2007
Posts: 1585
Hi,

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

Thank you guys ...
 
 
subject: Dependency Injection Problem !!!