Reputation: 6616
I am working on an application that is using JPA, Hibernate. I can deploy fine on Tomcat but on jBoss it will not deploy. I get the following error.
JBAS011466: PersistenceProvider 'org.hibernate.jpa.HibernatePersistenceProvider' not found
After doing some Googling I found some articles that suggested I'm getting conflicts because I have my own JPA, Hibernate, Persistence API jars packaged into my WAR. I want to tell jBoss to use my version of those files.
I found a article suggesting putting the following in WEB-INF/jboss-classloading.xml.
<classloading xmlns="urn:jboss:classloading:1.0"
name="timesheet-api.war"
domain="IsolatedDomain"
import-all="false"
parent-first="false" >
</classloading>
I did this but it did not resolve the issue.
Any suggestions?
Upvotes: 1
Views: 534
Reputation: 51
My suggestion would be to divide your application to conform to a domain driven design, i.e. separate business logic from frontend logic etc.
I.e. export everything not directly related into a jar instead and keep your web logic in the war - package them in an ear to combine the two. File structure should be like below and composed via dependencies in your .pom:
|root/jar
|root/war (has jar as a dependency)
|root/ear (has both jar and war as dependencies)
A Java EE application is delivered in a Java Archive (JAR) file, a Web Archive (WAR) file, or an Enterprise Archive (EAR) file. A WAR or EAR file is a standard JAR (.jar) file with a .war or .ear extension. Using JAR, WAR, and EAR files and modules makes it possible to assemble a number of different Java EE applications using some of the same components. No extra coding is needed; it is only a matter of assembling (or packaging) various Java EE modules into Java EE JAR, WAR, or EAR files.
From what I understand you want to have an application similar to what most would refer to as an "Enterprise application", i.e. an application with many of the EE technologies. You should pack it as an .ear and then deploy it in JBoss for it to work seamlessly (and be according to convention).
More info can be found here: http://docs.oracle.com/javaee/6/tutorial/doc/bnaby.html
Upvotes: 1