permaculture playing cards
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
JavaRanch » Java Forums » Products » Oracle/OAS
Bookmark "Dependency injection/annotation Error" Watch "Dependency injection/annotation Error" New topic

Dependency injection/annotation Error

Jose Campana
Ranch Hand

Joined: May 28, 2007
Posts: 339

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: 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(
at oracle.oc4j.admin.jmx.server.mbeans.deploy.OC4JDeployerRunnable.doRun(
at com.evermind.util.ReleasableResourcePooledExecutor$

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 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: 1789

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
jQuery in Action, 3rd edition