-
1. Re: ClassLoader isolation
kconner Oct 12, 2007 4:26 AM (in response to domkun)By default the esb runs in a global class loading scope and will defer to the version of hibernate included in the AS.
To run with a scoped class loader you need to add something like the following into your deployment.xml file in the META-INF directory.<loader-repository> com.example.domain:artifact=UniqueNameForArtifact <loader-repository-config> java2ParentDelegaton=false </loader-repository-config> </loader-repository>
Having said all this I should point out that exposing hibernate classes to a client suggests that something is wrong on the 4.0.5 server. This is an internal implementation detail and should really have been hidden from the client. -
2. Re: ClassLoader isolation
domkun Oct 12, 2007 8:26 AM (in response to domkun)Thanks for your very fast reply! Your suggestion works perfect.
Just to mention, I now get following WARN during the deployment:WARN [DeploymentInfo] Only the root deployment can set the loader repository, ignoring config=LoaderRepositoryConfig(repositoryName: de.xyz:loader=MyTest.esb, repositoryClassName: org.jboss.mx.loading.HeirarchicalLoaderRepository3, configParserClassName: org.jboss.mx.loading.HeirarchicalLoaderRepository3ConfigParser, repositoryConfig: java2ParentDelegaton=false)
-
3. Re: ClassLoader isolation
kconner Oct 12, 2007 9:54 AM (in response to domkun)You can only specify the classloader on the outer artifact. If you include your esb artifact in another artifact then it will use whichever classloader is configured for the outer one.
The error message would therefore imply that MyTest.esb is included within something else. Is this the case? -
4. Re: ClassLoader isolation
domkun Oct 12, 2007 10:06 AM (in response to domkun)No, the .esb archive is the outer artifact.
Your suggestion also worked for me. It seems to me that I get the WARN output, but it doesn't have any effects. JBossESB is using my scoped classloader. -
5. Re: ClassLoader isolation
kconner Oct 12, 2007 10:12 AM (in response to domkun)It can't be using it. If you get the warning then the deployer has refused to create the classloader as the deployment info is already associated with a parent classloader.
If you go to the jmx-console do you see the bean de.xyz:loader=MyTest.esb? Can you send me your esb artifact? -
6. Re: ClassLoader isolation
domkun Oct 12, 2007 3:04 PM (in response to domkun)I am going to double check this on monday. Going on a short trip this weekend... I will post my results on monday.
-
7. Re: ClassLoader isolation
domkun Oct 15, 2007 2:24 AM (in response to domkun)Sorry. This was my fault, I saw this only once and I can't reproduce it. Now the deployment doesn't bring up any WARNs.
So thanks for your answers!