[
https://issues.jboss.org/browse/JBRULES-3122?page=com.atlassian.jira.plug...
]
Jesper S. Møller commented on JBRULES-3122:
-------------------------------------------
I found another place where a null is being returned from a Drools class loader, this time
it is the CompositeClassLoader in knowledge-api. For the life of me, I cannot find the
tests for it, but I've added a pull request for it as well.
Pull request at:
https://github.com/droolsjbpm/droolsjbpm-knowledge/pull/17
Classloading error with AspectJ and Drools 5.2.0.Final
------------------------------------------------------
Key: JBRULES-3122
URL:
https://issues.jboss.org/browse/JBRULES-3122
Project: Drools
Issue Type: Bug
Security Level: Public(Everyone can see)
Components: drools-core
Affects Versions: 5.2.0.Final
Reporter: stevearoonie
Assignee: Edson Tirelli
Fix For: 5.3.2.Final, 5.4.0.Beta2
NPE running Drools with AspectJ
java.lang.NullPointerException
at
org.aspectj.weaver.loadtime.ClassLoaderWeavingAdaptor.parseDefinitions(ClassLoaderWeavingAdaptor.java:251)
at
org.aspectj.weaver.loadtime.DefaultWeavingContext.getDefinitions(DefaultWeavingContext.java:130)
at
org.aspectj.weaver.loadtime.ClassLoaderWeavingAdaptor.initialize(ClassLoaderWeavingAdaptor.java:161)
at
org.aspectj.weaver.loadtime.Aj$ExplicitlyInitializedClassLoaderWeavingAdaptor.initialize(Aj.java:271)
at
org.aspectj.weaver.loadtime.Aj$ExplicitlyInitializedClassLoaderWeavingAdaptor.getWeavingAdaptor(Aj.java:276)
at org.aspectj.weaver.loadtime.Aj$WeaverContainer.getWeaver(Aj.java:254)
at org.aspectj.weaver.loadtime.Aj.preProcess(Aj.java:90)
at
org.aspectj.weaver.loadtime.ClassPreProcessorAgentAdapter.transform(ClassPreProcessorAgentAdapter.java:54)
at sun.instrument.TransformerManager.transform(TransformerManager.java:169)
at sun.instrument.InstrumentationImpl.transform(InstrumentationImpl.java:365)
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClassCond(ClassLoader.java:632)
at java.lang.ClassLoader.defineClass(ClassLoader.java:616)
at
org.drools.rule.JavaDialectRuntimeData$PackageClassLoader.fastFindClass(JavaDialectRuntimeData.java:570)
at
org.drools.util.CompositeClassLoader$CachingLoader.load(CompositeClassLoader.java:258)
at
org.drools.util.CompositeClassLoader$CachingLoader.load(CompositeClassLoader.java:241)
at org.drools.util.CompositeClassLoader.loadClass(CompositeClassLoader.java:88)
at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
at org.drools.rule.JavaDialectRuntimeData.wire(JavaDialectRuntimeData.java:405)
at org.drools.rule.JavaDialectRuntimeData.wire(JavaDialectRuntimeData.java:396)
at
org.drools.rule.JavaDialectRuntimeData.onBeforeExecute(JavaDialectRuntimeData.java:237)
at
org.drools.rule.DialectRuntimeRegistry.onBeforeExecute(DialectRuntimeRegistry.java:132)
at org.drools.compiler.PackageBuilder.reloadAll(PackageBuilder.java:796)
at org.drools.compiler.PackageBuilder.addPackage(PackageBuilder.java:751)
at org.drools.compiler.PackageBuilder.addPackageFromDrl(PackageBuilder.java:360)
at org.drools.compiler.PackageBuilder.addKnowledgeResource(PackageBuilder.java:538)
at org.drools.builder.impl.KnowledgeBuilderImpl.add(KnowledgeBuilderImpl.java:28)
at
au.com.promedicus.rules.KnowledgeBaseBuilder.addPackagesFromList(KnowledgeBaseBuilder.java:108)
at au.com.promedicus.rules.KnowledgeBaseBuilder.build(KnowledgeBaseBuilder.java:69)
at au.com.promedicus.rules.KnowledgeBaseBuilder.build(KnowledgeBaseBuilder.java:54)
I have traced the problem to
org.drools.rule.JavaDialectRuntimeData$PackageClassLoader.getResources. This returns null
whereas AspectJ expects it to at least return an empty enumeration - hence the NPE.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see:
http://www.atlassian.com/software/jira