Answer the question
In order to leave comments, you need to log in
Migration from JBoss 6 to JBoss 7 - why is EJB not visible from WAR?
I have a project that consists of one EJB and one WAR using the EJB methods through the local interface. Under JBoss 6 they worked great together. Under JBoss 7 - do not want to.
EJB declares an interface named DBLocal (it is used to access the database) and successfully deploys under Jboss7, writes the following JNDI bindings to the console:
java:global/ru.test.ejb.orm/DBBean!ru.test.ecm.orm.bean.DBLocal
java:app/ru.test.ejb.orm/DBBean!ru.test.ecm.orm.bean.DBLocal
java:module/DBBean!ru.test.ecm.orm.bean.DBLocal
java:global/ru.test.ejb.orm/DBBean
java:app/ru.test.ejb.orm/DBBean
java:module/DBBean
//Это некий класс сервлета
public class LoginServiceImpl extends RemoteServiceServlet implements LoginService, ServletContextListener
{
//Вот он, EJB-шник:
@EJB(lookup="java:global/ru.test.ejb.orm/DBBean!ru.test.ecm.orm.bean.DBLocal")
private DBLocal dbBean;
...
}
Caused by: java.lang.NoClassDefFoundError: Lru/test/ecm/orm/bean/DBLocal;
at java.lang.Class.getDeclaredFields0(Native Method) [rt.jar:1.7.0_25]
at java.lang.Class.privateGetDeclaredFields(Unknown Source) [rt.jar:1.7.0_25]
at java.lang.Class.getDeclaredFields(Unknown Source) [rt.jar:1.7.0_25]
at org.jboss.as.server.deployment.reflect.ClassReflectionIndex.<init>(ClassReflectionIndex.java:57) [jboss-as-server-7.3.0.Final-redhat-14.jar:7.3.0.Final-redhat-14]
at org.jboss.as.server.deployment.reflect.DeploymentReflectionIndex.getClassIndex(DeploymentReflectionIndex.java:68) [jboss-as-server-7.3.0.Final-redhat-14.jar:7.3.0.Final-redhat-14]
... 10 more
Caused by: java.lang.ClassNotFoundException: ru.test.ecm.orm.bean.DBLocal from [Module "deployment.ecm.war:main" from Service Module Loader]
at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:197) [jboss-modules.jar:1.3.0.Final-redhat-2]
at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:443) [jboss-modules.jar:1.3.0.Final-redhat-2]
at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:431) [jboss-modules.jar:1.3.0.Final-redhat-2]
at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:373) [jboss-modules.jar:1.3.0.Final-redhat-2]
at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:118) [jboss-modules.jar:1.3.0.Final-redhat-2]
... 15 more
Answer the question
In order to leave comments, you need to log in
project consisting of one EJB and one WARIn JBoss (and in JEE application server terminology in general) there is no concept of a "project". Do I understand correctly that "project" means Enterprise Archive (EAR)? If you don't have an EAR, then I don't see any way to treat a separate WAR and a separate EJB module as one thing.
<?xml version="1.0" encoding="UTF-8"?>
<jboss-deployment-structure>
<ear-subdeployments-isolated>false</ear-subdeployments-isolated>
</jboss-deployment-structure>
my.ear
--META-INF
----application.xml
----jboss-deployment-structure.xml
--myWeb1.war
--myWeb2.war
--myEjb1.jar
--myEjb2.jar
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE application PUBLIC "-//Sun Microsystems, Inc.//DTD J2EE Application 1.3//EN" "http://java.sun.com/dtd/application_1_3.dtd">
<application>
<display-name>myApp</display-name>
<initialize-in-order>true</initialize-in-order>
<module>
<java>myEjb1.jar</java>
</module>
<module>
<java>myEjb2.jar</java>
</module>
<module>
<web>
<web-uri>myWeb1.war</web-uri>
<context-root>myWeb1</context-root>
</web>
</module>
<module>
<web>
<web-uri>myWeb2.war</web-uri>
<context-root>myWeb2</context-root>
</web>
</module>
</application>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question