Are you sure that basicFlow.rf is in your classpath correctly?
From: rules-users-bounces(a)lists.jboss.org [mailto:rules-users-bounces@lists.jboss.org] On
Behalf Of James Yu
Sent: 06 September 2011 10:08
To: rules-users(a)lists.jboss.org
Subject: [rules-users] encounter NullPointerException when adding ruleflow
Hi all,
I tried to run Drools in a webapp, it runs smoothly when I only load simple rules.
The spec I have:
AP server --> WASCE2.1 (or geronimo 2.1)
Spring --> 3.0.5
Drools --> 5.2 Fianl
JVM --> IBM SDK 1.6
When I tried to use ruleflow --> execute drl in rf, I got NullPointerException with the
following trace:
exception
org.springframework.web.util.NestedServletException: Request processing failed; nested
exception is java.lang.NullPointerException
org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:656)
org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:549)
javax.servlet.http.HttpServlet.service(HttpServlet.java:693)
javax.servlet.http.HttpServlet.service(HttpServlet.java:806)
root cause
java.lang.NullPointerException
org.drools.compiler.PackageBuilder.addProcessFromXml(PackageBuilder.java:516)
org.drools.compiler.PackageBuilder.addKnowledgeResource(PackageBuilder.java:556)
org.drools.builder.impl.KnowledgeBuilderImpl.add(KnowledgeBuilderImpl.java:28)
net.viralpatel.drools.core.DroolsCore.createKnowledgeBase(DroolsCore.java:17)
net.viralpatel.contact.controller.ContactController.listContacts(ContactController.java:41)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:59)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:39)
java.lang.reflect.Method.invoke(Method.java:612)
org.springframework.web.bind.annotation.support.HandlerMethodInvoker.invokeHandlerMethod(HandlerMethodInvoker.java:176)
org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.invokeHandlerMethod(AnnotationMethodHandlerAdapter.java:426)
org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.handle(AnnotationMethodHandlerAdapter.java:414)
org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:790)
org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:719)
org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:644)
org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:549)
javax.servlet.http.HttpServlet.service(HttpServlet.java:693)
javax.servlet.http.HttpServlet.service(HttpServlet.java:806)
net.viralpatel.drools.core.DroolsCore.createKnowledgeBase(DroolsCore.java:17) is the
following line:
builder.add(ResourceFactory.newClassPathResource("basicFlow.rf"),
ResourceType.DRF);
Any advise is appreciated.
This is a UTF-8 formatted mail
-----------------------------------------------
James C.-C.Yu
________________________________
**************************************************************************************
This message is confidential and intended only for the addressee. If you have received
this message in error, please immediately notify the postmaster(a)nds.com and delete it from
your system as well as any copies. The content of e-mails as well as traffic data may be
monitored by NDS for employment and security purposes. To protect the environment please
do not print this e-mail unless necessary.
NDS Limited. Registered Office: One London Road, Staines, Middlesex, TW18 4EX, United
Kingdom. A company registered in England and Wales. Registered no. 3080780. VAT no. GB 603
8808 40-00
**************************************************************************************