3

We have an application that is developed in Hibernate 3.6 and we need to deploy it onto a JBoss 4.0.5 app server for our client.

Due to the JBoss classloading flow, the hibernate library on our application is not loaded, instead the hibernate that is shipped together with JBoss is used, which causes a whole lot of issue.

A check on the tomcat jboss-service.xml reveal that the setting was modified:

<attribute name="Java2ClassLoadingCompliance">true</attribute> <!--modified-->
<attribute name="UseJBossWebLoader">false</attribute> <!--remained the same-->

With the Java2ClassLoadingCompliance set to true, is it possible for us to specify the classloading isolation in our application? We set the following settings in a jboss-web.xml in our application's WEB-INF directory referring to here (the application is deployed as a exploded-war):

<jboss-web>
   <class-loading java2ClassLoadingCompliance="false">
      <loader-repository>
         org.hibernate:archive=OurApplication.war
         <loader-repository-config>java2ParentDelegation=false</loader-repository-config>
      </loader-repository>
   </class-loading>
</jboss-web>

However the configuration have no effects.

Any input is greatly appreciated.

ipohfly
  • 1,959
  • 6
  • 30
  • 57
  • well Jboss 4 tightly integrates with hibernate, bundled with it. Even in recent Wildfly server it is hard to replace the bundled hibernate. And there is not much possibility to modify the application bootstrap in JBoss4. IT sees persistence.xml and bootstraps the persistence context. You can try to cut off jboss-hibernate.deployer and configure and bootstrap your persistence context by your application (but in this case it simply becomes a web application working on tomcat). and I guess it is not trivial at all. – Ilya Dyoshin Oct 16 '16 at 09:16
  • Simply cutoff from your application Hibernate 3.6 (it is JPA 2.0) and stick to version bundled with JBoss4 (early versions of JPA 1.0). – Ilya Dyoshin Oct 16 '16 at 09:26
  • There are some issues if we are to cut off from 3.6 and use the version on the server. Example for operation like `count`, 3.6 returns a `Long` object which our codes anticipate, where else prior to that it returns `Integer`. – ipohfly Oct 17 '16 at 01:39
  • yeap, that is what it is when you work with legacy software (11 years...) – Ilya Dyoshin Oct 17 '16 at 06:44
  • What to do..we're not in the position to replace the app server....lol... – ipohfly Oct 19 '16 at 01:53

0 Answers0