-
1. Re: HibernateProxy not in classpath if persistence.xml is missing
jaysensharma Oct 31, 2015 3:17 AM (in response to gengis)It is very easy to tell WildFly to do so, using the WildFly class loading feature.
For example if you add the following kind of "$YourWebApp/WEB-INF/jboss-deployment-structure.xml" in your application then your application can access hibernate classes even without using persistence.xml
<jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.1"> <deployment> <dependencies> <module name="org.hibernate" /> </dependencies> </deployment> </jboss-deployment-structure>
See: https://docs.jboss.org/author/display/WFLY8/Class+Loading+in+WildFly
-
2. Re: HibernateProxy not in classpath if persistence.xml is missing
jaysensharma Oct 31, 2015 3:23 AM (in response to gengis)Additionally if you do not want to add any additionally file like "jboss-deployment-structure.xml" inside your Application archives then you can do it globally at WildFly level by declaring a global-module inside the "ee" subsystem:
CLI command:
/subsystem=ee:write-attribute(name="global-modules",value=[{"name" => "org.hibernate","slot" => "main"}])
XML Snippet:
<subsystem xmlns="urn:jboss:domain:ee:2.0"> <global-modules> <module name="org.hibernate" slot="main"/> <!-- NOTICE this --> </global-modules> <spec-descriptor-property-replacement>false</spec-descriptor-property-replacement> . . . </subsystem>
-
3. Re: HibernateProxy not in classpath if persistence.xml is missing
gengis Nov 1, 2015 1:39 PM (in response to jaysensharma)Thanks Jay,
I maked the first answer "correct" but it also needs :
<module name="org.javassist" />
I guess it is the same for the second answer.