[JBoss JIRA] Created: (JBRULES-1591) Newline in eval expression causes NullPointerException
by Brian Stiles (JIRA)
Newline in eval expression causes NullPointerException
------------------------------------------------------
Key: JBRULES-1591
URL: http://jira.jboss.com/jira/browse/JBRULES-1591
Project: JBoss Drools
Issue Type: Bug
Security Level: Public (Everyone can see)
Affects Versions: 4.0.7
Reporter: Brian Stiles
Assigned To: Mark Proctor
If a newline splits an eval expression, an NPE is thrown at org.drools.rule.PredicateConstraint.createContextEntry(PredicateConstraint.java:201).
The following code demonstrates the problem. Removing the newline from the eval expression solves the problem.
--
package sample;
import java.io.StringReader;
import org.drools.RuleBase;
import org.drools.RuleBaseConfiguration;
import org.drools.RuleBaseFactory;
import org.drools.StatefulSession;
import org.drools.compiler.PackageBuilder;
import org.drools.compiler.PackageBuilderConfiguration;
public class ExpressionProblem {
public static class Tester {
public boolean test(Object o1, Object o2) {
return o1.equals(o2);
}
}
public static void main(String[] args) throws Exception {
final PackageBuilderConfiguration packageBuilderConfiguration =
new PackageBuilderConfiguration();
final PackageBuilder packageBuilder = new PackageBuilder(packageBuilderConfiguration);
packageBuilder.addPackageFromDrl(new StringReader("\n"
+ "package sample\n"
+ "\n"
+ "import sample.ExpressionProblem.Tester;\n"
+ "global sample.ExpressionProblem.Tester tester;\n"
+ "\n"
+ "rule MyRule\n"
+ "\n"
+ " when\n"
+ " Integer($f : this, eval(tester.test($f,\n" // OFFENDING NEWLINE
+ " $f)))\n"
+ " then \n"
+ " System.out.println($f);\n"
+ "end \n"
+ ""));
final RuleBaseConfiguration ruleBaseConfiguration = new RuleBaseConfiguration();
final RuleBase ruleBase = RuleBaseFactory.newRuleBase(ruleBaseConfiguration);
ruleBase.addPackage(packageBuilder.getPackage());
final StatefulSession session = ruleBase.newStatefulSession(false);
session.setGlobal("tester", new Tester());
session.insert(1);
session.fireAllRules();
}
}
--
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
15 years, 10 months
[JBoss JIRA] Created: (JBRULES-1747) Null pointer exception from AbstractRuleBase.addPackage when loading rules scoped with parens
by Joe Re (JIRA)
Null pointer exception from AbstractRuleBase.addPackage when loading rules scoped with parens
---------------------------------------------------------------------------------------------
Key: JBRULES-1747
URL: https://jira.jboss.org/jira/browse/JBRULES-1747
Project: JBoss Drools
Issue Type: Bug
Security Level: Public (Everyone can see)
Components: Drl Parser/Builder, Reteoo
Affects Versions: 5.0.0.M2, FUTURE
Environment: Windows XP, 1.5.0_12, drools trunk rev 21627
Reporter: Joe Re
Assignee: Mark Proctor
The drl below produces a null pointer exception when calling ruleBase.addPackage(Drl). If the extra parens after the "||" are removed the exception doesn't occur. The rule compiles and runs successfully in 5.0M1.
/***********EXCEPTION****************************/
java.lang.NullPointerException
at org.drools.common.AbstractRuleBase.addPackage(AbstractRuleBase.java:418)
at org.drools.reteoo.ReteooRuleBase.addPackage(ReteooRuleBase.java:380)
at com.sample.DroolsTest.readRule(DroolsTest.java:75)
at com.sample.DroolsTest.main(DroolsTest.java:26)
/*************************************************/
/*********TEST DRL****************************/
package test;
import com.sample.TestInput;
rule "TestRule"
when
TestInput( valOne ==true ||(valOne==false && doubVal ==0) )
then
end
/*************************************************/
/***********************TEST INPUT JAVA***********************/
package com.sample;
public class TestInput {
public boolean valOne;
public boolean valTwo;
public double doubVal;
public boolean getValOne() {
return valOne;
}
public void setValOne(boolean valOne) {
this.valOne = valOne;
}
public boolean getValTwo() {
return valTwo;
}
public void setValTwo(boolean valTwo) {
this.valTwo = valTwo;
}
public double getDoubVal() {
return doubVal;
}
public void setDoubVal(double doubVal) {
this.doubVal = doubVal;
}
}
--
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
15 years, 10 months
[JBoss JIRA] Created: (JBAS-5182) Retire EJB3 JaccHelper
by Anil Saldhana (JIRA)
Retire EJB3 JaccHelper
----------------------
Key: JBAS-5182
URL: http://jira.jboss.com/jira/browse/JBAS-5182
Project: JBoss Application Server
Issue Type: Task
Security Level: Public (Everyone can see)
Components: EJB3, Security
Affects Versions: JBossAS-5.0.0.Beta3
Reporter: Anil Saldhana
Assigned To: Anil Saldhana
Priority: Critical
Fix For: JBossAS-5.0.0.CR1
The entire EJB3 Jacc Layer needs to go. The Permissions creation will be done via a separate deployer working on the Metadata. The Policy enforcement will be done by the security layer. We have already consolidated the enforcement for web and ejb2 layers.
--
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
15 years, 10 months
[JBoss JIRA] Created: (JBAS-6219) ManagementView.getTemplate() should return a new copy of the DeploymentTemplateInfo on every call
by Ian Springer (JIRA)
ManagementView.getTemplate() should return a new copy of the DeploymentTemplateInfo on every call
-------------------------------------------------------------------------------------------------
Key: JBAS-6219
URL: https://jira.jboss.org/jira/browse/JBAS-6219
Project: JBoss Application Server
Issue Type: Sub-task
Security Level: Public (Everyone can see)
Components: ProfileService
Reporter: Ian Springer
Assignee: Scott M Stark
In our create-resource code, we do the following:
DeploymentTemplateInfo template = managementView.getTemplate(templateName);
Map<String, ManagedProperty> managedProperties = template.getProperties();
// Update managedProperties according to the properties the user entered in the EmbJopr UI.
managementView.applyTemplate(ManagedDeployment.DeploymentPhase.APPLICATION, resourceName, template);
managementView.process();
This all works fine the first time through. The problem is the next time we execute the above code using the same templateName, getTemplate(() returns the same DeploymentTemplateInfo from the previous call (with the updates we made to its managedProperties). Instead, it should return a new "fresh" DeploymentTemplateInfo object that contains only the properties from the original template.
--
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
15 years, 10 months