-
1. Re: Hibernate issue upgrading from JBoss 4.2.2 to JBoss 7.2
smarlow Nov 15, 2012 1:07 PM (in response to mikevan)Are you using JPA or native Hibernate api? If your using JPA, try enabling TRACE logging for org.jboss.as.jpa and show us the AS server console output.
-
2. Re: Hibernate issue upgrading from JBoss 4.2.2 to JBoss 7.2
mikevan Nov 15, 2012 1:28 PM (in response to mikevan)It appears that regardless of where I play my jboss-deployment-structure.xml document in my ear or the .war contained in my .ear file, Jboss is ignoring it when loading my application. I have attempted the following locations:
.ear/META-INF/jboss-deployment-structure.xml
.ear#.war/WEB-INF/jboss-deployment-structure.xml
.ear#.war/WEB-INF/classes/META-INF/jboss-deployment structure.
However, when I enable my application through the console, I see messages like this for all of the appropriate Hibernate classes:
13:16:48,992 TRACE [org.jboss.modules] (ServerService Thread Pool -- 101) Finding class org.hibernate.ejb.Ejb3Configuration from Module "org.jboss.logmanager:main" from local module loader @79a705d7 (roots:/myhome/jboss-as-7.2.0.Alpha1-SNAPSHOT/modules)
Using JBoss 7.2, HIbernate 3.2.6, and on CentOS 6.3.
-
3. Re: Hibernate issue upgrading from JBoss 4.2.2 to JBoss 7.2
mikevan Nov 15, 2012 1:29 PM (in response to smarlow)The application isn't using JPA, it is using old Hibernate 3.2.6 annotations.
-
4. Re: Hibernate issue upgrading from JBoss 4.2.2 to JBoss 7.2
smarlow Nov 15, 2012 1:40 PM (in response to mikevan)Even if your not using JPA, you should still post the TRACE output or a link to it (via something like http://pastie.org/). The output should give me an idea of what is wrong.
Also, show us a list of the files in your deployment (jar tf YourApp.ear). I'm guessing that AS7 thinks your deploying a JPA app (as if you have a persistence.xml file or some @PersistenceUnit/@PersistenceContext annotations).
-
5. Re: Hibernate issue upgrading from JBoss 4.2.2 to JBoss 7.2
mikevan Nov 15, 2012 2:05 PM (in response to smarlow)Unfortunately, because of the highly proprietary nature of the, and the size, sharing it is not something I'm able to do. However, should I do a recursive grep for those annotations? Also, while my .war file doesn't contain a persistance.xml file, one of the libraries in the WEB-INF/lib directory does. This is what its structure looks like:
<?xml version="1.0" encoding="UTF-8"?>
<persistence version="1.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_1_0.xsd">
<persistence-unit name="myDomainPU" transaction-type="RESOURCE_LOCAL">
<jta-data-source>java:/myDataSource</jta-data-source>
<properties>
<property name="hibernate.validator.autoregister_listeners" value="false"/>
<property name="hibernate.dialect" value="org.hibernate.dialect.Oracle10gDialect"/>
<!--property name="hibernate.cache.use_query_cache" value="false"/-->
<property name="hibernate.cache.provider_class" value="org.hibernate.cache.EhCacheProvider"/>
<!--property name="hibernate.transaction.manager_lookup_class"
value="org.hibernate.transaction.JBossTransactionManagerLookup"/-->
<property name="hibernate.show_sql" value="false"/>
</properties>
</persistence-unit>
</persistence>
-
6. Re: Hibernate issue upgrading from JBoss 4.2.2 to JBoss 7.2
mikevan Nov 15, 2012 2:09 PM (in response to mikevan)I also see a few places where @PersistenceContext is being used. However, the primary question, why doesn't JBoss exclude org.hibernate as defined in my jboss-deployment-structure.xml? Is there another way to turn it off so that only the older .jar files are used?
-
7. Re: Hibernate issue upgrading from JBoss 4.2.2 to JBoss 7.2
mikevan Nov 15, 2012 2:21 PM (in response to smarlow)Scott, We did a small test application using @PersistenceContext, and persistance.xml along with a jboss-deployment-structure.xml document that is working. The difference is that myApp is an .ear file, not a .war. I wonder if that could be the issue?
-
8. Re: Hibernate issue upgrading from JBoss 4.2.2 to JBoss 7.2
smarlow Nov 15, 2012 2:23 PM (in response to mikevan)Upgrading to Hibernate 4 would be ideal but other things that you could do:
- Remove the JPA section from the as7/standalone/configuration/standalone.xml file (disabling EE JPA).
- Change the application to not include EE JPA elements that the EE JPA subsystem sees during application deployment. The EE JPA subsystem will inject Hibernate 4 jars onto the application classpath if it sees the persistence.xml/JPA annotations.
-
9. Re: Hibernate issue upgrading from JBoss 4.2.2 to JBoss 7.2
smarlow Nov 15, 2012 2:27 PM (in response to smarlow)I'm not sure why you were not able to exclude the org.hibernate module. According to https://docs.jboss.org/author/display/AS72/Class+Loading+in+AS7, you should be able to do that.
-
10. Re: Hibernate issue upgrading from JBoss 4.2.2 to JBoss 7.2
chandransuraj Oct 14, 2013 9:12 AM (in response to smarlow)Hey scott, I see this thread is a little old, but I removed all JPA elements from standalone.xml, but somehow hibernate-validator is still being injected to the classpath of my module. I wonder if I need to do anything else?
-
11. Re: Hibernate issue upgrading from JBoss 4.2.2 to JBoss 7.2
smarlow Oct 14, 2013 9:27 AM (in response to chandransuraj)If your using the AS 7.x community version, you could upgrade to WildFly 8.x and post in the https://community.jboss.org/en/wildfly forums as I'm not sure exactly what problem your having (but best to try against the latest version and start a new discussion thread). You can mention this discussion thread if you hit the same issue as described above.