-
1. Re: Classloader bug with java2parentdelegation in JBoss 5.x?
jaikiran Nov 27, 2009 9:21 AM (in response to ops)Please post your exact config files.
While posting logs or xml content or code, please remember to wrap it in a code block by using the Code button in the message editor window. Please use the Preview button to ensure that your post is correctly formatted. -
2. Re: Classloader bug with java2parentdelegation in JBoss 5.x?
ops Nov 27, 2009 10:15 AM (in response to ops)Well, there isn't much to post. :-) I tested this scenario with a simple 1-annotation session bean, that loads a customer from its jar file. There is no ejb-jar.xml, just a jboss.xml to configure the scoping and the parent delegation:
<jboss> <loader-repository>loaderrep:loader=Apploader <loader-repository-config>java2ParentDelegation=true</loader-repository-config> </loader-repository> </jboss>
I placed a second version of the customer in server/default/lib. Both customers simply log a version number to the console to distinguish them...
Thats all... -
3. Re: Classloader bug with java2parentdelegation in JBoss 5.x?
jaikiran Nov 27, 2009 11:32 AM (in response to ops)My understanding of java2ParentDelegation is to control the parent-first or parent-last behaviour. So if you have set java2ParentDelegation=true, then if the class is not already loaded, then it will always ask the parent first to load the class. And since in your case, the parent is capable of loading that class (from server/default/lib), it will always be loaded from the jars there.
-
4. Re: Classloader bug with java2parentdelegation in JBoss 5.x?
ops Nov 27, 2009 12:04 PM (in response to ops)Yes, but if this wiki http://www.jboss.org/community/wiki/JbossClassLoadingUseCases is correct, then ehe "parent" meant in this setting is the loader repository, not the loader itself. The article shows that in a scoped repository the java2ParentDelegation is off by default, wich means that the parent loader repository is never asked for the class. So the scoped repository has to load it by itself or - if this fails - has to ask the parent class loader (NoAnnotationURLClassLoader). If you switch java2ParentDelegation on, the parent repository is asked first if it has the class already loaded but does NOT load it itself. And that`s exactly how JBoss 4.2.2.GA behaves. In my opinion, the parent repository is never allowed to load classes for a scoped repository. Did I get anything wrong?[/url]
-
5. Re: Classloader bug with java2parentdelegation in JBoss 5.x?
ops Nov 27, 2009 12:09 PM (in response to ops)Sorry for the trashy posting. Once again:
Yes, but if this wiki http://www.jboss.org/community/wiki/JbossClassLoadingUseCases is correct, then ehe "parent" meant in this setting is the loader repository, not the loader itself. The article shows that in a scoped repository the java2ParentDelegation is off by default, wich means that the parent loader repository is never asked for the class. So the scoped repository has to load it by itself or - if this fails - has to ask the parent class loader (NoAnnotationURLClassLoader). If you switch java2ParentDelegation on, the parent repository is asked first if it has the class already loaded but does NOT load it itself. And that`s exactly how JBoss 4.2.2.GA behaves. In my opinion, the parent repository is never allowed to load classes for a scoped repository. Did I get anything wrong?