I have a spring mvc app which uses openjpa 2.1.1 as its persistence framework. It is developed as a Maven project in STS, and runs locally on vFaric TC Server (Tomcat 7).
When we first deployed the war to Websphere 8.5, we encountered classloader conflicts with the following 3 openjpa jars which were in our war file:
geronimo-jpa_2.0_spec-1.1.jar geronimo-jta_1.1_spec-1.1.1.jar validation-api-1.0.0.GA.jar
Removing these from the war and deferring to Websphere's bundled openjpa worked fine, so I changed the openjpa POM dependency scope from 'compile' to 'provided' (so that these jars would not be packaged into the war file).
Since Tomcat 7 is not Java EE compliant, I placed the 3 jars in Tomcat\lib (also tried the vfabric-tc-server lib - which wraps tomcat), but the JPA classes were not visible by the app at startup (noclassdeffound exceptions in console).
I also tried adding the jars to the server classpath from 'launch configuration' within STS - no luck there either.
Is there a class loader order that needs to be set somewhere in Tomcat such that JPA loads before the app?
What I need is a build that will work when deployed to either Tomcat or Websphere.
Any help will be much appreciated.