I'm trying to upgrade from Jboss 4.2.3 to WildFly 10.
The main outstanding issue left is Hibernate.
I don't want to upgrade to Hibernate 5 (Wildfly 10's default) at this time
So I'm trying to use the existing code which was using Hibernate 3.5, but I'm having some issues.
I have an Ear containing a couple of wars and some ejb-jars.
I now have jboss-deployment-structure.xml in my ejb-jars and in the ear, all specifying:
<exclusions>
<module name="org.hibernate" />
</exclusions>
I've included the following jars in my ear's lib (were there also in the JBoss 4.2.3 deployment):
hibernate-annotations-jboss.4.2.3.jar
hibernate-commons-annotations-3.0.0.ga.jar
hibernate-jboss.4.2.3.jar
hibernate-validator-4.0.2.GA.jar
jbossall-client-4.2.3.GA.jar
I've also added the following jar to the ear's lib:
hibernate-entitymanager-jboss.4.2.3.jar
I'm getting the following error message during the deployment of the ear:
INFO [org.hibernate.ejb.Ejb3Configuration] (ServerService Thread Pool -- 83) Processing PersistenceUnitInfo [
name: AuditTrailPU
...]
2016-11-03 15:45:01,521 ERROR [org.jboss.msc.service.fail] (ServerService Thread Pool -- 86) MSC000001: Failed to start service jboss.persistenceunit."InSyncEar-11.0.0-SNAPSHOT.ear/SchedulerCore.jar#SchedulerPU": org.jboss.msc.service.StartException in service jboss.persistenceunit."InSyncEar-11.0.0-SNAPSHOT.ear/SchedulerCore.jar#SchedulerPU": java.lang.RuntimeException: error trying to scan <jar-file>: vfs:/C:/TFSROOT/Purchasing_Trunk/InsyncRuntime/target/InTync/wildfly-10.1.0.Final/bin/content/InTyncEar-11.0.0-SNAPSHOT.ear/SchedulerCore.jar/
at org.jboss.as.jpa.service.PersistenceUnitServiceImpl$1$1.run(PersistenceUnitServiceImpl.java:179)
at org.jboss.as.jpa.service.PersistenceUnitServiceImpl$1$1.run(PersistenceUnitServiceImpl.java:121)
at org.wildfly.security.manager.WildFlySecurityManager.doChecked(WildFlySecurityManager.java:667)
at org.jboss.as.jpa.service.PersistenceUnitServiceImpl$1.run(PersistenceUnitServiceImpl.java:193)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
at org.jboss.threads.JBossThread.run(JBossThread.java:320)
Caused by: java.lang.RuntimeException: error trying to scan <jar-file>: vfs:/C:/TFSR/Purch/IntyncRuntime/target/InTync/wildfly-10.1.0.Final/bin/content/InTyncEar-11.0.0-SNAPSHOT.ear/SchedCore.jar/
at org.hibernate.ejb.Ejb3Configuration.scanForClasses(Ejb3Configuration.java:619)
at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:341)
at org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.java:126)
at org.jboss.as.jpa.service.PersistenceUnitServiceImpl.createContainerEntityManagerFactory(PersistenceUnitServiceImpl.java:341)
at org.jboss.as.jpa.service.PersistenceUnitServiceImpl.access$1200(PersistenceUnitServiceImpl.java:69)
at org.jboss.as.jpa.service.PersistenceUnitServiceImpl$1$1.run(PersistenceUnitServiceImpl.java:174)
... 7 more
Caused by: java.lang.RuntimeException: Archive browser cannot handle protocol: vfs:/C:/TFSR/Purch/IntyncRuntime/target/InTync/wildfly-10.1.0.Final/bin/content/InTyncEar-11.0.0-SNAPSHOT.ear/SchedCore.jar/
at org.jboss.util.file.ArchiveBrowser.getBrowser(ArchiveBrowser.java:56)
at org.hibernate.ejb.Ejb3Configuration.scanForClasses(Ejb3Configuration.java:610)
... 12 more
I see other people getting this kind of error but the advice they got was to remove their hibernate jars from their ear/war. In my case the Hibernate jars must be there since I've excluded the "built in" Hibernate. The problem may be because a Hibernate class (Ejb3Configuration) is calling a JBoss utility class (ArchiveBrowser). But ArchiveBrowser is in jbossall-client-4.2.3.GA.jar (in my ear/lib).
I've also tried putting the following in the persistence.xml of my ejb-jars:
<property name="jboss.as.jpa.providerModule" value="hibernate3-bundled" />
as was suggested in site to someone with the same issue but that resulted in the message:
org.jboss.modules.ModuleNotFoundException: hibernate3-bundled:main
Should i set up such a module?
So does anyone have any idea what's the problem, have a solution?
Also, My ear is deployed in the wildfly-10.1.0.Final\standalone\deployments folder
But the message is:
error trying to scan :
vfs:/C:/TFSROOT/Purchasing_Trunk/InsyncRuntime/target/InTync/wildfly-10.1.0.Final/bin/content/InTyncEar-11.0.0-SNAPSHOT.ear/SchedulerCore.jar/
If i look in the file system, there is no "content" folder under the existing "bin" folder.
Is that the problem? that it's looking at the wrong place?
Finally, is it even possible, and has anyone been able to get Wildfly 10 to work with Hibernate 3 successfully? (I see questions and answers about this but no "working" solution)
Any help would be greatly appreciated.