Monthly Archives: August 2012

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.

Leave a comment

Filed under Oracle, weblogic