-
1. Re: OpenJPA ManytoOne doesnt load eagerly. Works fine in Websphere Community but not in JBoss EAP 6.3
jamezp Dec 3, 2015 12:08 PM (in response to sridhar778)Did you install OpenJPA as a module? By default JBoss EAP uses Hibernate for it's JPA implementation.
--
James R. Perkins
-
2. Re: OpenJPA ManytoOne doesnt load eagerly. Works fine in Websphere Community but not in JBoss EAP 6.3
sridhar778 Dec 4, 2015 1:30 PM (in response to jamezp)James, Thanks for your time.
Iam using Jboss EAP 6.3 and not WildFly. I did install OpenJPA as a module. Steps taken are as below...
1.Create openjpa directory under jboss-eap-6.3\modules\system\layers\base\org\jboss\as\jpa and copy jboss-as-jpa-openjpa-7.2.0.Final.jar in openjpa directory and create a module.xml as below
<?xml version="1.0" encoding="UTF-8"?>
<module xmlns="urn:jboss:module:1.1" name="org.jboss.as.jpa.openjpa">
<properties>
<property name="jboss.api" value="private"/>
</properties>
<resources>
<resource-root path="jboss-as-jpa-openjpa-7.2.0.Final.jar"/>
<!-- Insert resources here -->
</resources>
<dependencies>
<module name="javax.annotation.api"/>
<module name="javax.persistence.api"/>
<module name="javax.transaction.api"/>
<module name="org.jboss.as.jpa.spi"/>
<module name="org.jboss.logging"/>
<module name="org.jboss.jandex"/>
<module name="org.apache.openjpa" optional="true"/> <!-- org.apache.openjpa:main must be created manually with OpenJPA jars -->
</dependencies>
</module>
2.Create openjpa directory under jboss-eap-6.3\modules\system\layers\base\org\apache and copy openjpa-all-2.1.1.jar and serp-1.13.1.jar with a module.xml as below
<?xml version="1.0" encoding="UTF-8"?>
<module xmlns="urn:jboss:module:1.1" name="org.apache.openjpa">
<resources>
<resource-root path="openjpa-all-2.1.1.jar">
<filter>
<exclude path="javax/**" />
</filter>
</resource-root>
<resource-root path="serp-1.13.1.jar"/>
</resources>
<dependencies>
<module name="javax.api"/>
<module name="javax.annotation.api"/>
<module name="javax.enterprise.api"/>
<module name="javax.persistence.api"/>
<module name="javax.transaction.api"/>
<module name="javax.validation.api"/>
<module name="javax.xml.bind.api"/>
<module name="org.apache.commons.collections"/>
<module name="org.apache.commons.lang"/>
<module name="org.jboss.as.jpa.spi"/>
<module name="org.jboss.logging"/>
<module name="org.jboss.vfs"/>
<module name="org.jboss.jandex"/>
<module name="org.jboss.logmanager"/>
<module name="org.slf4j" />
<module name="org.apache.log4j" />
</dependencies>
</module>
3.In my persistence.xml, i have <provider>org.apache.openjpa.persistence.PersistenceProviderImpl</provider>
I do see in my logs
11:54:59,049 DEBUG [org.jboss.as.jpa] (MSC service thread 1-3) report is configured to use adapter module 'org.jboss.as.jpa.openjpa'
11:54:59,049 DEBUG [org.jboss.as.jpa] (MSC service thread 1-3) report is configured to use provider module 'org.apache.openjpa'
11:54:59,050 DEBUG [org.jboss.as.jpa] (MSC service thread 1-3) added org.jboss.as.jpa.openjpa:main dependency to report.ear
11:54:59,050 DEBUG [org.jboss.as.jpa] (MSC service thread 1-3) added org.apache.openjpa:main dependency to report.ear
Other Jpa functions seem to be normal as i see expected queried being generated. As of now, i see this issue with ManytoOne NOT being loaded EAGERLY but only LAZILY (queries not getting generated for manytoone associations until they are accessed for the first time)
Any help appreciated....