-
1. Re: Mulitiple EJB3.0 JARs on JBoss7.1.3 - Named query not found
wdfink Apr 15, 2013 4:10 AM (in response to nitin_jain)Humm,
Could it be a initialisation order problem?
You might add the jar's in a correct order and set the flag module-order strict within the jboss-app.xml.
see here
-
2. Re: Mulitiple EJB3.0 JARs on JBoss7.1.3 - Named query not found
nitin_jain Apr 16, 2013 12:03 PM (in response to wdfink)Hello Wolf,
Thank you for your response. I did make the changes in the order in which the 2 EJB jars are deployed; however what I can understand is that the server recognizes the first "persistence.xml" and seems to ignore the second. So if I invoke a finder in the EJB JAR deployed first, the query is executed, but when the finder in second EJB JAR is invoked the named query is not found.
Any other possible solution would be appreciated.
Best Regards,
Nitin
-
3. Re: Mulitiple EJB3.0 JARs on JBoss7.1.3 - Named query not found
nitin_jain Apr 17, 2013 11:42 PM (in response to nitin_jain)Hello Forum,
There is a solution to this problem.
EAR Structure - Not working in JBoss 7.1.3 but works in JBoss5.1.0.GA
my-app.ear
META_INF
application.xml
EJB-1.jar
META-INF
persistence.xml
EJB-2.jar
META-INF
persistence.xml
EAR Structure - Working in JBoss 7.1.3
my-app.ear
META_INF
application.xml
persistence.xml
EJB-1.jar
EJB-2.jar
Also, there is a change in "persistence.xml".
<?xml version="1.0"?>
<persistence xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
version="2.0" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd"
xmlns="http://java.sun.com/xml/ns/persistence">
<persistence-unit name="MY_PU" transaction-type="JTA">
<description>Persistence Unit</description>
<provider>org.hibernate.ejb.HibernatePersistence</provider>
<jta-data-source>java:jboss/datasources/MyDS</jta-data-source>
<jar-file>my-app.ear/EJB-1.jar</jar-file>
<jar-file>my-app.ear/EJB-2.jar</jar-file>
<properties>
<property name="hibernate.show_sql" value="true" />
........
</properties>
</persistence-unit>
</persistence>
Can anyone reason why such a change is required?
Best Regards,
Nitin