SEVERE: EJB5070: Exception creating stateless session bean - solution with beans.xml
Asked Answered
D

1

6

I was struggling to overcome this problem! Went trough most of the similar posts over here however had no luck.

Deployment was fine but problem occurred during runtime. I am working with GlassFish 3.1.2.2 and use maven, application is deployed as a WAR with multiple JARs and using EJB3, JPA, CDI.

Dempsey answered 19/12, 2012 at 6:3 Comment(0)
C
1

FINALY I have found the cause: In one of my jar file with session beans I had a missing beans.xml file in src/main/resources/META-INF directory.According to cdi spec this file is needed by the jar to be recognised as a bean archive.Hope this will solve problems for others as well! cheers bb

Chara answered 19/12, 2012 at 6:3 Comment(2)
I don't understand why it shouldnt work if you just annotate the class to inject into your war app as @Stateless. The container should recognize this class and make it referencable from other EJB's.Rollins
I recently added an empty beans.xml to a web project. This caused an exception when a session bean in a jar was being created during startup. Removing beans.xml fixed the problem. Would never have guess that beans.xml was the source of the problem, if I hadn't found this answer.Egan

© 2022 - 2024 — McMap. All rights reserved.