Eclipselink Weaving Issue
jspies2 Jun 6, 2014 10:56 PMWildfly 8.1
Eclipselink 2.5.1
Hi everyone. I am in the middle of trying to switch from Glassfish to Wildfly. I've followed some of the guides and have worked through most of the migration, but am stuck on an Eclipselink issue. I have an EJB module that has my database entities, database access classes with PersistenceUnit injected in to them, and my persistence.xml
<persistence version="2.0" xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd">
<persistence-unit name="MyPU" transaction-type="JTA">
<provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
<jta-data-source>java:/jdbc/db</jta-data-source>
<exclude-unlisted-classes>false</exclude-unlisted-classes>
<shared-cache-mode>ENABLE_SELECTIVE</shared-cache-mode>
</persistence-unit>
</persistence>
When I deploy this EJB module to the server on it's own, I have no issues. I have added the eclipselink.jar and updated the module xml to include it and this works as expected.
I then also have a Web App that is dependent on the EJB module (it is not included in the WAR file is that matters). This Web app does not have any database entities, persistence information, etc. Instead, it relies on using the data access classes and entities from the ejb module.
I then package the EJB module and the Web module into an EAR and deploy it to Wildfly. When I deploy this, I get a warning for any class that has a @ManyToOne annotation with fetch = FetchType.LAZY
Reverting the lazy setting on the OneToOne or ManyToOne attribute [organization] for the entity class [class com.cyber2.tc.entities.User] since weaving was not enabled or did not occur.
I have removed the Web app/WAR file from the EAR and deployed it with just the EJB module in it, and the problem goes away. The problem only occurs when the web module is in the EAR with the EJB module. I know I could try to enable static weaving before deployment, but I'm not sure if this should be necessary since I didn't have to do it on glassfish. Any Thoughts?
Thanks!
Jason