[jboss-jira] [JBoss JIRA] (DROOLS-171) CompositeClassLoader fails on Android

Mark Proctor (JIRA) issues at jboss.org
Thu Jul 23 12:53:03 EDT 2015


     [ https://issues.jboss.org/browse/DROOLS-171?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Mark Proctor reassigned DROOLS-171:
-----------------------------------

    Assignee: Mario Fusco  (was: Mark Proctor)


> CompositeClassLoader fails on Android
> -------------------------------------
>
>                 Key: DROOLS-171
>                 URL: https://issues.jboss.org/browse/DROOLS-171
>             Project: Drools
>          Issue Type: Bug
>    Affects Versions: 5.5.0.Final
>            Reporter: Chris Dolan
>            Assignee: Mario Fusco
>            Priority: Minor
>
> (not sure if this is a bug or a feature request, because I doubt Android is supported)
> I'm trying to see how far I can get porting a Drools project to Android. My first roadblock is the following because the Android Dalvik classloader implementation is stricter than Java's implementation:
> java.lang.NullPointerException: parentLoader == null && !nullAllowed
>  	at java.lang.ClassLoader.<init>(ClassLoader.java:198)
>  	at java.lang.ClassLoader.<init>(ClassLoader.java:190)
>  	at org.drools.util.CompositeClassLoader.<init>(CompositeClassLoader.java:43)
>  	at org.drools.util.ClassLoaderUtil.getClassLoader(ClassLoaderUtil.java:27)
>  	at org.drools.RuleBaseConfiguration.setClassLoader(RuleBaseConfiguration.java:945)
>  	at org.drools.RuleBaseConfiguration.init(RuleBaseConfiguration.java:421)
>  	at org.drools.RuleBaseConfiguration.<init>(RuleBaseConfiguration.java:267)
>  	at org.drools.RuleBaseConfiguration.<clinit>(RuleBaseConfiguration.java:175)
>  	at org.drools.impl.KnowledgeBaseFactoryServiceImpl.newKnowledgeBaseConfiguration(KnowledgeBaseFactoryServiceImpl.java:37)
>  	at org.drools.KnowledgeBaseFactory.newKnowledgeBaseConfiguration(KnowledgeBaseFactory.java:125)
> RuleBaseConfiguration is trying to build a default configuration instance, which tries to instantiate a CompositeClassLoader. But that class calls the constructor ClassLoader(null) which is not permitted on Android. Instead, it should call the no-args ClassLoader() constructor. It's not supposed to refer to the parent classloader anyway, so it should be fine to the use the no-args version.
> [by the way, the CompositeClassLoader constructor should use DefaultLoader.INSTANCE instead of new DefaultLoader()]



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


More information about the jboss-jira mailing list