[JBoss JIRA] (JBRULES-3541) FactHandle has marshalling problems with JAXB
by Mark Proctor (JIRA)
Mark Proctor created JBRULES-3541:
-------------------------------------
Summary: FactHandle has marshalling problems with JAXB
Key: JBRULES-3541
URL: https://issues.jboss.org/browse/JBRULES-3541
Project: Drools
Issue Type: Bug
Security Level: Public (Everyone can see)
Reporter: Mark Proctor
Assignee: Mark Proctor
There are two issues when serialising the FactHandle. The first is that there is no setExternalForm, on older JAXB this throws an exception, on newer one's it just doesn't set the field.
The other issue is with XmlAdapter, when the FactHandle is nested. It seems JAXB is not picking up it has annotations and renders it as a generic xsi:type, which is ugly verbose. This may be a limitation of XmlAdapter and it's generics arguments.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
12 years, 1 month
[JBoss JIRA] (JBRULES-3388) KnowledgeAgent custom classloader not working for PKG resources
by Herman Post (JIRA)
Herman Post created JBRULES-3388:
------------------------------------
Summary: KnowledgeAgent custom classloader not working for PKG resources
Key: JBRULES-3388
URL: https://issues.jboss.org/browse/JBRULES-3388
Project: Drools
Issue Type: Bug
Security Level: Public (Everyone can see)
Components: drools-core
Affects Versions: 5.3.1.Final
Environment: Windows 7, Java7-5, JBoss AS7.1
Reporter: Herman Post
Assignee: Mark Proctor
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.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
12 years, 1 month
[JBoss JIRA] (JBRULES-3681) NullPointerException in ConditionAnalyzer
by Paul Evans (JIRA)
Paul Evans created JBRULES-3681:
-----------------------------------
Summary: NullPointerException in ConditionAnalyzer
Key: JBRULES-3681
URL: https://issues.jboss.org/browse/JBRULES-3681
Project: Drools
Issue Type: Bug
Security Level: Public (Everyone can see)
Components: drools-core (expert)
Affects Versions: 5.5.0.CR1, 5.4.0.Final
Environment: Windows XP
Java 1.6.0_24 (build 1.6.0_24-b07), Hotspot Client VM (build 19.1-b02, mixed mode, sharing)
Reporter: Paul Evans
Assignee: Mark Proctor
I'm using Drools in a relatively vanilla fashion -- not doing anything fancy; no custom DSLs or whatnot. I have a JUnit test case that invokes a set of rules. When the test case is run individually, it passes just fine. However, when the test case is run within a larger test suite (i.e., with other test cases), the test fails. When running the test suite, I do see an exception being thrown by Drools:
Exception in thread "Thread-1" java.lang.NullPointerException
at org.drools.rule.constraint.ConditionAnalyzer.analyzeSingleCondition(ConditionAnalyzer.java:116)
at org.drools.rule.constraint.ConditionAnalyzer.analyzeCondition(ConditionAnalyzer.java:102)
at org.drools.rule.constraint.ConditionAnalyzer.analyzeCondition(ConditionAnalyzer.java:73)
at org.drools.rule.constraint.MvelConditionEvaluator.getAnalyzedCondition(MvelConditionEvaluator.java:83)
at org.drools.rule.constraint.MvelConstraint.executeJitting(MvelConstraint.java:214)
at org.drools.rule.constraint.MvelConstraint.access$000(MvelConstraint.java:41)
at org.drools.rule.constraint.MvelConstraint$1.run(MvelConstraint.java:201)
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)
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
12 years, 1 month
[JBoss JIRA] (JBRULES-3626) Add support for strong negation
by Davide Sottara (JIRA)
Davide Sottara created JBRULES-3626:
---------------------------------------
Summary: Add support for strong negation
Key: JBRULES-3626
URL: https://issues.jboss.org/browse/JBRULES-3626
Project: Drools
Issue Type: Feature Request
Security Level: Public (Everyone can see)
Reporter: Davide Sottara
Assignee: Davide Sottara
Priority: Minor
Drools "not" operator implements a type of "negation by failure", i.e. not X() behaves as the negation of "exists" or, in other words, translates as "it is NOT asserted that ...".
However, another form of stronger negation is needed to express conditionals such as "it is asserted that NOT ..."
It should be possible, then, to assert facts both in a "positive" and "negative" way, to assert THAT and THAT NOT.
The language should also support a "neg" CE to create "negative" patterns which will match with negative facts. I.e. it should be possible to write rules such as:
when $p : Person() and Car( owner == $p ) then
// a positive, matching Car is present in the WM
when $p : Person() and neg Car( owner == $p ) then
// a negative, matching Car is present in the WM
when $p : Person() and not Car( owner == $p ) then
// neither a positive nor a negative fact exists in the WM
For a more detailed description and motivation see e.g.:
https://oxygen.informatik.tu-cottbus.de/publications/wagner/WebRules2Neg.pdf
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
12 years, 1 month
[JBoss JIRA] (JBRULES-3675) java.lang.LinkageError, but only sometimes (multithreading issue)
by kenneth westelinck (JIRA)
kenneth westelinck created JBRULES-3675:
-------------------------------------------
Summary: java.lang.LinkageError, but only sometimes (multithreading issue)
Key: JBRULES-3675
URL: https://issues.jboss.org/browse/JBRULES-3675
Project: Drools
Issue Type: Bug
Security Level: Public (Everyone can see)
Components: drools-core
Affects Versions: 5.4.0.Final
Environment: - JBoss 7.1.1
- drools 5.4.0.Final
- jdk 1.6u30
- Windows 7 64 bit
Reporter: kenneth westelinck
Assignee: Mark Proctor
See mail on mailinglist:
{noformat}
We have an application (A) deployed on JBoss 7.1.1 accepting commands (CQRS,
but only C and Q :) ). A console application (B) is sending a large volume
of commands to create entities in A. Entities in A are validated by Drools
(plain drl files, configured in spring using drools-spring). Most of the
time this works just fine. But sometimes, we get the following exception:
java.lang.LinkageError: loader (instance of
org/drools/rule/JavaDialectRuntimeData$PackageClassLoader): attempted
duplicate class definition for name:
"a/b/c/Rule_person_unique___name_656ee3db19d34e689d95e2d6b2be67b6"
at java.lang.ClassLoader.defineClass1(Native Method) [rt.jar:1.6.0_30]
at java.lang.ClassLoader.defineClassCond(ClassLoader.java:631) [rt.jar:1.6.0_30]
at java.lang.ClassLoader.defineClass(ClassLoader.java:615) [rt.jar:1.6.0_30]
at org.drools.rule.JavaDialectRuntimeData$PackageClassLoader.fastFindClass(JavaDialectRuntimeData.java:615) [drools-core-5.4.0.Final.jar:5.4.0.Final]
at org.drools.util.CompositeClassLoader$CachingLoader.load(CompositeClassLoader.java:254) [knowledge-api-5.4.0.Final.jar:5.4.0.Final]
at org.drools.util.CompositeClassLoader$CachingLoader.load(CompositeClassLoader.java:237) [knowledge-api-5.4.0.Final.jar:5.4.0.Final]
at org.drools.util.CompositeClassLoader.loadClass(CompositeClassLoader.java:88) [knowledge-api-5.4.0.Final.jar:5.4.0.Final]
at java.lang.ClassLoader.loadClass(ClassLoader.java:295) [rt.jar:1.6.0_30]
at java.lang.ClassLoader.loadClass(ClassLoader.java:247) [rt.jar:1.6.0_30]
at a.b.c.Rule_person___unique___name_656ee3db19d34e689d95e2d6b2be67b6Eval0InvokerGenerated.evaluate(Unknown Source)
at a.b.c.Rule_person___unique___name_656ee3db19d34e689d95e2d6b2be67b6Eval0Invoker.evaluate(Unknown Source)
at org.drools.rule.EvalCondition.isAllowed(EvalCondition.java:114) [drools-core-5.4.0.Final.jar:5.4.0.Final]
Any idea where this is coming from or what's causing this.
{noformat}
And the answer:
{noformat}
I have never experienced this myself, but after having a quick look at the code I believe this could be a multi-threading problem. In the abstract class java.lang.ClassLoader the method loadClass(String, boolean) is synchronized, but both org.drools.util.CompositeClassLoader and org.drools.rule.JavaDialectRuntimeData$PackageClassLoader override this method without the use of "synchronized".
I would suggest you create a JIRA issue for this.
{noformat}
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
12 years, 1 month
[JBoss JIRA] (JBRULES-3646) Add tooltip on condition in ruleflow to show the code of it
by Jérémie Lagarde (JIRA)
Jérémie Lagarde created JBRULES-3646:
----------------------------------------
Summary: Add tooltip on condition in ruleflow to show the code of it
Key: JBRULES-3646
URL: https://issues.jboss.org/browse/JBRULES-3646
Project: Drools
Issue Type: Feature Request
Security Level: Public (Everyone can see)
Components: drools-eclipse
Reporter: Jérémie Lagarde
Assignee: Mark Proctor
To know the condition code you must open the "constraints" property and then open the constraint itself.
It would be interesting to have a tooltip to see it directly by passing the cursor over the condition.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
12 years, 1 month
[JBoss JIRA] (JBRULES-3671) NPE in SlidingLengthWindow.assertFact when some event in window expired
by Marek Winkler (JIRA)
Marek Winkler created JBRULES-3671:
--------------------------------------
Summary: NPE in SlidingLengthWindow.assertFact when some event in window expired
Key: JBRULES-3671
URL: https://issues.jboss.org/browse/JBRULES-3671
Project: Drools
Issue Type: Bug
Security Level: Public (Everyone can see)
Components: drools-compiler (fusion)
Affects Versions: 5.5.0.Beta1, 5.4.0.Final
Reporter: Marek Winkler
Assignee: Mark Proctor
Consider the following DRL (taken from the CepEspTest integration test, the only modification is commenting out the {{@expires}} declaration):
{code:title=test_CEP_collectWithWindows.drl}
package org.drools;
import java.util.List
global List timeResults;
global List lengthResults;
declare OrderEvent
@role( event )
//@expires( 2m )
end
rule "collect with time window"
when
$list : List( empty == false ) from collect(
$o : OrderEvent() over window:time(30s) )
then
timeResults.add( $list.size() );
end
rule "collect with length window"
when
$list : List( empty == false ) from collect(
$o : OrderEvent() over window:length(3) )
then
lengthResults.add( $list.size() );
end
{code}
When you insert more than 3 events and advance pseudo clock time such that an event in the length window expires, a NPE at {{org.drools.rule.SlidingLengthWindow.assertFact(SlidingLengthWindow.java:115)}} is thrown. See the attachment for complete stack trace.
The original test with the {{@expires}} declaration uncommented passes.
The problem seems not to be present in Drools 5.3.3.Final.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
12 years, 1 month