I've been trying to fix an issue for some time now.
I have two EAR files being deployed to Wildfly 8.1.0 with the same EJB.jar and the same JPA.jar, but with seperate EJB.jars for 'Scheduling' A.K.A running the different functions within the EJBs. The schedulers access the EJB.jars which in turn access the JPA.jars. Both EARs/JPAs use the same database.
The layout of the two EARs are as follows:
EAR1:
SCHEDULER1-EJB.jar
EJB.jar
lib\JPA.jar
EAR2:
SCHEDULER2-EJB.jar
EJB.jar
lib\JPA.jar
Everything deploys fine, but after a few minutes of the schedulers running I get a ClassCastException for user defined classes. Example:
java.lang.ClassException: persistence.Foo cannot be cast to persistence.Foo
I have tried playing around with Dependency, Class-Path and EAR isolation techniques but cannot fix my issue.
The issue only occurs when both EARs are deployed and running, individually they run without any issues.
Any suggestions would be welcome. Thanks in advance.