[JBoss JIRA] (WFLY-4390) restartable=false bach job can be restarted
by Cheng Fang (JIRA)
[ https://issues.jboss.org/browse/WFLY-4390?page=com.atlassian.jira.plugin.... ]
Cheng Fang commented on WFLY-4390:
----------------------------------
Updated WildFly batch sample app to verify restartable attribute, especially restart a previously failed job execution after a WildFly restart, to make sure the decision to disallow restart in the old job execution is persisted and subsequently retrieved and honored by the restart operation.
https://github.com/chengfang/wildfly-samples/tree/master/jberet/deseriali...
> restartable=false bach job can be restarted
> -------------------------------------------
>
> Key: WFLY-4390
> URL: https://issues.jboss.org/browse/WFLY-4390
> Project: WildFly
> Issue Type: Bug
> Components: Batch
> Affects Versions: 8.2.0.Final
> Reporter: Takashi Nishigaya
> Assignee: Cheng Fang
> Attachments: batch-restartable.zip
>
>
> The batch job defined with restartable=false must not be restartable, after failed or stopped.
> GlassFish 4.1 results in the following:
> [2015-02-26T19:56:34.860+0900] [glassfish 4.1] [SEVERE] [] [] [tid: _ThreadID=25 _ThreadName=Thread-9] [timeMillis: 1424948194860] [levelValue: 1000] [[
> javax.batch.operations.JobRestartException: javax.batch.operations.JobRestartException: Job Restartable attribute is false, Job cannot be restarted.
> But WildFly tries to execute the stopped or failed job.
> Please check the attached test case.
> wildfly:
> $ mvn clean test -P wildfly-managed (or -P wildly-remote)
> glassfish:
> $ glassfish4/bin/asadmin start-domain
> $ mvn clean test -P glassfish-remote
--
This message was sent by Atlassian JIRA
(v6.3.11#6341)
10 years, 7 months
[JBoss JIRA] (WFLY-4390) restartable=false bach job can be restarted
by Cheng Fang (JIRA)
[ https://issues.jboss.org/browse/WFLY-4390?page=com.atlassian.jira.plugin.... ]
Cheng Fang commented on WFLY-4390:
----------------------------------
Fixed in project JBeret:
https://github.com/jberet/jsr352/commit/eed55070a42bbd15240e14b638fb12ea8...
Also tested with attached batch-restartable.zip test against WildFly 9 snapshot.
> restartable=false bach job can be restarted
> -------------------------------------------
>
> Key: WFLY-4390
> URL: https://issues.jboss.org/browse/WFLY-4390
> Project: WildFly
> Issue Type: Bug
> Components: Batch
> Affects Versions: 8.2.0.Final
> Reporter: Takashi Nishigaya
> Assignee: Cheng Fang
> Attachments: batch-restartable.zip
>
>
> The batch job defined with restartable=false must not be restartable, after failed or stopped.
> GlassFish 4.1 results in the following:
> [2015-02-26T19:56:34.860+0900] [glassfish 4.1] [SEVERE] [] [] [tid: _ThreadID=25 _ThreadName=Thread-9] [timeMillis: 1424948194860] [levelValue: 1000] [[
> javax.batch.operations.JobRestartException: javax.batch.operations.JobRestartException: Job Restartable attribute is false, Job cannot be restarted.
> But WildFly tries to execute the stopped or failed job.
> Please check the attached test case.
> wildfly:
> $ mvn clean test -P wildfly-managed (or -P wildly-remote)
> glassfish:
> $ glassfish4/bin/asadmin start-domain
> $ mvn clean test -P glassfish-remote
--
This message was sent by Atlassian JIRA
(v6.3.11#6341)
10 years, 7 months
[JBoss JIRA] (JGRP-1918) ConcurrentModificationException in Locking notification
by Bela Ban (JIRA)
[ https://issues.jboss.org/browse/JGRP-1918?page=com.atlassian.jira.plugin.... ]
Bela Ban updated JGRP-1918:
---------------------------
Fix Version/s: 3.6.3
> ConcurrentModificationException in Locking notification
> -------------------------------------------------------
>
> Key: JGRP-1918
> URL: https://issues.jboss.org/browse/JGRP-1918
> Project: JGroups
> Issue Type: Bug
> Affects Versions: 3.6.2
> Environment: JUnit text running in Eclipse on Windows
> Reporter: Paul Illingworth
> Assignee: Bela Ban
> Fix For: 3.6.3
>
>
> I have code which unregisters a lock listener whilst a lock notification event is being fired leading to
> java.util.ConcurrentModificationException
> at java.util.HashMap$HashIterator.nextEntry(HashMap.java:926)
> at java.util.HashMap$KeyIterator.next(HashMap.java:960)
> at org.jgroups.protocols.Locking.notifyUnlocked(Locking.java:581)
> at org.jgroups.protocols.Locking$ServerLock.setOwner(Locking.java:767)
> at org.jgroups.protocols.Locking$ServerLock.handleRequest(Locking.java:655)
> at org.jgroups.protocols.Locking.handleLockRequest(Locking.java:393)
> at org.jgroups.protocols.Locking.up(Locking.java:226)
> at org.jgroups.stack.Protocol.up(Protocol.java:412)
> at org.jgroups.protocols.FORK.up(FORK.java:139)
> at org.jgroups.protocols.FRAG2.up(FRAG2.java:182)
> at org.jgroups.protocols.FlowControl.up(FlowControl.java:447)
> at org.jgroups.protocols.FlowControl.up(FlowControl.java:447)
> at org.jgroups.stack.Protocol.up(Protocol.java:420)
> at org.jgroups.protocols.pbcast.STABLE.up(STABLE.java:294)
> at org.jgroups.protocols.UNICAST3.deliverBatch(UNICAST3.java:1087)
> at org.jgroups.protocols.UNICAST3.removeAndDeliver(UNICAST3.java:886)
> at org.jgroups.protocols.UNICAST3.handleDataReceivedFromSelf(UNICAST3.java:821)
> at org.jgroups.protocols.UNICAST3.up(UNICAST3.java:424)
> at org.jgroups.protocols.pbcast.NAKACK2.up(NAKACK2.java:652)
> at org.jgroups.protocols.VERIFY_SUSPECT.up(VERIFY_SUSPECT.java:155)
> at org.jgroups.protocols.FD.up(FD.java:253)
> at org.jgroups.protocols.FD_SOCK.up(FD_SOCK.java:297)
> at org.jgroups.protocols.MERGE3.up(MERGE3.java:288)
> at org.jgroups.protocols.Discovery.up(Discovery.java:291)
> at org.jgroups.protocols.TP$ProtocolAdapter.up(TP.java:2842)
> at org.jgroups.protocols.TP.passMessageUp(TP.java:1577)
> at org.jgroups.protocols.TP$3.run(TP.java:1511)
> at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
> at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
> at java.lang.Thread.run(Thread.java:724)
> The org.jgroups.protocols.Locking#lock_listeners is simple a HashSet which gets iterated over, This needs to be synchronised is some way.
--
This message was sent by Atlassian JIRA
(v6.3.11#6341)
10 years, 7 months
[JBoss JIRA] (WFLY-4384) ContextService (JSR236): transactional context always suspended
by Eduardo Martins (JIRA)
[ https://issues.jboss.org/browse/WFLY-4384?page=com.atlassian.jira.plugin.... ]
Eduardo Martins edited comment on WFLY-4384 at 2/28/15 2:16 AM:
----------------------------------------------------------------
The "execution" property is related to the thread invoking/executing the contextual object, which may not be the thread creating that object. In your example code the executing thread is a ManagedExecutorService internal thread, which has no transaction.
You can see an example of its usage at [http://docs.oracle.com/javaee/7/api/javax/enterprise/concurrent/ContextSe...]
was (Author: emmartins):
The "execution" property is related to the thread invoking/executing the contextual object, which may not be the thread creating that object. In your example code the executing thread is a ManagedExecutorService internal thread, which has no transaction.
You can see an example of its usage at http://docs.oracle.com/javaee/7/api/javax/enterprise/concurrent/ContextSe...
> ContextService (JSR236): transactional context always suspended
> ---------------------------------------------------------------
>
> Key: WFLY-4384
> URL: https://issues.jboss.org/browse/WFLY-4384
> Project: WildFly
> Issue Type: Bug
> Components: EE
> Affects Versions: 8.2.0.Final, 9.0.0.Alpha1
> Reporter: Maxim Frolov
> Assignee: Eduardo Martins
> Priority: Critical
>
> According to §3.3.5 of JSR-236 specification:
> ??By using an execution property when creating the contextual proxy object, application components can choose to not suspend the transactional context on the thread ...??
> Given the following EJB and Task:
> {code:java}
> @WebService(serviceName = "Jsr236WebService")
> @Stateless
> public class Jsr236WebService {
> @Inject Jsr236ManagedTask jsr236ManagedTask;
> @Resource ManagedExecutorService executor;
> @Resource ContextService contextService;
>
> @WebMethod(operationName = "hello")
> public String hello(@WebParam(name = "name") String txt) {
> Map<String, String> execProps = new HashMap<>();
> execProps.put(ManagedTask.TRANSACTION, ManagedTask.USE_TRANSACTION_OF_EXECUTION_THREAD);
> Future<String> future = executor.submit(
> contextService.createContextualProxy(jsr236ManagedTask, execProps, Callable.class));
> try {
> return future.get();
> } catch (InterruptedException | ExecutionException e) {
> throw new RuntimeException(e);
> }
> }
> }
> {code}
> {code:java}
> @Dependent
> @Transactional(Transactional.TxType.MANDATORY)
> public class Jsr236ManagedTask implements Callable<String>, ManagedTask {
> @Override
> public String call() {
> return "called";
> }
> @Override
> public Map<String, String> getExecutionProperties() {
> Map<String, String> execProps = new HashMap<>();
> execProps.put(ManagedTask.TRANSACTION, ManagedTask.USE_TRANSACTION_OF_EXECUTION_THREAD);
> return execProps;
> }
> }
> {code}
> When the {{call()}} Method of the task is called the following exception occurs:
> {noformat}
> javax.transaction.TransactionalException: ARJUNA016110: Transaction is required for invocation
> {noformat}
> See maven test project [https://github.com/wrungel/bugs/tree/master/jsr236-test] on GitHub.
--
This message was sent by Atlassian JIRA
(v6.3.11#6341)
10 years, 7 months
[JBoss JIRA] (WFLY-4384) ContextService (JSR236): transactional context always suspended
by Eduardo Martins (JIRA)
[ https://issues.jboss.org/browse/WFLY-4384?page=com.atlassian.jira.plugin.... ]
Eduardo Martins commented on WFLY-4384:
---------------------------------------
The "execution" property is related to the thread invoking/executing the contextual object, which may not be the thread creating that object. In your example code the executing thread is a ManagedExecutorService internal thread, which has no transaction.
You can see an example of its usage at http://docs.oracle.com/javaee/7/api/javax/enterprise/concurrent/ContextSe...
> ContextService (JSR236): transactional context always suspended
> ---------------------------------------------------------------
>
> Key: WFLY-4384
> URL: https://issues.jboss.org/browse/WFLY-4384
> Project: WildFly
> Issue Type: Bug
> Components: EE
> Affects Versions: 8.2.0.Final, 9.0.0.Alpha1
> Reporter: Maxim Frolov
> Assignee: Eduardo Martins
> Priority: Critical
>
> According to §3.3.5 of JSR-236 specification:
> ??By using an execution property when creating the contextual proxy object, application components can choose to not suspend the transactional context on the thread ...??
> Given the following EJB and Task:
> {code:java}
> @WebService(serviceName = "Jsr236WebService")
> @Stateless
> public class Jsr236WebService {
> @Inject Jsr236ManagedTask jsr236ManagedTask;
> @Resource ManagedExecutorService executor;
> @Resource ContextService contextService;
>
> @WebMethod(operationName = "hello")
> public String hello(@WebParam(name = "name") String txt) {
> Map<String, String> execProps = new HashMap<>();
> execProps.put(ManagedTask.TRANSACTION, ManagedTask.USE_TRANSACTION_OF_EXECUTION_THREAD);
> Future<String> future = executor.submit(
> contextService.createContextualProxy(jsr236ManagedTask, execProps, Callable.class));
> try {
> return future.get();
> } catch (InterruptedException | ExecutionException e) {
> throw new RuntimeException(e);
> }
> }
> }
> {code}
> {code:java}
> @Dependent
> @Transactional(Transactional.TxType.MANDATORY)
> public class Jsr236ManagedTask implements Callable<String>, ManagedTask {
> @Override
> public String call() {
> return "called";
> }
> @Override
> public Map<String, String> getExecutionProperties() {
> Map<String, String> execProps = new HashMap<>();
> execProps.put(ManagedTask.TRANSACTION, ManagedTask.USE_TRANSACTION_OF_EXECUTION_THREAD);
> return execProps;
> }
> }
> {code}
> When the {{call()}} Method of the task is called the following exception occurs:
> {noformat}
> javax.transaction.TransactionalException: ARJUNA016110: Transaction is required for invocation
> {noformat}
> See maven test project [https://github.com/wrungel/bugs/tree/master/jsr236-test] on GitHub.
--
This message was sent by Atlassian JIRA
(v6.3.11#6341)
10 years, 7 months
[JBoss JIRA] (WFLY-4384) ContextService (JSR236): transactional context always suspended
by Maxim Frolov (JIRA)
[ https://issues.jboss.org/browse/WFLY-4384?page=com.atlassian.jira.plugin.... ]
Maxim Frolov updated WFLY-4384:
-------------------------------
Affects Version/s: 9.0.0.Alpha1
8.2.0.Final
> ContextService (JSR236): transactional context always suspended
> ---------------------------------------------------------------
>
> Key: WFLY-4384
> URL: https://issues.jboss.org/browse/WFLY-4384
> Project: WildFly
> Issue Type: Bug
> Components: EE
> Affects Versions: 8.2.0.Final, 9.0.0.Alpha1
> Reporter: Maxim Frolov
> Assignee: Eduardo Martins
> Priority: Critical
>
> According to §3.3.5 of JSR-236 specification:
> ??By using an execution property when creating the contextual proxy object, application components can choose to not suspend the transactional context on the thread ...??
> Given the following EJB and Task:
> {code:java}
> @WebService(serviceName = "Jsr236WebService")
> @Stateless
> public class Jsr236WebService {
> @Inject Jsr236ManagedTask jsr236ManagedTask;
> @Resource ManagedExecutorService executor;
> @Resource ContextService contextService;
>
> @WebMethod(operationName = "hello")
> public String hello(@WebParam(name = "name") String txt) {
> Map<String, String> execProps = new HashMap<>();
> execProps.put(ManagedTask.TRANSACTION, ManagedTask.USE_TRANSACTION_OF_EXECUTION_THREAD);
> Future<String> future = executor.submit(
> contextService.createContextualProxy(jsr236ManagedTask, execProps, Callable.class));
> try {
> return future.get();
> } catch (InterruptedException | ExecutionException e) {
> throw new RuntimeException(e);
> }
> }
> }
> {code}
> {code:java}
> @Dependent
> @Transactional(Transactional.TxType.MANDATORY)
> public class Jsr236ManagedTask implements Callable<String>, ManagedTask {
> @Override
> public String call() {
> return "called";
> }
> @Override
> public Map<String, String> getExecutionProperties() {
> Map<String, String> execProps = new HashMap<>();
> execProps.put(ManagedTask.TRANSACTION, ManagedTask.USE_TRANSACTION_OF_EXECUTION_THREAD);
> return execProps;
> }
> }
> {code}
> When the {{call()}} Method of the task is called the following exception occurs:
> {noformat}
> javax.transaction.TransactionalException: ARJUNA016110: Transaction is required for invocation
> {noformat}
> See maven test project [https://github.com/wrungel/bugs/tree/master/jsr236-test] on GitHub.
--
This message was sent by Atlassian JIRA
(v6.3.11#6341)
10 years, 7 months
[JBoss JIRA] (WFLY-4395) JDR collect free disk space
by Brad Maxwell (JIRA)
Brad Maxwell created WFLY-4395:
----------------------------------
Summary: JDR collect free disk space
Key: WFLY-4395
URL: https://issues.jboss.org/browse/WFLY-4395
Project: WildFly
Issue Type: Enhancement
Reporter: Brad Maxwell
Assignee: Brad Maxwell
JDR collect free disk space as server can throw errors when there is no free space.
--
This message was sent by Atlassian JIRA
(v6.3.11#6341)
10 years, 7 months
[JBoss JIRA] (DROOLS-731) In a catch22 using a NOT constraint in rules shared by multiple facts
by Bill Tuminaro (JIRA)
[ https://issues.jboss.org/browse/DROOLS-731?page=com.atlassian.jira.plugin... ]
Bill Tuminaro updated DROOLS-731:
---------------------------------
Description:
I have a reproducer for these related issues.
We have encountered a couple of issues (Exceptions) when using a NOT constraint in rules that have facts associated with them when we call upgradeToVersion() or kSession.delete(). The catch22 is that one version of the NOT constraint avoids one Exception while causing another. Reproducing the issue requires 2 rules sharing the same NOT constraint. I have narrowed the issue(s) down to 2 very simple rules that use the org.drools.compiler.FactA class.
Here are the 2 rules used:
static final String ruleDrl = "package org.some.test\n" +
"import org.drools.compiler.FactA\n" +
"declare FactA\n" +
"@role(event)" +
"end\n" +
"rule \"R200_0\" when\n" +
" $FactA : FactA ($FactA_field2 : field2 == 111002)\n" +
" not FactA($FactA_field2 == 111002, this after $FactA)\n" + // version A: using this version causes a NPE when calling ksession.delete()
// " not FactA(field2 == 111002, this after $FactA)\n" + // Version B: using this version causes the IllegalArgumentException: Cannot remove a sink,
// when the list of sinks is null on the updateToVersion() call
"then\n" +
"end\n";
static final String ruleDrl2 = "package org.some.test\n" +
"import org.drools.compiler.FactA\n" +
"declare FactA\n" +
"@role(event)" +
"end\n" +
"rule \"R1437_0\" when\n" +
" $FactA : FactA ($FactA_field2 : field2 == 105742)\n" +
" not FactA($FactA_field2 == 105742, this after $FactA)\n" + // version A:
// " not FactA(field2 == 105742, this after $FactA)\n" + // Version B:
"then\n" +
"end\n";
We are hitting the following NPE using the reproducer code attached when we use the NOT Constraint labeled as 'Version A' in the rule:
java.lang.NullPointerExceptionNullPointerException caught: 2
at org.drools.core.reteoo.NotNode.doDeleteRightTuple(NotNode.java:186)
at org.drools.core.reteoo.NotNode.retractRightTuple(NotNode.java:174)
at org.drools.core.reteoo.ObjectTypeNode.doRetractObject(ObjectTypeNode.java:345)
at org.drools.core.reteoo.ObjectTypeNode.retractObject(ObjectTypeNode.java:337)
at org.drools.core.reteoo.EntryPointNode.retractObject(EntryPointNode.java:379)
at org.drools.core.common.NamedEntryPoint.delete(NamedEntryPoint.java:612)
at org.drools.core.impl.StatefulKnowledgeSessionImpl.delete(StatefulKnowledgeSessionImpl.java:1467)
at org.drools.core.impl.StatefulKnowledgeSessionImpl.delete(StatefulKnowledgeSessionImpl.java:1458)
at org.drools.compiler.integrationTests.RemovingARuleCausesNPE.test(RemovingARuleCausesNPE.java:187)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:60)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
at java.lang.reflect.Method.invoke(Method.java:611)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
at org.junit.runners.BlockJUnit4ClassRunner.runNotIgnored(BlockJUnit4ClassRunner.java:79)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:71)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:49)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:49)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
We are hitting the following IllegalArgumentException using the reproducer code attached when we use the NOT Constraint labeled as 'Version B' in the rule:
java.lang.IllegalArgumentException: Cannot remove a sink, when the list of sinks is null
at org.drools.core.reteoo.ObjectSource.removeObjectSink(ObjectSource.java:203)
at org.drools.core.reteoo.ObjectSource.doRemove(ObjectSource.java:242)
at org.drools.core.common.BaseNode.remove(BaseNode.java:122)
at org.drools.core.reteoo.ReteooBuilder.removeNode(ReteooBuilder.java:236)
at org.drools.core.reteoo.ReteooBuilder.removeTerminalNode(ReteooBuilder.java:179)
at org.drools.core.reteoo.ReteooBuilder.removeRule(ReteooBuilder.java:153)
at org.drools.core.impl.KnowledgeBaseImpl.removeRule(KnowledgeBaseImpl.java:1535)
at org.drools.core.impl.KnowledgeBaseImpl.removeObjectsGeneratedFromResource(KnowledgeBaseImpl.java:1768)
at org.drools.compiler.builder.impl.KnowledgeBuilderImpl.removeObjectsGeneratedFromResource(KnowledgeBuilderImpl.java:2029)
at org.drools.compiler.kie.builder.impl.KieContainerImpl.update(KieContainerImpl.java:171)
at org.drools.compiler.kie.builder.impl.KieContainerImpl.updateToVersion(KieContainerImpl.java:104)
at org.drools.compiler.integrationTests.RemovingARuleCausesNPE.test(RemovingARuleCausesNPE.java:172)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:60)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
at java.lang.reflect.Method.invoke(Method.java:611)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
at org.junit.runners.BlockJUnit4ClassRunner.runNotIgnored(BlockJUnit4ClassRunner.java:79)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:71)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:49)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:49)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
was:
I have a reproducer for these related issues.
We have encountered a couple of issues (Exceptions) when using a NOT constraint in rules that have facts associated with them when we call upgradeToVersion() or kSession.delete(). The catch22 is that one version of the NOT constraint avoids one Exception while causing another. Reproducing the issue requires 2 rules sharing the same NOT constraint. I have narrowed the issue(s) down to 2 very simple rules that use the org.drools.compiler.FactA class.
Here are the 2 rules used:
static final String ruleDrl = "package org.some.test\n" +
"import org.drools.compiler.FactA\n" +
"declare FactA\n" +
"@role(event)" +
"end\n" +
"rule \"R200_0\" when\n" +
" $FactA : FactA ($FactA_field2 : field2 == 111002)\n" +
" not FactA($FactA_field2 == 111002, this after $FactA)\n" + // version A: using this version causes a NPE when calling ksession.delete()
// " not FactA(field2 == 111002, this after $FactA)\n" + // Version B: using this version causes the IllegalArgumentException: Cannot remove a sink,
// when the list of sinks is null on the updateToVersion() call
"then\n" +
"end\n";
static final String ruleDrl2 = "package org.some.test\n" +
"import org.drools.compiler.FactA\n" +
"declare FactA\n" +
"@role(event)" +
"end\n" +
"rule \"R1437_0\" when\n" +
" $FactA : FactA ($FactA_field2 : field2 == 105742)\n" +
" not FactA($FactA_field2 == 105742, this after $FactA)\n" + // version A:
// " not FactA(field2 == 105742, this after $FactA)\n" + // Version B:
"then\n" +
"end\n";
We are hitting the following NPE using the reproducer code attached when we use the NOT Constraint labeled as 'Version A' in the rule:
java.lang.NullPointerExceptionNullPointerException caught: 2
at org.drools.core.reteoo.NotNode.doDeleteRightTuple(NotNode.java:186)
at org.drools.core.reteoo.NotNode.retractRightTuple(NotNode.java:174)
at org.drools.core.reteoo.ObjectTypeNode.doRetractObject(ObjectTypeNode.java:345)
at org.drools.core.reteoo.ObjectTypeNode.retractObject(ObjectTypeNode.java:337)
at org.drools.core.reteoo.EntryPointNode.retractObject(EntryPointNode.java:379)
at org.drools.core.common.NamedEntryPoint.delete(NamedEntryPoint.java:612)
at org.drools.core.impl.StatefulKnowledgeSessionImpl.delete(StatefulKnowledgeSessionImpl.java:1467)
at org.drools.core.impl.StatefulKnowledgeSessionImpl.delete(StatefulKnowledgeSessionImpl.java:1458)
at org.drools.compiler.integrationTests.RemovingARuleCausesNPE.test(RemovingARuleCausesNPE.java:187)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:60)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
at java.lang.reflect.Method.invoke(Method.java:611)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
at org.junit.runners.BlockJUnit4ClassRunner.runNotIgnored(BlockJUnit4ClassRunner.java:79)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:71)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:49)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:49)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
We are hitting the following NPE using the reproducer code attached when we use the NOT Constraint labeled as 'Version A' in the rule:
java.lang.IllegalArgumentException: Cannot remove a sink, when the list of sinks is null
at org.drools.core.reteoo.ObjectSource.removeObjectSink(ObjectSource.java:203)
at org.drools.core.reteoo.ObjectSource.doRemove(ObjectSource.java:242)
at org.drools.core.common.BaseNode.remove(BaseNode.java:122)
at org.drools.core.reteoo.ReteooBuilder.removeNode(ReteooBuilder.java:236)
at org.drools.core.reteoo.ReteooBuilder.removeTerminalNode(ReteooBuilder.java:179)
at org.drools.core.reteoo.ReteooBuilder.removeRule(ReteooBuilder.java:153)
at org.drools.core.impl.KnowledgeBaseImpl.removeRule(KnowledgeBaseImpl.java:1535)
at org.drools.core.impl.KnowledgeBaseImpl.removeObjectsGeneratedFromResource(KnowledgeBaseImpl.java:1768)
at org.drools.compiler.builder.impl.KnowledgeBuilderImpl.removeObjectsGeneratedFromResource(KnowledgeBuilderImpl.java:2029)
at org.drools.compiler.kie.builder.impl.KieContainerImpl.update(KieContainerImpl.java:171)
at org.drools.compiler.kie.builder.impl.KieContainerImpl.updateToVersion(KieContainerImpl.java:104)
at org.drools.compiler.integrationTests.RemovingARuleCausesNPE.test(RemovingARuleCausesNPE.java:172)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:60)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
at java.lang.reflect.Method.invoke(Method.java:611)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
at org.junit.runners.BlockJUnit4ClassRunner.runNotIgnored(BlockJUnit4ClassRunner.java:79)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:71)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:49)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:49)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
> In a catch22 using a NOT constraint in rules shared by multiple facts
> ---------------------------------------------------------------------
>
> Key: DROOLS-731
> URL: https://issues.jboss.org/browse/DROOLS-731
> Project: Drools
> Issue Type: Bug
> Components: core engine
> Affects Versions: 6.0.1.Final, 6.1.0.Final
> Environment: Custom application that completely wraps Drools Fusion written as an OSGI application hosted on Websphere Liberty profile.
> Reporter: Bill Tuminaro
> Assignee: Mario Fusco
> Attachments: DROOLS-731_DroolsTestCases.zip
>
>
> I have a reproducer for these related issues.
> We have encountered a couple of issues (Exceptions) when using a NOT constraint in rules that have facts associated with them when we call upgradeToVersion() or kSession.delete(). The catch22 is that one version of the NOT constraint avoids one Exception while causing another. Reproducing the issue requires 2 rules sharing the same NOT constraint. I have narrowed the issue(s) down to 2 very simple rules that use the org.drools.compiler.FactA class.
> Here are the 2 rules used:
> static final String ruleDrl = "package org.some.test\n" +
> "import org.drools.compiler.FactA\n" +
> "declare FactA\n" +
> "@role(event)" +
> "end\n" +
> "rule \"R200_0\" when\n" +
> " $FactA : FactA ($FactA_field2 : field2 == 111002)\n" +
> " not FactA($FactA_field2 == 111002, this after $FactA)\n" + // version A: using this version causes a NPE when calling ksession.delete()
> // " not FactA(field2 == 111002, this after $FactA)\n" + // Version B: using this version causes the IllegalArgumentException: Cannot remove a sink,
> // when the list of sinks is null on the updateToVersion() call
> "then\n" +
> "end\n";
> static final String ruleDrl2 = "package org.some.test\n" +
> "import org.drools.compiler.FactA\n" +
> "declare FactA\n" +
> "@role(event)" +
> "end\n" +
> "rule \"R1437_0\" when\n" +
> " $FactA : FactA ($FactA_field2 : field2 == 105742)\n" +
> " not FactA($FactA_field2 == 105742, this after $FactA)\n" + // version A:
> // " not FactA(field2 == 105742, this after $FactA)\n" + // Version B:
> "then\n" +
> "end\n";
> We are hitting the following NPE using the reproducer code attached when we use the NOT Constraint labeled as 'Version A' in the rule:
> java.lang.NullPointerExceptionNullPointerException caught: 2
> at org.drools.core.reteoo.NotNode.doDeleteRightTuple(NotNode.java:186)
> at org.drools.core.reteoo.NotNode.retractRightTuple(NotNode.java:174)
> at org.drools.core.reteoo.ObjectTypeNode.doRetractObject(ObjectTypeNode.java:345)
> at org.drools.core.reteoo.ObjectTypeNode.retractObject(ObjectTypeNode.java:337)
> at org.drools.core.reteoo.EntryPointNode.retractObject(EntryPointNode.java:379)
> at org.drools.core.common.NamedEntryPoint.delete(NamedEntryPoint.java:612)
> at org.drools.core.impl.StatefulKnowledgeSessionImpl.delete(StatefulKnowledgeSessionImpl.java:1467)
> at org.drools.core.impl.StatefulKnowledgeSessionImpl.delete(StatefulKnowledgeSessionImpl.java:1458)
> at org.drools.compiler.integrationTests.RemovingARuleCausesNPE.test(RemovingARuleCausesNPE.java:187)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:60)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
> at java.lang.reflect.Method.invoke(Method.java:611)
> at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
> at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
> at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
> at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
> at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
> at org.junit.runners.BlockJUnit4ClassRunner.runNotIgnored(BlockJUnit4ClassRunner.java:79)
> at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:71)
> at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:49)
> at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
> at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
> at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
> at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
> at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
> at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
> at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
> at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:49)
> at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
> at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
> at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
> at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
> at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
> We are hitting the following IllegalArgumentException using the reproducer code attached when we use the NOT Constraint labeled as 'Version B' in the rule:
> java.lang.IllegalArgumentException: Cannot remove a sink, when the list of sinks is null
> at org.drools.core.reteoo.ObjectSource.removeObjectSink(ObjectSource.java:203)
> at org.drools.core.reteoo.ObjectSource.doRemove(ObjectSource.java:242)
> at org.drools.core.common.BaseNode.remove(BaseNode.java:122)
> at org.drools.core.reteoo.ReteooBuilder.removeNode(ReteooBuilder.java:236)
> at org.drools.core.reteoo.ReteooBuilder.removeTerminalNode(ReteooBuilder.java:179)
> at org.drools.core.reteoo.ReteooBuilder.removeRule(ReteooBuilder.java:153)
> at org.drools.core.impl.KnowledgeBaseImpl.removeRule(KnowledgeBaseImpl.java:1535)
> at org.drools.core.impl.KnowledgeBaseImpl.removeObjectsGeneratedFromResource(KnowledgeBaseImpl.java:1768)
> at org.drools.compiler.builder.impl.KnowledgeBuilderImpl.removeObjectsGeneratedFromResource(KnowledgeBuilderImpl.java:2029)
> at org.drools.compiler.kie.builder.impl.KieContainerImpl.update(KieContainerImpl.java:171)
> at org.drools.compiler.kie.builder.impl.KieContainerImpl.updateToVersion(KieContainerImpl.java:104)
> at org.drools.compiler.integrationTests.RemovingARuleCausesNPE.test(RemovingARuleCausesNPE.java:172)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:60)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
> at java.lang.reflect.Method.invoke(Method.java:611)
> at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
> at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
> at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
> at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
> at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
> at org.junit.runners.BlockJUnit4ClassRunner.runNotIgnored(BlockJUnit4ClassRunner.java:79)
> at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:71)
> at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:49)
> at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
> at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
> at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
> at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
> at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
> at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
> at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
> at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:49)
> at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
> at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
> at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
> at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
> at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
--
This message was sent by Atlassian JIRA
(v6.3.11#6341)
10 years, 7 months
[JBoss JIRA] (DROOLS-731) In a catch22 using a NOT constraint in rules shared by multiple facts
by Bill Tuminaro (JIRA)
[ https://issues.jboss.org/browse/DROOLS-731?page=com.atlassian.jira.plugin... ]
Bill Tuminaro updated DROOLS-731:
---------------------------------
Description:
I have a reproducer for these related issues.
We have encountered a couple of issues (Exceptions) when using a NOT constraint in rules that have facts associated with them when we call upgradeToVersion() or kSession.delete(). The catch22 is that one version of the NOT constraint avoids one Exception while causing another. Reproducing the issue requires 2 rules sharing the same NOT constraint. I have narrowed the issue(s) down to 2 very simple rules that use the org.drools.compiler.FactA class.
Here are the 2 rules used:
static final String ruleDrl = "package org.some.test\n" +
"import org.drools.compiler.FactA\n" +
"declare FactA\n" +
"@role(event)" +
"end\n" +
"rule \"R200_0\" when\n" +
" $FactA : FactA ($FactA_field2 : field2 == 111002)\n" +
" not FactA($FactA_field2 == 111002, this after $FactA)\n" + // version A: using this version causes a NPE when calling ksession.delete()
// " not FactA(field2 == 111002, this after $FactA)\n" + // Version B: using this version causes the IllegalArgumentException: Cannot remove a sink,
// when the list of sinks is null on the updateToVersion() call
"then\n" +
"end\n";
static final String ruleDrl2 = "package org.some.test\n" +
"import org.drools.compiler.FactA\n" +
"declare FactA\n" +
"@role(event)" +
"end\n" +
"rule \"R1437_0\" when\n" +
" $FactA : FactA ($FactA_field2 : field2 == 105742)\n" +
" not FactA($FactA_field2 == 105742, this after $FactA)\n" + // version A:
// " not FactA(field2 == 105742, this after $FactA)\n" + // Version B:
"then\n" +
"end\n";
We are hitting the following NPE using the reproducer code attached when we use the NOT Constraint labeled as 'Version A' in the rule:
java.lang.NullPointerExceptionNullPointerException caught: 2
at org.drools.core.reteoo.NotNode.doDeleteRightTuple(NotNode.java:186)
at org.drools.core.reteoo.NotNode.retractRightTuple(NotNode.java:174)
at org.drools.core.reteoo.ObjectTypeNode.doRetractObject(ObjectTypeNode.java:345)
at org.drools.core.reteoo.ObjectTypeNode.retractObject(ObjectTypeNode.java:337)
at org.drools.core.reteoo.EntryPointNode.retractObject(EntryPointNode.java:379)
at org.drools.core.common.NamedEntryPoint.delete(NamedEntryPoint.java:612)
at org.drools.core.impl.StatefulKnowledgeSessionImpl.delete(StatefulKnowledgeSessionImpl.java:1467)
at org.drools.core.impl.StatefulKnowledgeSessionImpl.delete(StatefulKnowledgeSessionImpl.java:1458)
at org.drools.compiler.integrationTests.RemovingARuleCausesNPE.test(RemovingARuleCausesNPE.java:187)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:60)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
at java.lang.reflect.Method.invoke(Method.java:611)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
at org.junit.runners.BlockJUnit4ClassRunner.runNotIgnored(BlockJUnit4ClassRunner.java:79)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:71)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:49)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:49)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
We are hitting the following NPE using the reproducer code attached when we use the NOT Constraint labeled as 'Version A' in the rule:
java.lang.IllegalArgumentException: Cannot remove a sink, when the list of sinks is null
at org.drools.core.reteoo.ObjectSource.removeObjectSink(ObjectSource.java:203)
at org.drools.core.reteoo.ObjectSource.doRemove(ObjectSource.java:242)
at org.drools.core.common.BaseNode.remove(BaseNode.java:122)
at org.drools.core.reteoo.ReteooBuilder.removeNode(ReteooBuilder.java:236)
at org.drools.core.reteoo.ReteooBuilder.removeTerminalNode(ReteooBuilder.java:179)
at org.drools.core.reteoo.ReteooBuilder.removeRule(ReteooBuilder.java:153)
at org.drools.core.impl.KnowledgeBaseImpl.removeRule(KnowledgeBaseImpl.java:1535)
at org.drools.core.impl.KnowledgeBaseImpl.removeObjectsGeneratedFromResource(KnowledgeBaseImpl.java:1768)
at org.drools.compiler.builder.impl.KnowledgeBuilderImpl.removeObjectsGeneratedFromResource(KnowledgeBuilderImpl.java:2029)
at org.drools.compiler.kie.builder.impl.KieContainerImpl.update(KieContainerImpl.java:171)
at org.drools.compiler.kie.builder.impl.KieContainerImpl.updateToVersion(KieContainerImpl.java:104)
at org.drools.compiler.integrationTests.RemovingARuleCausesNPE.test(RemovingARuleCausesNPE.java:172)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:60)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
at java.lang.reflect.Method.invoke(Method.java:611)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
at org.junit.runners.BlockJUnit4ClassRunner.runNotIgnored(BlockJUnit4ClassRunner.java:79)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:71)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:49)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:49)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
was:
I have a reproducer for these related issues.
We have encountered a couple of issues (Exceptions) when using a NOT constraint in rules that have facts associated with them when we call upgradeToVersion() or kSession.delete(). The catch22 is that one version of the NOT constraint avoids one Exception while causing another. Reproducing the issue requires 2 rules sharing the same NOT constraint. I have narrowed the issue(s) down to 2 very simple rules that use the org.drools.compiler.FactA class.
Here are the 2 rules used:
static final String ruleDrl = "package org.some.test\n" +
"import org.drools.compiler.FactA\n" +
"declare FactA\n" +
"@role(event)" +
"end\n" +
"rule \"R200_0\" when\n" +
// " $FactA : FactA ($FactA_field2 : field2 == 111002)\n" + // version A: using this version causes a NPE when calling ksession.delete()
" not FactA($FactA_field2 == 111002, this after $FactA)\n" +
" not FactA(field2 == 105742, this after $FactA)\n" + // Version B: using this version causes the IllegalArgumentException: Cannot remove a sink,
// when the list of sinks is null on the updateToVersion() call
"then\n" +
"end\n";
static final String ruleDrl2 = "package org.some.test\n" +
"import org.drools.compiler.FactA\n" +
"declare FactA\n" +
"@role(event)" +
"end\n" +
"rule \"R1437_0\" when\n" +
" $FactA : FactA ($FactA_field2 : field2 == 105742)\n" +
" not FactA($FactA_field2 == 105742, this after $FactA)\n" + // version A:
// " not FactA(field2 == 105742, this after $FactA)\n" + // Version B:
"then\n" +
"end\n";
> In a catch22 using a NOT constraint in rules shared by multiple facts
> ---------------------------------------------------------------------
>
> Key: DROOLS-731
> URL: https://issues.jboss.org/browse/DROOLS-731
> Project: Drools
> Issue Type: Bug
> Components: core engine
> Affects Versions: 6.0.1.Final, 6.1.0.Final
> Environment: Custom application that completely wraps Drools Fusion written as an OSGI application hosted on Websphere Liberty profile.
> Reporter: Bill Tuminaro
> Assignee: Mario Fusco
> Attachments: DROOLS-731_DroolsTestCases.zip
>
>
> I have a reproducer for these related issues.
> We have encountered a couple of issues (Exceptions) when using a NOT constraint in rules that have facts associated with them when we call upgradeToVersion() or kSession.delete(). The catch22 is that one version of the NOT constraint avoids one Exception while causing another. Reproducing the issue requires 2 rules sharing the same NOT constraint. I have narrowed the issue(s) down to 2 very simple rules that use the org.drools.compiler.FactA class.
> Here are the 2 rules used:
> static final String ruleDrl = "package org.some.test\n" +
> "import org.drools.compiler.FactA\n" +
> "declare FactA\n" +
> "@role(event)" +
> "end\n" +
> "rule \"R200_0\" when\n" +
> " $FactA : FactA ($FactA_field2 : field2 == 111002)\n" +
> " not FactA($FactA_field2 == 111002, this after $FactA)\n" + // version A: using this version causes a NPE when calling ksession.delete()
> // " not FactA(field2 == 111002, this after $FactA)\n" + // Version B: using this version causes the IllegalArgumentException: Cannot remove a sink,
> // when the list of sinks is null on the updateToVersion() call
> "then\n" +
> "end\n";
> static final String ruleDrl2 = "package org.some.test\n" +
> "import org.drools.compiler.FactA\n" +
> "declare FactA\n" +
> "@role(event)" +
> "end\n" +
> "rule \"R1437_0\" when\n" +
> " $FactA : FactA ($FactA_field2 : field2 == 105742)\n" +
> " not FactA($FactA_field2 == 105742, this after $FactA)\n" + // version A:
> // " not FactA(field2 == 105742, this after $FactA)\n" + // Version B:
> "then\n" +
> "end\n";
> We are hitting the following NPE using the reproducer code attached when we use the NOT Constraint labeled as 'Version A' in the rule:
> java.lang.NullPointerExceptionNullPointerException caught: 2
> at org.drools.core.reteoo.NotNode.doDeleteRightTuple(NotNode.java:186)
> at org.drools.core.reteoo.NotNode.retractRightTuple(NotNode.java:174)
> at org.drools.core.reteoo.ObjectTypeNode.doRetractObject(ObjectTypeNode.java:345)
> at org.drools.core.reteoo.ObjectTypeNode.retractObject(ObjectTypeNode.java:337)
> at org.drools.core.reteoo.EntryPointNode.retractObject(EntryPointNode.java:379)
> at org.drools.core.common.NamedEntryPoint.delete(NamedEntryPoint.java:612)
> at org.drools.core.impl.StatefulKnowledgeSessionImpl.delete(StatefulKnowledgeSessionImpl.java:1467)
> at org.drools.core.impl.StatefulKnowledgeSessionImpl.delete(StatefulKnowledgeSessionImpl.java:1458)
> at org.drools.compiler.integrationTests.RemovingARuleCausesNPE.test(RemovingARuleCausesNPE.java:187)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:60)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
> at java.lang.reflect.Method.invoke(Method.java:611)
> at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
> at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
> at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
> at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
> at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
> at org.junit.runners.BlockJUnit4ClassRunner.runNotIgnored(BlockJUnit4ClassRunner.java:79)
> at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:71)
> at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:49)
> at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
> at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
> at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
> at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
> at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
> at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
> at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
> at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:49)
> at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
> at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
> at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
> at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
> at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
> We are hitting the following NPE using the reproducer code attached when we use the NOT Constraint labeled as 'Version A' in the rule:
> java.lang.IllegalArgumentException: Cannot remove a sink, when the list of sinks is null
> at org.drools.core.reteoo.ObjectSource.removeObjectSink(ObjectSource.java:203)
> at org.drools.core.reteoo.ObjectSource.doRemove(ObjectSource.java:242)
> at org.drools.core.common.BaseNode.remove(BaseNode.java:122)
> at org.drools.core.reteoo.ReteooBuilder.removeNode(ReteooBuilder.java:236)
> at org.drools.core.reteoo.ReteooBuilder.removeTerminalNode(ReteooBuilder.java:179)
> at org.drools.core.reteoo.ReteooBuilder.removeRule(ReteooBuilder.java:153)
> at org.drools.core.impl.KnowledgeBaseImpl.removeRule(KnowledgeBaseImpl.java:1535)
> at org.drools.core.impl.KnowledgeBaseImpl.removeObjectsGeneratedFromResource(KnowledgeBaseImpl.java:1768)
> at org.drools.compiler.builder.impl.KnowledgeBuilderImpl.removeObjectsGeneratedFromResource(KnowledgeBuilderImpl.java:2029)
> at org.drools.compiler.kie.builder.impl.KieContainerImpl.update(KieContainerImpl.java:171)
> at org.drools.compiler.kie.builder.impl.KieContainerImpl.updateToVersion(KieContainerImpl.java:104)
> at org.drools.compiler.integrationTests.RemovingARuleCausesNPE.test(RemovingARuleCausesNPE.java:172)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:60)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
> at java.lang.reflect.Method.invoke(Method.java:611)
> at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
> at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
> at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
> at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
> at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
> at org.junit.runners.BlockJUnit4ClassRunner.runNotIgnored(BlockJUnit4ClassRunner.java:79)
> at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:71)
> at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:49)
> at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
> at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
> at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
> at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
> at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
> at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
> at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
> at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:49)
> at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
> at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
> at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
> at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
> at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
--
This message was sent by Atlassian JIRA
(v6.3.11#6341)
10 years, 7 months