[rules-users] Programmatically load rules classloader NullPointerException

GrantWang grant.wang at intrado.com
Tue Mar 18 12:07:18 EDT 2014


Hello,

I was trying to build a kie module and programmatically load DRL rules at
runtime. But I found for any new event type I wanted to monitor, I had to
add "@rule(event)" when I 1st created the module. If I didn't, I would get
the following exception when I  tried to updateToVersion. My java file is
also attached. Would some one please let me know what caused my problem? And
anyway to get around this problem? We really need to get the
programmatically loading rules working in our project. Thanks a lot.

PlayGround1.java
<http://drools.46999.n3.nabble.com/file/n4028783/PlayGround1.java>  

Exception in thread "main" java.lang.NullPointerException
	at
org.drools.core.common.ProjectClassLoader$InternalTypesClassLoader.defineClass(ProjectClassLoader.java:230)
	at
org.drools.core.common.ProjectClassLoader.defineType(ProjectClassLoader.java:141)
	at
org.drools.core.common.ProjectClassLoader.defineClass(ProjectClassLoader.java:152)
	at
org.drools.compiler.kie.builder.impl.KieContainerImpl.updateToVersion(KieContainerImpl.java:191)
	at com.some.app.PlayGround1.runRules(PlayGround1.java:72)
	at com.some.app.PlayGround1.main(PlayGround1.java:34)




--
View this message in context: http://drools.46999.n3.nabble.com/Programmatically-load-rules-classloader-NullPointerException-tp4028783.html
Sent from the Drools: User forum mailing list archive at Nabble.com.


More information about the rules-users mailing list