[JBoss JIRA] Created: (JBRULES-2995) Field "class" not recognized in some constructs
by Wolfgang Laun (JIRA)
Field "class" not recognized in some constructs
-----------------------------------------------
Key: JBRULES-2995
URL: https://issues.jboss.org/browse/JBRULES-2995
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 this simple type:
declare Foo
clazz : Class
end
and this rule:
rule yyy
when
$f: Foo( $cl: clazz == ( java.lang.String.class ) )
### $f: Foo( $cl: clazz, eval( $f.getClazz().equals( java.lang.String.class ) ) )
### $f: Foo( $cl: clazz == java.lang.String.class )
then
System.out.println( "--- got a " + $cl );
end
Only the first vyariant is accepted by the DRL parser. Other forms are
rebuked with, e.g.:
Unable to Analyse Expression $f.getClazz().equals( java.lang.String.class ) :
[Error: Failed to compile: 2 compilation error(s):
- (1,24) unable to resolve method using strict-mode: ex10.Foo.java()
- (1,24) unqualified type in strict mode for: java]
[Near : {... $f.getClazz().equals( java.lang.String.class ) ....}]
^
[Line: 1, Column: 24] : [Rule name='yyy']
Note the incorrect line number!
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
13 years
[JBoss JIRA] Created: (JBRULES-3123) .rf file raises a null pointer exception when it is loaded
by Quentin Caillard (JIRA)
.rf file raises a null pointer exception when it is loaded
----------------------------------------------------------
Key: JBRULES-3123
URL: https://issues.jboss.org/browse/JBRULES-3123
Project: Drools
Issue Type: Bug
Security Level: Public (Everyone can see)
Affects Versions: 5.2.0.Final
Reporter: Quentin Caillard
Assignee: Mark Proctor
I have just switched from version 5.1.1 to 5.2.0.Final
I have a ruleflow (.rf) file which can be loaded. I have the following stack trace :
java.lang.NullPointerException
at org.drools.compiler.PackageBuilder.addProcessFromXml(PackageBuilder.java:516)
at org.drools.compiler.PackageBuilder.addKnowledgeResource(PackageBuilder.java:556)
at org.drools.builder.impl.KnowledgeBuilderImpl.add(KnowledgeBuilderImpl.java:28)
at com.ariadnext.NewDroolsTest$RulesUtils.loadRules(NewDroolsTest.java:106)
I made a simple junit test which reproduces the bug.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
13 years
[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
13 years
[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
13 years
[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
13 years
[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
13 years
[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
13 years