[JBoss JIRA] Created: (JBRULES-3140) NullPointerException thrown on JPA synchronization.afterCompletion() clearProcessInstances()
by Nick Bruno (JIRA)
NullPointerException thrown on JPA synchronization.afterCompletion() clearProcessInstances()
--------------------------------------------------------------------------------------------
Key: JBRULES-3140
URL: https://issues.jboss.org/browse/JBRULES-3140
Project: Drools
Issue Type: Bug
Security Level: Public (Everyone can see)
Components: drools-core
Affects Versions: 5.2.0.Final
Reporter: Nick Bruno
Assignee: Mark Proctor
In org.drools.persistence.SingleSessionCommandService$SynchronizationImpl.afterCompletion(), the following generates a NullPointerException when no processes are implemented.
{noformat}if ( ksession != null ) {
((InternalKnowledgeRuntime) ksession).getProcessRuntime().clearProcessInstances(); // NullPointerException
((JPAWorkItemManager) ksession.getWorkItemManager()).clearWorkItems();
}
{noformat}
The fix is to grab the InternalProcessRuntime to a local variable and test if it is null before calling clearProcessInstances(), as so:
{noformat}InternalProcessRuntime ipr = ((InternalKnowledgeRuntime) ksession).getProcessRuntime();
if( ipr != null) {
ipr.clearProcessInstances();
}{noformat}
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
14 years, 7 months
[JBoss JIRA] Created: (AS7-1969) Attribute pattern of access-log element is removed when deploying applications with XNIO
by Knut-Olav Hoven (JIRA)
Attribute pattern of access-log element is removed when deploying applications with XNIO
----------------------------------------------------------------------------------------
Key: AS7-1969
URL: https://issues.jboss.org/browse/AS7-1969
Project: Application Server 7
Issue Type: Bug
Components: Web
Affects Versions: 7.0.2.Final
Environment: Ubuntu 10.04, RHEL 5.7
Reporter: Knut-Olav Hoven
Assignee: Remy Maucherat
When redeploying an application over NXIO, the standalone.xml configuration is updated and saved by JBoss AS, and the (undocumented) attribute "pattern" of "access-log" element is removed.
Reproducable:
While JBossAS is not running, I update configuration/standalone.xml with the following subsystem configuration:
{code}
<subsystem xmlns="urn:jboss:domain:web:1.0" default-virtual-server="default-host">
<connector name="http" protocol="HTTP/1.1" socket-binding="http" scheme="http" enable-lookups="false" secure="false" max-connections="250" redirect-port="8443"/>
<virtual-server name="default-host" enable-welcome-root="true">
<alias name="localhost"/>
<access-log pattern='%h %l %u %t "%r" %s %b %D'/>
</virtual-server>
</subsystem>
{code}
The pattern value format is defined by Apache Tomcat: http://tomcat.apache.org/tomcat-6.0-doc/config/valve.html#Access_Log_Valve
Then, I startup JBoss AS, and the access logs are written to disk using my defined pattern.
I can restart JBoss AS, and it's still writing access logs in this pattern.
However, if I redeploy the application, the configuration file is overwritten by JBoss AS and then contains this in the subsystem. Notice the lack of the pattern attribute:
{code}
<subsystem xmlns="urn:jboss:domain:web:1.0" default-virtual-server="default-host">
<connector name="http" protocol="HTTP/1.1" socket-binding="http" scheme="http" enable-lookups="false" secure="false" max-connections="250" redirect-port="8443"/>
<virtual-server name="default-host" enable-welcome-root="true">
<alias name="localhost"/>
<access-log/>
</virtual-server>
</subsystem>
{code}
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
14 years, 7 months
[JBoss JIRA] Created: (JBRULES-3065) Facts currently have to be Java Beans, but Mark has used POJOS, except the attached example does not work.
by Jim Tyrrell (JIRA)
Facts currently have to be Java Beans, but Mark has used POJOS, except the attached example does not work.
----------------------------------------------------------------------------------------------------------
Key: JBRULES-3065
URL: https://issues.jboss.org/browse/JBRULES-3065
Project: Drools
Issue Type: Feature Request
Security Level: Public (Everyone can see)
Reporter: Jim Tyrrell
Assignee: Mark Proctor
Attachments: Screen shot 2011-06-06 at 2.02.00 PM.png, Screen shot 2011-06-06 at 2.02.14 PM.png, Screen shot 2011-06-06 at 2.02.37 PM.png, SimpleSpreadSheetBasedPOJO.java, SimpleSpreadSheetBasedTest.drl, SimpleSpreadSheetBasedTest.java
When modeling spreadsheets for form/spreadsheet validation, see the attached screen shots, all of the tools use the convention of A, B, C for the column names (Open Office, Excel, and Numbers). When trying to create an object with variable names of A, B, etc, I get errors in the JBDS as the below:
Description Resource Path Location Type
BuildError: Unable to create Field Extractor for 'A' of '[ClassObjectType class=com.sample.SimpleSpreadSheetBasedPOJO]' in rule 'Validation 1' SimpleSpreadSheetBasedTest.drl /BugProject/src/main/rules line 16 Drools Error
No amount of massaging can get this error to go away.
When I run the attached classes, I get the following error message:
Unable to create Field Extractor for 'A' of '[ClassObjectType class=com.sample.SimpleSpreadSheetBasedPOJO]' in rule 'Validation 1' : [Rule name='Validation 1']
java.lang.IllegalArgumentException: Could not parse knowledge.
at com.sample.SimpleSpreadSheetBasedTest.readKnowledgeBase(SimpleSpreadSheetBasedTest.java:48)
at com.sample.SimpleSpreadSheetBasedTest.main(SimpleSpreadSheetBasedTest.java:23)
Even though a getter and setter method is available.
So I created an ID field, this seems to work fine, but if I create a field A1, this does not, if I create ID1, this seems to work...so something is amiss in the way in which fields, methods, etc are marshaled.
If a Java Bean is required that is fine, but then we need to retreat from marketing POJOs as facts, and also possibly create a better error message that tells us to use Java Beans and not POJOs.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
14 years, 7 months
[JBoss JIRA] Created: (JBRULES-2989) Slotted/named syntax for bindings silently accepted as positional argument
by Wolfgang Laun (JIRA)
Slotted/named syntax for bindings silently accepted as positional argument
--------------------------------------------------------------------------
Key: JBRULES-2989
URL: https://issues.jboss.org/browse/JBRULES-2989
Project: Drools
Issue Type: Bug
Security Level: Public (Everyone can see)
Components: drools-compiler (expert)
Affects Versions: 5.2.0.CR1
Reporter: Wolfgang Laun
Assignee: Mark Proctor
declare Article
artid : int;
artname : String;
custid : int;
end
rule "articles of a customer"
when
$a: Article( $artid: artid, $artname: artname, $custid : custid ; ) ### semicolon here! ###
then
System.out.println( "Art " + $artid + " " + $a.getArtname() + " by " + $custid );
end
This is accepeted by the compiler without error indication, but preceding a semicolon only positional argument should be permitted.
Expect: an error message, compilation failure.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
14 years, 7 months
[JBoss JIRA] Created: (JBRULES-2956) Runtime error when using non-boolean expression as a constraint
by Wolfgang Laun (JIRA)
Runtime error when using non-boolean expression as a constraint
---------------------------------------------------------------
Key: JBRULES-2956
URL: https://issues.jboss.org/browse/JBRULES-2956
Project: Drools
Issue Type: Bug
Security Level: Public (Everyone can see)
Components: drools-compiler
Affects Versions: 5.2.0.M2
Reporter: Wolfgang Laun
Assignee: Mark Proctor
declare Num
num : Integer
even : boolean
end
rule start
when
then
insert( new Num( 42, true ) );
end
rule sumem
when
$n: Num( num, num + 1, eval(num + 1) )
then
end
All of these constraints result in a RUNTIME error ar java.lang.ClassCastException: java.lang.Integer cannot be cast to java.lang.Boolean org.drools.base.mvel.MVELPredicateExpression.evaluate(MVELPredicateExpression.java:97)
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
14 years, 7 months
[JBoss JIRA] Created: (JBRULES-3139) NPE in KnowledgeAgentImpl due to missing change set
by Wolfgang Laun (JIRA)
NPE in KnowledgeAgentImpl due to missing change set
---------------------------------------------------
Key: JBRULES-3139
URL: https://issues.jboss.org/browse/JBRULES-3139
Project: Drools
Issue Type: Bug
Security Level: Public (Everyone can see)
Components: drools-core (expert)
Reporter: Wolfgang Laun
Assignee: Mark Proctor
A missing Change Set causes a NPE in KnowledgeAgentImpl.
import java.net.URL;
import org.drools.*;
import org.drools.agent.*;
import org.drools.conf.*;
import org.drools.builder.*;
import org.drools.io.*;
public void setup() throws Exception {
KnowledgeBaseConfiguration kBaseConfig =
KnowledgeBaseFactory.newKnowledgeBaseConfiguration();
kBaseConfig.setOption(EventProcessingOption.STREAM);
// kBaseConfig.setOption( cehOption );
ResourceChangeScannerConfiguration rcsConf =
ResourceFactory.getResourceChangeScannerService()
.newResourceChangeScannerConfiguration();
rcsConf.setProperty("drools.resource.scanner.interval", "20");
ResourceFactory.getResourceChangeScannerService().configure( rcsConf );
KnowledgeAgentConfiguration kaConf =
KnowledgeAgentFactory.newKnowledgeAgentConfiguration();
kaConf.setProperty("drools.agent.scanDirectories", "true");
kaConf.setProperty("drools.agent.scanResources", "true");
kaConf.setProperty("drools.agent.newInstance", "false");
KnowledgeBase kBase =
KnowledgeBaseFactory.newKnowledgeBase(kBaseConfig);
KnowledgeAgent kAgent =
KnowledgeAgentFactory.newKnowledgeAgent( "drools agent", kBase, kaConf);
String urlString = "file://tmp/MissingChangeSet.xml";
try {
URL url = new URL(urlString);
Resource urlResource = ResourceFactory.newUrlResource(url);
if( urlResource != null ){
System.out.println( "Resource " + urlResource );
}
kAgent.applyChangeSet( urlResource );
} catch (Exception e) {
System.out.println("Caught exception: " + e.getMessage());
e.printStackTrace();
}
}
Caught exception: null
java.lang.NullPointerException
at org.drools.agent.impl.KnowledgeAgentImpl.processChangeSet(KnowledgeAgentImpl.java:223)
at org.drools.agent.impl.KnowledgeAgentImpl.applyChangeSet(KnowledgeAgentImpl.java:189)
at org.drools.agent.impl.KnowledgeAgentImpl.applyChangeSet(KnowledgeAgentImpl.java:174)
at hashcode.Main.setup(Main.java:75)
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
14 years, 7 months
[JBoss JIRA] Created: (JBRULES-2801) Entry-point defaults for type, rule, package
by Wolfgang Laun (JIRA)
Entry-point defaults for type, rule, package
--------------------------------------------
Key: JBRULES-2801
URL: https://jira.jboss.org/browse/JBRULES-2801
Project: Drools
Issue Type: Feature Request
Security Level: Public (Everyone can see)
Reporter: Wolfgang Laun
Assignee: Mark Proctor
Implement the definition of the default entry point for an Event or Fact type via a metadata attribute, e.g.:
declare X
@role( event )
@entry-point( y )
end
so that this
a) declares the entry-point in the KnowledgeBase (the same way from entry-point "x" does)
b) removes the need to use from entry-point with all patterns referring to X
c) would still let me override the entry point with a "from entry-point" clause.
The same attribute can be used inside a rule, where it is associated with all fact patterns without an explicit entry point. Here it also overrides an entry-point declared with the type's declare, if any.
Since all rule attributes may also be used at package level (outside rules), this includes the new entry-point attribute. It will then be honoured in rules according to the current strategy for all other rule attributes.
--
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
14 years, 7 months
[JBoss JIRA] Created: (JBRULES-3001) Free form expression constraints: unexpected execution result; unexpected failure to compile
by Wolfgang Laun (JIRA)
Free form expression constraints: unexpected execution result; unexpected failure to compile
---------------------------------------------------------------------------------------------
Key: JBRULES-3001
URL: https://issues.jboss.org/browse/JBRULES-3001
Project: Drools
Issue Type: Bug
Security Level: Public (Everyone can see)
Components: drools-compiler (expert)
Affects Versions: 5.2.0.CR1
Reporter: Wolfgang Laun
Assignee: Mark Proctor
Given
public class Customer {
int custid;
//...
}
The following rule always fires, for any value of custid.
rule "articles of a customer"
when
$c: Customer( 150 <= custid <= 250 ) returns true
then
System.out.println( "Customer1 " + $c.getCustid() );
end
But the constraint
$c: Customer( 100 <= custid )
is refused by the compiler:
Unable to build constraint as '100' is invalid : [Rule name='articles of a customer']
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
14 years, 7 months
[JBoss JIRA] Created: (JBRULES-2986) Confusing error reporting due to incomplete constraint
by Wolfgang Laun (JIRA)
Confusing error reporting due to incomplete constraint
------------------------------------------------------
Key: JBRULES-2986
URL: https://issues.jboss.org/browse/JBRULES-2986
Project: Drools
Issue Type: Bug
Security Level: Public (Everyone can see)
Components: drools-compiler (expert)
Affects Versions: 5.2.0.CR1
Reporter: Wolfgang Laun
Assignee: Mark Proctor
declare Article
artid : int;
artname : String;
custid : int;
end
declare Customer
custid : int
end
rule "articles of a customer"
when
$c: Customer( $custid: custid )
$a: Article( $artid, artname == ("mou" + "se"), $custid : custid == $custid )
then
end
Produces many error messages (see below), where line number 1 and column numnber 1 are incorrect.
Expect: only one error message, with correct line number.
====================================================================
Unable to Analyse Expression $artid:
[Error: Failed to compile: 2 compilation error(s):
- (1,1) unable to resolve method using strict-mode: ex50.Article.$artid()
- (1,1) unqualified type in strict mode for: $artid]
[Near : {... $artid ....}]
^
[Line: 1, Column: 1] : [Rule name='articles of a customer']
Rule Compilation error : [Rule name='articles of a customer']
ex50/Rule_articles_of_a_customer_0.java (14:690) : $artid cannot be resolved
====================================================================
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
14 years, 7 months