[JBoss JIRA] Created: (JBRULES-2113) NPE thrown by LeftTuple.get() method
by Tom Murphy (JIRA)
NPE thrown by LeftTuple.get() method
------------------------------------
Key: JBRULES-2113
URL: https://jira.jboss.org/jira/browse/JBRULES-2113
Project: JBoss Drools
Issue Type: Bug
Security Level: Public (Everyone can see)
Affects Versions: 5.0.0.CR1
Environment: FOund in 5.0.0.CR1 - Community version. Windows XP
Reporter: Tom Murphy
Assignee: Mark Proctor
the get() method on LeftTuple throws a null exception under certain circumstances, which are as yet undetermined.
Here is the Code:
public InternalFactHandle get(final int index) {
LeftTuple entry = this;
while ( entry.index != index ) {
entry = entry.parent;
}
return entry.handle;
}
Note that the loop moves to each parent in succession, but never checks for entry != null. If it does get to the end of the chain, it will throw an NPE
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
13 years, 8 months
[JBoss JIRA] Created: (JBRULES-2101) Intermittant NullPointerException when invoking StatefulSession.asyncUpdate() while maintainTms==true
by Greg Barton (JIRA)
Intermittant NullPointerException when invoking StatefulSession.asyncUpdate() while maintainTms==true
-----------------------------------------------------------------------------------------------------
Key: JBRULES-2101
URL: https://jira.jboss.org/jira/browse/JBRULES-2101
Project: JBoss Drools
Issue Type: Bug
Security Level: Public (Everyone can see)
Components: drools-core
Affects Versions: 5.0.1.FINAL
Environment: Ubuntu Jaunty Jackelope
Linux version 2.6.27-11-generic (buildd@yellow) (gcc version 4.3.2 (Ubuntu 4.3.2-1ubuntu11) ) #1 SMP Wed Apr 1 20:53:41 UTC 2009
Multicore
Reporter: Greg Barton
Assignee: Mark Proctor
After calling StatefulSession.asyncUpdate() the following exception occurs, but only when maintainTms==true in the rule configuration:
Exception in thread "Thread-5" java.lang.NullPointerException
at org.drools.common.AbstractWorkingMemory.update(AbstractWorkingMemory.java:1387)
at org.drools.common.AbstractWorkingMemory.update(AbstractWorkingMemory.java:1350)
at org.drools.concurrent.UpdateObject.execute(UpdateObject.java:46)
at org.drools.concurrent.CommandExecutor.run(CommandExecutor.java:78)
at java.lang.Thread.run(Thread.java:619)
AbstractWorkingMemory.java line 1387 is wrapped in an if statement with condition "this.maintainTms" so setting maintainTms=false avoids the exception entirely. The NPE producing line is this:
status = ((InternalFactHandle) factHandle).getEqualityKey().getStatus();
While encountering this problem the factHandle passed in to StatefulSession.asyncUpdate() was always non-null, so my guess is that the getEqualityKey() call returned null.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
13 years, 8 months
[JBoss JIRA] Created: (JBRULES-1675) Xpath Default Constraint Evaluations
by Paul Ryan (JIRA)
Xpath Default Constraint Evaluations
------------------------------------
Key: JBRULES-1675
URL: http://jira.jboss.com/jira/browse/JBRULES-1675
Project: JBoss Drools
Issue Type: Feature Request
Security Level: Public (Everyone can see)
Components: Drl Parser/Builder, Eclipse IDE, Rule Assemply/SPI, Solver, Verifier, xml
Reporter: Paul Ryan
Assigned To: Mark Proctor
A default set of constraint matchers for xpath based on loaded w3c DOMs would be very helpful. For our project we have alot of facts that are just an xml file (this seems to be the way the industry in general is going) that is calculated and being able to load that in to working memory and have constraint based node evaluations would be a very nice and attractive feature. I would suggest as a start a basic content equals (on elements it would match against text content and on attributes it would match against the node value) as well as a basic check for exists based on given xpath.
Potential syntax:
Fact( xml.xpath("/document//fragment[@id='myid']")) // Checks if the xpath exists in the property xml
or
Fact( xml.xpath("/document//fragment[@id='myid']") == "myvalue") // Checks if the text content of the fragment with the given id is "myvalue"
or
Fact( xml.xpath("/document//fragment[@id='myid']/@attr1") == "myattr") // Checks if the node value of the attribute attr1 in the given fragment is "myattr"
with the property xml having been defined in the fact.
I would suggest implementing this using the latest DOM stuff that has been recently released with xerces 2.9 and up as it has a very fast and efficient xpath evaluator. If you would like I think I can draw up some examples, however I don't think I know enough about drools core code to write this feature myself yet, maybe with some help.
Also this constraint module may need a new interface for configuring the size limit (or other constraint) around when to load the xml into working memory. Maybe a annotation based solution in the fact is a good idea (e.g. put an annotation @LoadDOM on xml property in the fact for properties that should be loaded into DOM), or the other option is that the designer has to set the property up as an org.w3c.dom.Document for it to be consider pre-loadable.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
13 years, 8 months
[JBoss JIRA] Created: (JBRULES-2069) NPE on RuleBase when Guvnor is down
by George Gastaldi (JIRA)
NPE on RuleBase when Guvnor is down
-----------------------------------
Key: JBRULES-2069
URL: https://jira.jboss.org/jira/browse/JBRULES-2069
Project: JBoss Drools
Issue Type: Bug
Security Level: Public (Everyone can see)
Components: drools-core
Affects Versions: 5.0.0.CR1
Reporter: George Gastaldi
Assignee: Mark Proctor
Priority: Minor
When creating a a RuleBasedAgent with the following code: org.drools.agent.RuleAgent.newRuleAgent(properties), having properties only the url property, the following stacktrace appears:
java.io.IOException: Was unable to reach server.
at org.drools.agent.URLScanner.hasChanged(URLScanner.java:155)
at org.drools.agent.URLScanner.getChangeSet(URLScanner.java:119)
at org.drools.agent.URLScanner.loadPackageChanges(URLScanner.java:96)
at org.drools.agent.RuleAgent.checkForChanges(RuleAgent.java:410)
at org.drools.agent.RuleAgent.refreshRuleBase(RuleAgent.java:362)
at org.drools.agent.RuleAgent.configure(RuleAgent.java:347)
at org.drools.agent.RuleAgent.init(RuleAgent.java:247)
at org.drools.agent.RuleAgent.newRuleAgent(RuleAgent.java:187)
at org.drools.agent.RuleAgent.newRuleAgent(RuleAgent.java:147)
followed by
java.lang.NullPointerException
at org.drools.agent.RuleAgent.refreshRuleBase(RuleAgent.java:363)
at org.drools.agent.RuleAgent.configure(RuleAgent.java:347)
at org.drools.agent.RuleAgent.init(RuleAgent.java:247)
at org.drools.agent.RuleAgent.newRuleAgent(RuleAgent.java:187)
at org.drools.agent.RuleAgent.newRuleAgent(RuleAgent.java:147)
That´s OK to throw the IOException, but the NullPointerException should not happen.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
13 years, 8 months
[JBoss JIRA] Created: (EJBTHREE-1647) @Resource injection of primitive types from JNDI
by Dennis Reed (JIRA)
@Resource injection of primitive types from JNDI
------------------------------------------------
Key: EJBTHREE-1647
URL: https://jira.jboss.org/jira/browse/EJBTHREE-1647
Project: EJB 3.0
Issue Type: Bug
Components: injection
Affects Versions: AS 4.2.1.GA
Reporter: Dennis Reed
The following does not work to inject an arbitrary JNDI entry for primitive/primitive wrapper/String fields:
@Resource( mappedName = "java:/blah/blah" )
String myVar;
In older versions, a "NYI" exception was thrown (then changed to a different exception before getting to the user).
In newer versions, the literal value in mappedName is injected.
For all other types, the JNDI entry injection works. For example, the following does inject that same String from JNDI:
@Resource( mappedName = "java:/blah/blah" )
Object myVar;
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
13 years, 8 months
[JBoss JIRA] Created: (JBRULES-2588) Error creates null package without generating error message
by Thomas Hehl (JIRA)
Error creates null package without generating error message
-----------------------------------------------------------
Key: JBRULES-2588
URL: https://jira.jboss.org/browse/JBRULES-2588
Project: Drools
Issue Type: Bug
Security Level: Public (Everyone can see)
Components: drools-compiler
Affects Versions: 5.0.1.FINAL
Environment: Windows XP/Eclipse Ganymeade
Reporter: Thomas Hehl
Assignee: Mark Proctor
Priority: Minor
Fix For: 5.0.2, 5.1.0.CR1, FUTURE
PackageBuilder contains the following method:
public void addPackageFromDrl(final Reader reader) throws DroolsParserException,
IOException {
this.resource = new ReaderResource( reader );
final DrlParser parser = new DrlParser();
final PackageDescr pkg = parser.parse( reader );
this.results.addAll( parser.getErrors() );
if ( !parser.hasErrors() ) {
addPackage( pkg );
}
this.resource = null;
}
The problem is that if the parser generates errors, then the package is null and my application blows up later on with a null pointer exception, but the error messages are lost.
To fix this problem I recommend a code change like:
public void addPackageFromDrl(final Reader reader) throws DroolsParserException,
IOException {
this.resource = new ReaderResource( reader );
final DrlParser parser = new DrlParser();
final PackageDescr pkg = parser.parse( reader );
this.results.addAll( parser.getErrors() );
if ( parser.hasErrors() ) {
System.err.println("Parser errors generating null package:" + this.results.toString());
else{
addPackage( pkg );
}
this.resource = null;
}
This will cause an error dump in the log without changing any functionality.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
13 years, 8 months
[JBoss JIRA] Created: (JBRULES-2343) Context assist in DSLR Editor
by Hamza Bakkali (JIRA)
Context assist in DSLR Editor
-----------------------------
Key: JBRULES-2343
URL: https://jira.jboss.org/jira/browse/JBRULES-2343
Project: Drools
Issue Type: Bug
Security Level: Public (Everyone can see)
Affects Versions: 5.0.1.FINAL
Environment: Eclipse 3.4 Ganymede
Reporter: Hamza Bakkali
Assignee: Mark Proctor
Fix For: 4.0.8
I have been using drools 4 for couple of months now and I am starting to get the hang of it. We recently decided to move to Dools 5 with Eclipse 3.4.2 (Ganymede).
We unfortunately hit a major 'show stopper' (for us). In the DSLR editor: Context Assist + space + enter removes/replaces the whole line, not only the place holder.
In other words:
DSL:
[*][]Log : {msg}=System.out.println("{msg}");
[*][]id1="some id label"
DSLR:
rule "MyRule"
when
then
end
If I Press L , control space --> the line Log:{msg} appears in the context menu. Hit enter I get
Log :{msg}
Now, If want to replace msg by id1. I position the cursor in the {msg}, hit ctrl space, id1 shows in the list. I hit enter the whole line disappear, and I am left with
id1
instead of
Log : id1
Is this a setting somewhere in eclipse itself?? I doubt it.
The same thing use to work as expected in Drools 4.
thanks.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
13 years, 8 months