[rules-users] Class loader issue with dynamically generated classes and JBoss AS

Michael Neale michael.neale at gmail.com
Thu May 24 21:05:50 EDT 2007


In the BRMS I added the classes to a specific classloader that I pass into
the package configuration (as I have classes that are loaded on the fly -
similar to generated).

Look at the getInstance method of
http://anonsvn.labs.jboss.com/labs/jbossrules/trunk/drools-jbrms/src/main/java/org/drools/brms/server/builder/BRMSPackageBuilder.java

That adds classes to a custom classloader that the package builder uses
(without adding it to the apps classpath - although any classes on the apps
classpath will be available of course).

If you look at the BRMS code I am sure you can copy some of that.

Michael.


On 5/24/07, Jordan.Parker at sungard.com <Jordan.Parker at sungard.com> wrote:
>
>
> We're having a class loader issue compiling rules that use dynamically
> generated java beans as facts when deploying our application on JBoss
> Application Server, versions 4.0.3SP1 and 4.0.5.  We're using JBoss Rules
> 4.0.0.MR2 and the Janino compiler.  When deploying to WebLogic 9.2, there
> are no issues compiling or executing those same rules.
>
> We've tried setting the class loader several different ways, including
> using the method Edson suggests in his blog entry on using dynamically
> generated classes.  The issue seems to be with the JBoss class loader
> UnifiedClassLoader3, which contains a list of blacklisted classes.  If I
> cast the context class loader to UnifiedClassLoader3, and call '
> clearBlackLists<http://docs.jboss.com/jbossas/javadoc/4.0.3SP1/jmx/org/jboss/mx/loading/RepositoryClassLoader.html%5ClclearBlackLists%28%29>()'
> before compiling the rules, the rules compile and execute without any
> issues.  Otherwise, I get the error 'Unable to resolve ObjectType
> 'NameOfGeneratedClass''.
>
> My question is has anyone run across this issue before, or does anyone
> have a solution to this problem that doesn't require application server
> specific code (casting and calling the clearBlackLists method)?
>
> Thank you,
>
> Jordan Parker
> _______________________________________________
> rules-users mailing list
> rules-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20070525/49901b4d/attachment.html 


More information about the rules-users mailing list