File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Oracle/OAS and the fly likes Dependency injection/annotation Error Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Customer Requirements for Developers this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Products » Oracle/OAS
Bookmark "Dependency injection/annotation Error" Watch "Dependency injection/annotation Error" New topic
Author

Dependency injection/annotation Error

Jose Campana
Ranch Hand

Joined: May 28, 2007
Posts: 339
Greetings,

Hello everybody !

This topic's about a problem I'm currently experiencing while trying to deploy a Web Application that makes a call to an EJB using Dependency injection from a Servlet. This is the Stack trace generated when I attempt to deploy my web app:

DeployerRunnable.run Error parsing annotation for class org.servlet.TestServletoracle.oc4j.admin.internal.DeployerException: Error parsing annotation for class org.servlet.TestServlet
at oracle.oc4j.admin.internal.DeployerBase.execute(DeployerBase.java:126)
at oracle.oc4j.admin.jmx.server.mbeans.deploy.OC4JDeployerRunnable.doRun(OC4JDeployerRunnable.java:52)
at oracle.oc4j.admin.jmx.server.mbeans.deploy.DeployerRunnable.run(DeployerRunnable.java:81)
at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:303)
at java.lang.Thread.run(Thread.java:619)


Here's a Snippet from the Servlet that's making the call:



Here's the EJB implementation:



Finally, I will post the Container-specific Deployment descriptor:



Up until this moment, I still have no clue, about the reason why I can't inject my EJB in the Web-app's Servlet.

Please Help ! Please........

It's so hard to find info. about this problem on the internet.

Best Regards,

Jose.
Jose Campana
Ranch Hand

Joined: May 28, 2007
Posts: 339
Hello there !

I've corrected this problem by using the same name for the @Stateless annotation and the display-name tag in the ejb-jar file, for @EJB this name should match also.

Good Luck, hope this is helpful in the future.
Janeice DelVecchio
Saloon Keeper

Joined: Sep 14, 2009
Posts: 1771
    
  12

Thanks for posting your solution!


When you do things right, people won't be sure you've done anything at all.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Dependency injection/annotation Error
 
It's not a secret anymore!