Guvnor Help !!
by abhinay_agarwal
Hey,
I’ve been using GUVNOR for uploading JARS and creating rules using FACTS..
Now I thing I wanna know is - a rule which is GLOBAL AREA, can it be used
to fire rules which are there in some different package ?? (same facts may
be uploaded in both GLOBAL AREA and the PACKAGE !! .. if requirement asks
for it !!! )
Thanks,
Abhinay
--
View this message in context: http://drools.46999.n3.nabble.com/Guvnor-Help-tp4018290.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
12 years, 4 months
Possibly Broken drools-core-5.4.0.Final.jar?
by Darin Wilcox
Hello all,
I have an application that was written originally using Drools 5.3.1.Final
that works just fine. I wrote a JUnit test that runs through values
contained in a spreadsheet. Everything was working great. I updated the
application to use Drools 5.4.0.Final and then the test stopped working. I
have debugged the code and here is the exception thrown:
Exception executing consequence for rule "create vcmax" in
org.zoikks.drools: java.lang.NullPointerException
at
org.drools.runtime.rule.impl.DefaultConsequenceExceptionHandler.handleException(DefaultConsequenceExceptionHandler.java:39)
at org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:1283)
at org.drools.common.DefaultAgenda.fireNextItem(DefaultAgenda.java:1209)
at org.drools.common.DefaultAgenda.fireAllRules(DefaultAgenda.java:1442)
at
org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:710)
at
org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:674)
at
org.drools.impl.StatefulKnowledgeSessionImpl.fireAllRules(StatefulKnowledgeSessionImpl.java:230)
at
org.zoikks.drools.xlsx.SampleWorkflowXlsx.check(SampleWorkflowXlsx.java:103)
at
org.zoikks.drools.xlsx.SampleWorkflowXlsx.testSampleXlsxSheets(SampleWorkflowXlsx.java:77)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at junit.framework.TestCase.runTest(TestCase.java:168)
at junit.framework.TestCase.runBare(TestCase.java:134)
at junit.framework.TestResult$1.protect(TestResult.java:110)
at junit.framework.TestResult.runProtected(TestResult.java:128)
at junit.framework.TestResult.run(TestResult.java:113)
at junit.framework.TestCase.run(TestCase.java:124)
at junit.framework.TestSuite.runTest(TestSuite.java:243)
at junit.framework.TestSuite.run(TestSuite.java:238)
at
org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:83)
at
org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
at
org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
Caused by: java.lang.NullPointerException
at ConditionEvaluator0f64b1c63942476d80eb29d1cdffda28.evaluate(Unknown
Source)
at
org.drools.rule.constraint.MvelConstraint.evaluate(MvelConstraint.java:167)
at
org.drools.rule.constraint.MvelConstraint.isAllowed(MvelConstraint.java:124)
at org.drools.reteoo.AlphaNode.assertObject(AlphaNode.java:137)
at
org.drools.reteoo.CompositeObjectSinkAdapter.doPropagateAssertObject(CompositeObjectSinkAdapter.java:497)
at
org.drools.reteoo.CompositeObjectSinkAdapter.propagateAssertObject(CompositeObjectSinkAdapter.java:382)
at org.drools.reteoo.ObjectTypeNode.assertObject(ObjectTypeNode.java:235)
at org.drools.reteoo.EntryPointNode.assertObject(EntryPointNode.java:240)
at org.drools.common.NamedEntryPoint.insert(NamedEntryPoint.java:337)
at org.drools.common.NamedEntryPoint.insert(NamedEntryPoint.java:298)
at
org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:888)
at
org.drools.base.DefaultKnowledgeHelper.insert(DefaultKnowledgeHelper.java:187)
at
org.drools.base.DefaultKnowledgeHelper.insert(DefaultKnowledgeHelper.java:181)
at
org.zoikks.drools.Rule_create_vcmax_692832fd6e0547e09b6f632175df45ff.defaultConsequence(Rule_create_vcmax_692832fd6e0547e09b6f632175df45ff.java:7)
at
org.zoikks.drools.Rule_create_vcmax_692832fd6e0547e09b6f632175df45ffDefaultConsequenceInvokerGenerated.evaluate(Unknown
Source)
at
org.zoikks.drools.Rule_create_vcmax_692832fd6e0547e09b6f632175df45ffDefaultConsequenceInvoker.evaluate(Unknown
Source)
at org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:1273)
... 26 more
This appears to be a race-condition occurring someplace within the app
because it executes find some times, yet other times a NPE is thrown. The
location where the exception is originating is new to Drools 5.4.0.Final so
there is nothing to compare against in previous versions. Has anyone else
seen this and/or does anyone know how to solve this problem?
I have attached code that is using Drools 5.4.0.Final. To successfully
re-produce the problem, place a breakpoint at
org.drools.rule.constraint.MvelConstraint.evaluate() [Line 167] and then
step through. The exception has been occurring continuously.
Thanks,
- Darin
12 years, 4 months
ruleflow-group
by al so
looks like one can't activate a ruleflow-group inside a drl file? Only
available via UI?
I was thinking there'll be some kind of setFocus way to control rule
execution using this ruleflow-group.
12 years, 4 months
KnowledgeAgent custom class loader not working for PKG resources
by Hrumph
I believe there may be a bug when trying to use a custom class loader with
the KnowledgeAgent and the KnowledgeBuilderConfiguration, and when the
ChangeSet is a PKG resource.
I have been trying to get the knowledge-agent-classloader sample from the
new Drools Cookbook to work with a PKG resource. The sample works fine for
a DRL resource, but when I convert it to use my fact jar, and a PKG resource
containing my rules, which I downloaded from Guvnor, it throws a
ClassNotFoundException for my fact model. If I put my fact model in the
classpath, the error goes away and my rules can be added to the
KnowledgeAgent and run correctly. Following is the code from the sample
that I have converted, and I have attached a zip file with a complete
project demonstrating the problem. Also, I can get my rules and fact
model to work if I use a DRL ChangeSet.knowledge-agent-classloader.zip
URL modelJarURL = getClass().getResource("Patient-1.0.jar");
URLClassLoader customURLClassloader = new URLClassLoader(new URL[]
{modelJarURL });
KnowledgeBuilderConfiguration kbuilderConfig =
KnowledgeBuilderFactory.newKnowledgeBuilderConfiguration(null,
customURLClassloader);
KnowledgeBaseConfiguration kbaseConfig =
KnowledgeBaseFactory.newKnowledgeBaseConfiguration(null,
customURLClassloader);
KnowledgeBase kbase =
KnowledgeBaseFactory.newKnowledgeBase(kbaseConfig);
KnowledgeAgentConfiguration aconf =
KnowledgeAgentFactory.newKnowledgeAgentConfiguration();
KnowledgeAgent kagent =
KnowledgeAgentFactory.newKnowledgeAgent("test", kbase, aconf,
kbuilderConfig);
// kagent.applyChangeSet(new ClassPathResource("change-set.xml",
getClass())); // this goes with model.jar
// kagent.applyChangeSet(new ClassPathResource("drl-change-set.xml",
getClass())); // this goes with Patient.jar
kagent.applyChangeSet(new ClassPathResource("pkg-change-set.xml",
getClass())); // this goes with Patient.jar
return kagent.getKnowledgeBase();
Following is the stack trace from the error:
java.lang.NullPointerException
at
org.drools.impl.KnowledgeBaseImpl.addKnowledgePackages(KnowledgeBaseImpl.java:148)
at
org.drools.agent.impl.KnowledgeAgentImpl.addResourcesToKnowledgeBase(KnowledgeAgentImpl.java:1016)
at
org.drools.agent.impl.KnowledgeAgentImpl.rebuildResources(KnowledgeAgentImpl.java:785)
at
org.drools.agent.impl.KnowledgeAgentImpl.buildKnowledgeBase(KnowledgeAgentImpl.java:657)
at
org.drools.agent.impl.KnowledgeAgentImpl.applyChangeSet(KnowledgeAgentImpl.java:190)
at
org.drools.agent.impl.KnowledgeAgentImpl.applyChangeSet(KnowledgeAgentImpl.java:169)
at
drools.cookbook.chapter02.KnowledgeAgentClassloaderTest.createKnowledgeBase(KnowledgeAgentClassloaderTest.java:59)
at
drools.cookbook.chapter02.KnowledgeAgentClassloaderTest.customClassloaderTest(KnowledgeAgentClassloaderTest.java:30)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.junit.internal.runners.TestMethod.invoke(TestMethod.java:59)
at
org.junit.internal.runners.MethodRoadie.runTestMethod(MethodRoadie.java:98)
at
org.junit.internal.runners.MethodRoadie$2.run(MethodRoadie.java:79)
at
org.junit.internal.runners.MethodRoadie.runBeforesThenTestThenAfters(MethodRoadie.java:87)
at
org.junit.internal.runners.MethodRoadie.runTest(MethodRoadie.java:77)
at org.junit.internal.runners.MethodRoadie.run(MethodRoadie.java:42)
at
org.junit.internal.runners.JUnit4ClassRunner.invokeTestMethod(JUnit4ClassRunner.java:88)
at
org.junit.internal.runners.JUnit4ClassRunner.runMethods(JUnit4ClassRunner.java:51)
at
org.junit.internal.runners.JUnit4ClassRunner$1.run(JUnit4ClassRunner.java:44)
at
org.junit.internal.runners.ClassRoadie.runUnprotected(ClassRoadie.java:27)
at
org.junit.internal.runners.ClassRoadie.runProtected(ClassRoadie.java:37)
at
org.junit.internal.runners.JUnit4ClassRunner.run(JUnit4ClassRunner.java:42)
at
org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
at
org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
I have been having the exact same problem when trying to use a custom class
loader with just a KnowldegeBuilder and no KnowledgeAgent.
http://drools.46999.n3.nabble.com/file/n3746456/knowledge-agent-classload...
knowledge-agent-classloader.zip
--
View this message in context: http://drools.46999.n3.nabble.com/KnowledgeAgent-custom-class-loader-not-...
Sent from the Drools: User forum mailing list archive at Nabble.com.
12 years, 4 months
GUVNOR 5.4 JBOSS v4.2.3 deployment error
by abhinay_agarwal
hey,
i was trying to upgrade from guvnor 5.3.0 to 5.4 when i pasted the guvnor
war into the deployment folder and restarted the server it throwed an error
2012-06-29 10:06:52,163 DEBUG [org.jboss.web.WebModule] Starting failed
jboss.web.deployment:war=drools-guvnor.war,id=-1487681113
org.jboss.deployment.DeploymentException: Error during deploy; - nested
throwable: (javax.naming.NamingException: resource-env-ref: BeanManager has
no valid JNDI binding. Check the jboss-web/resource-env-ref.)
i know its some binding error in jboss but any help would be appreciated !!
Thanks in advance,
Abhinay
--
View this message in context: http://drools.46999.n3.nabble.com/GUVNOR-5-4-JBOSS-v4-2-3-deployment-erro...
Sent from the Drools: User forum mailing list archive at Nabble.com.
12 years, 4 months
Hibernate Configuration with Drools 5.4
by zeeshan
Hi All !
I want to use Hibernate for database persistence in my drools project.
Please suggest me the steps. I am using 5.4.0 final version. Which version
of hibernate I shall use whether 3.1 or Annotation one.....?? I have idea
about 3.1. Actually I am having 50,000 records in one of my Decision table,
so it is taking too much time to give the result. Now I have decided to use
move this to database. So please tell me configuration steps.
Thanks !!
--
View this message in context: http://drools.46999.n3.nabble.com/Hibernate-Configuration-with-Drools-5-4...
Sent from the Drools: User forum mailing list archive at Nabble.com.
12 years, 4 months
break points in drl file
by al so
has anyone tried putting break points in drl file as part of a Spring MVC
app?
no clue on which Main method to choose when doing Debug As Drools
Application from eclipse 3.6/3.7 in this situation.
12 years, 4 months