Drools 5.5 and Java 1.6 versus 1.7 Question
by rbiller
Does anyone know of a compatibility matrix that shows what JDK versions are
compatible with Drools 5.5? The documentation mentions at least Java 1.5 is
needed, and says some examples may need 1.6.
I have encountered a problem when classes are compiled with Java 1.7, in
that if they are referenced by a DRL file, the rules compiler gives the
error "[Class] cannot be resolved to a type" for the classes that were
compiled (actually the whole jar) with Java 1.7.
Here is my post when I was trying to resolve that compile issue:
Previous post on [Class] cannot be resolved to a type error
<http://drools.46999.n3.nabble.com/Converting-Drools-3-x-to-5-5-A-JBoss-Ru...>
The rule compiler error went away when I recompiled the classes and deployed
the jar using Java 1.6. Anyone else have an issue with 1.7, or know if
Drools 5.5 is supposed to be compatible?
Thanks,
rb
--
View this message in context: http://drools.46999.n3.nabble.com/Drools-5-5-and-Java-1-6-versus-1-7-Ques...
Sent from the Drools: User forum mailing list archive at Nabble.com.
11 years, 10 months
Accumulate Over window average NullPointerException
by codemettle
Users,
I am trying to follow this example in the main drools documentation:
http://docs.jboss.org/drools/release/5.4.0.Final/drools-fusion-docs/html_...
I have a simple rule that listens for an event, and provide an average over
a 3-event sliding window. I see 2 issues.
_DRL = "rule myRule\n"
_DRL += "when\n"
_DRL += "> $avg: Number() from accumulate (\n"
_DRL += "> DatapointProxy( key == 'testUsedMemPct', $val :
valueAsDouble ) over window:length( 3 ), \n"
_DRL += "> average( $val ) )\n"
_DRL += "then\n"
_DRL += " handleRule( rule, ruleResource, userdata, $avg );\n"
_DRL += "end\n"
1) my rule evaluates try for every event, and gives me the value of the
event vs the avg. So if i send 50, 60, 70, my handleRule function is a
called 3 times with new event array(java.lang.Object, [50.0]),
array(java.lang.Object, [60.0]), array(java.lang.Object, [70.0])
2) On the 4th event, I get the following NPE (includes JSON of target
object):
Msg:
{"DatapointProxy":{"value":"80","modTime":1362148018519,"uuid":"87163fc1-b072-4311-8cb4-b604d6d874ed","ownerUUID":"90d9d3d1-dd57-42b7-beba-4927c5551409","generatorUUID":"a8dfd038-c7a6-4317-8bf5-7911d7dbb759","key":"testUsedMemPct","name":"Test
Mem Value","managerUUID":"3beb7ead-f351-42a3-a4a4-38425b061a5a"}} Error:
java.lang.NullPointerException
java.lang.NullPointerException
at
org.drools.rule.SlidingLengthWindow.assertFact(SlidingLengthWindow.java:115)
at
org.drools.rule.BehaviorManager.assertFact(BehaviorManager.java:94)
at org.drools.reteoo.WindowNode.assertObject(WindowNode.java:167)
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:350)
at
org.drools.common.NamedEntryPoint.insert(NamedEntryPoint.java:311)
at
org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:903)
at
org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:847)
at
org.drools.impl.StatefulKnowledgeSessionImpl.insert(StatefulKnowledgeSessionImpl.java:269)
at
com.codemettle.sherpa.cam.jms.JMSMessageListenerForDrools.injectEvent(JMSMessageListenerForDrools.java:128)
at
com.codemettle.sherpa.cam.jms.JMSMessageListenerForDrools.onMessage(JMSMessageListenerForDrools.java:105)
at
org.apache.activemq.ActiveMQMessageConsumer.dispatch(ActiveMQMessageConsumer.java:1321)
at
org.apache.activemq.ActiveMQSessionExecutor.dispatch(ActiveMQSessionExecutor.java:131)
at
org.apache.activemq.ActiveMQSessionExecutor.iterate(ActiveMQSessionExecutor.java:202)
at
org.apache.activemq.thread.PooledTaskRunner.runTask(PooledTaskRunner.java:129)
at
org.apache.activemq.thread.PooledTaskRunner$1.run(PooledTaskRunner.java:47)
at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)
I would appreciate some help figuring out what the issue is. Is there
something fishy in my rule?
I thank you in advance for your consideration and help
--
View this message in context: http://drools.46999.n3.nabble.com/Accumulate-Over-window-average-NullPoin...
Sent from the Drools: User forum mailing list archive at Nabble.com.
11 years, 10 months
NoClassDefFoundError at config file
by André Fróes
I'm importing my project to netbeans and I am having this exception:
Exception in thread "main" java.lang.NoClassDefFoundError:
org/drools/compiler/DroolsParserException
at java.lang.Class.getDeclaredFields0(Native Method)
at java.lang.Class.privateGetDeclaredFields(Class.java:2308)
at java.lang.Class.getDeclaredFields(Class.java:1760)
at
com.thoughtworks.xstream.mapper.AnnotationMapper.processTypes(AnnotationMapper.java:182)
Java Result: 1
it happens when I reach the line where I set the configuration file:
SolverFactory solverFactory = new
XmlSolverFactory("/com/my/proj/planner/solver/plannerSolverConfig.xml");
I'm using now drools 5.5.0.Final without the dsl file that had some issue
(see older post), I tested on eclipse with it and it worked perfectly. The
path to the file is correct.
These are the dependencies, using maven:
drools-compiler-5.5.0.Final
drools-core-5.5.0.Final
drools-planner-core-5.5.0.Final
<properties>
<org.drools.version>5.5.0.Final</org.drools.version>
</properties>
<dependency>
<groupId>org.drools</groupId>
<artifactId>drools-core</artifactId>
<version>${org.drools.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.drools</groupId>
<artifactId>drools-compiler</artifactId>
<version>${org.drools.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.drools.planner</groupId>
<artifactId>drools-planner-core</artifactId>
<version>${org.drools.version}</version>
</dependency>
11 years, 10 months