No EJBs found in the ejb-jar file ‘MyApplication.jar’. Please ensure the ejb-jar contains EJB declarations via an ejb-jar.xml deployment descriptor or at least one class annotated with the @Stateless, @Stateful or @MessageDriven EJB annotation


I was deploying ear file in weblogic and was receiving the below error:

“Failed to initialize the application ‘myapplication’ due to error weblogic.application.ModuleException: Exception preparing module: EJBModule(myapplicationEJB.jar) [EJB:011023]An error occurred while reading the deployment descriptor. The error was: No EJBs found in the ejb-jar file ‘myapplicationEJB.jar’. Please ensure the ejb-jar contains EJB declarations via an ejb-jar.xml deployment descriptor or at least one class annotated with the @Stateless, @Stateful or @MessageDriven EJB annotation… weblogic.application.ModuleException: Exception preparing module: EJBModule(myapplicationEJB.jar) [EJB:011023]An error occurred while reading the deployment descriptor. The error was: No EJBs found in the ejb-jar file ‘myapplicationEJB.jar’. Please ensure the ejb-jar contains EJB declarations via an ejb-jar.xml deployment descriptor or at least one class annotated with the @Stateless, @Stateful or @MessageDriven EJB annotation..”

On researching, I found that I hadn’t set “setWLSEnv.cmd” (windows) or “setWLSEnv.sh” (linux) before starting weblogic and this made it not to recognize @Stateless annotation and throw above error. I set the “setWLSEnv.cmd” and started the weblogic application and redeployed the jar file successfully.

Advertisements

Leave a comment

Filed under Oracle, weblogic

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s