[JBoss JIRA] Created: (JBRULES-695) Cannot reference a global in a query.
by Jack Curtin (JIRA)
Cannot reference a global in a query.
-------------------------------------
Key: JBRULES-695
URL: http://jira.jboss.com/jira/browse/JBRULES-695
Project: JBoss Rules
Issue Type: Bug
Security Level: Public (Everyone can see)
Affects Versions: 3.0.5, 3.0.4
Environment: Windows XP using JBoss Eclipse IDE with drools plugin.
Reporter: Jack Curtin
Assigned To: Mark Proctor
I have a query that references a global, and I get the following error during startup:
org.drools.rule.InvalidRulePackage: Unable to return Declaration for identifier 'gbl_deletecardnumber'
Relevant code from rule file follows:
import java.lang.String;
import com.m2syscorp.i24card.rulesengine.facts.CardHolder;
global String gbl_deletecardnumber
query "delete cardholder"
cardholderobj : CardHolder (cardnum == gbl_deletecardnumber)
end;
Relevant Java code follows:
public class CardHolder implements Serializable {
private String cardnum;
public String getCardnum() {
return cardnum;
}
public void setCardnum(String cardnum) {
this.cardnum = cardnum;
}
}
public void deleteCardHolderFromWorkingMemory(WorkingMemory workingMemory, String sDeleteCardNumber) {
workingMemory.setGlobal("gbl_deletecardnumber", sDeleteCardNumber);
QueryResults results = workingMemory.getQueryResults("delete cardholder");
for (Iterator it = results.iterator(); it.hasNext(); ) {
QueryResult result = (QueryResult) it.next();
CardHolder chDelObj = (CardHolder) result.get("cardholderobj");
FactHandle fhCardHolder = workingMemory.getFactHandle(chDelObj);
workingMemory.retractObject(fhCardHolder);
break; // should only be one matching CardHolder object.
}
}
As you can see from the Java code, my goal is to be able to set the global variable gbl_deletecardnumber with a card number string, call the query which will find the CardHolder object with the matching card number, and then retract that object.
--
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
19 years, 4 months
[JBoss JIRA] Created: (JBAS-4158) JACC:WebUserDataPermission creation for unchecked policy should consider excluded constraints
by Anil Saldhana (JIRA)
JACC:WebUserDataPermission creation for unchecked policy should consider excluded constraints
---------------------------------------------------------------------------------------------
Key: JBAS-4158
URL: http://jira.jboss.com/jira/browse/JBAS-4158
Project: JBoss Application Server
Issue Type: Bug
Security Level: Public (Everyone can see)
Components: Security
Affects Versions: JBossAS-4.0.5.GA
Reporter: Anil Saldhana
Assigned To: Anil Saldhana
Fix For: JBossAS-4.2.0.CR1
For the following bit:
<security-constraint>
<web-resource-collection>
<web-resource-name>SecureStuff</web-resource-name>
<url-pattern>/excluded.jsp</url-pattern>
<http-method>POST</http-method>
<http-method>GET</http-method>
</web-resource-collection>
<auth-constraint/>
<user-data-constraint>
<transport-guarantee>NONE</transport-guarantee>
</user-data-constraint>
</security-constraint>
There is no need for the generation of a WebUserDataPermission("/excluded.jsp",null)
--
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
19 years, 4 months
[JBoss JIRA] Created: (JBAS-4081) failing org.jboss.test.security.test.CustomSecurityManagerTestCase(custom-secmgr)
by Dimitris Andreadis (JIRA)
failing org.jboss.test.security.test.CustomSecurityManagerTestCase(custom-secmgr)
---------------------------------------------------------------------------------
Key: JBAS-4081
URL: http://jira.jboss.com/jira/browse/JBAS-4081
Project: JBoss Application Server
Issue Type: Sub-task
Security Level: Public (Everyone can see)
Components: Test Suite
Environment: Java Version 1.5.0_06
Java Vendor BEA Systems, Inc.
Java VM Name BEA JRockit(R)
Java VM Version R26.4.0-63-63688-1.5.0_06-20060626-2259-linux-ia32
Java VM Info
OS Name Linux
OS Version 2.6.9-42.0.2.ELsmp
OS Arch i386
Reporter: Dimitris Andreadis
Fix For: JBossAS-4.2.0.CR1
testGetCallerPrincipal Failure Was able to call StatelessSession.echo
junit.framework.AssertionFailedError: Was able to call StatelessSession.echo
at org.jboss.test.security.test.EJBSpecUnitTestCase.testGetCallerPrincipal(EJBSpecUnitTestCase.java:194)
at jrockit.reflect.VirtualNativeMethodInvoker.invoke(Ljava.lang.Object;[Ljava.lang.Object;)Ljava.lang.Object;(Unknown Source)
at junit.extensions.TestDecorator.basicRun(TestDecorator.java:22)
at junit.extensions.TestSetup$1.protect(TestSetup.java:19)
at junit.extensions.TestSetup.run(TestSetup.java:23)
--
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
19 years, 4 months
[JBoss JIRA] Created: (JBCACHE-938) OptimisticNodeInterceptor may NPE if node cannot be created
by Elias Ross (JIRA)
OptimisticNodeInterceptor may NPE if node cannot be created
-----------------------------------------------------------
Key: JBCACHE-938
URL: http://jira.jboss.com/jira/browse/JBCACHE-938
Project: JBoss Cache
Issue Type: Bug
Security Level: Public (Everyone can see)
Reporter: Elias Ross
Assigned To: Manik Surtani
...
else
{
// "fail-more-silently" patch thanks to Owen Taylor - JBCACHE-767
if ((ctx.getOptionOverrides() == null || !ctx.getOptionOverrides().isFailSilently()) && MethodDeclarations.isPutMethod(m.getMethodId()))
{
throw new CacheException("Unable to set node version for " + getFqn(args) + ", node is null.");
}
/* [1] */
}
switch (m.getMethodId())
{
case MethodDeclarations.putDataMethodLocal_id:
Boolean erase = (Boolean) args[3];
cache.getNotifier().notifyNodeModified(fqn, true, CacheListener.ModificationType.PUT_MAP, workspaceNode == null ? null : workspaceNode.getData() , false);
putDataMap((Map<Object, Object>) args[2], erase, workspace, workspaceNode);
cache.getNotifier().notifyNodeModified(fqn, false, CacheListener.ModificationType.PUT_MAP, workspaceNode.getData(), false);
// ^^^ NPE on workspaceNode.getData()
break;
...
If the node fails to be created or located, the "workspaceNode" variable may be null.
The first "? :" check checks for a null condition.
The second does not.
I don't believe notification should take place if there is no workspaceNode to modify.
The solution might be to have notifyNodeModified() take a Node and not a Map. Then, this method code check for the null case.
Though, I think in general, it's bad to have the code try and handle this edge case, as most maintainers might not expect workspaceNode to be null during the manipulation steps. Perhaps an ELSE statement could be put in [1] to abort this method gracefully?
--
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
19 years, 4 months