[JBoss JIRA] Created: (JBPM-754) job scheduler persistence
by Tom Baeyens (JIRA)
job scheduler persistence
-------------------------
Key: JBPM-754
URL: http://jira.jboss.com/jira/browse/JBPM-754
Project: JBoss jBPM
Issue Type: Bug
Components: Core Engine
Reporter: Tom Baeyens
Assigned To: Tom Baeyens
Priority: Critical
Fix For: jBPM 3.2 alpha 2
some unexplainable hibernate problem while trying to lock jobs for execution:
16:08:22,843 [main] DEBUG GraphElement : event 'task-create' on 'Task(clean ceiling)' for 'Token(/)'
16:08:22,875 [main] DEBUG GraphElement : executing action 'CreateTimerAction(dc9766)'
16:08:22,875 [main] DEBUG GraphElement : event 'timer-create' on 'Task(clean ceiling)' for 'Token(/)'
16:08:22,875 [main] DEBUG GraphElement : event 'after-signal' on 'StartState(979f67)' for 'Token(/)'
16:08:22,875 [main] DEBUG Services : executing default save operations
16:08:22,875 [main] DEBUG HibernateSaveOperation : saving process instance
16:08:22,875 [main] DEBUG SaveLogsOperation : flushing logs to logging service.
16:08:22,890 [main] DEBUG CascadeSaveOperation : cascading save of 'org.jbpm.graph.exe.ProcessInstance@ffd135'
16:08:22,890 [main] DEBUG JbpmContext : closing JbpmContext
16:08:22,890 [main] DEBUG Services : closing service 'persistence': org.jbpm.persistence.db.DbPersistenceService@6d2380
16:08:22,890 [main] DEBUG DbPersistenceService : committing hibernate transaction
16:08:22,890 [main] DEBUG DbPersistenceService : closing hibernate session
16:08:22,890 [main] DEBUG Services : closing service 'tx': org.jbpm.tx.TxService@159780d
16:08:22,890 [main] DEBUG Services : closing service 'scheduler': org.jbpm.scheduler.db.DbSchedulerService@d8ca48
16:08:22,890 [main] DEBUG Services : closing service 'logging': org.jbpm.logging.db.DbLoggingService@c8570c
16:08:23,218 [main] DEBUG JobExecutor : starting thread group 'JbpmJobExector'...
16:08:23,218 [main] DEBUG JobExecutor : starting new job executor thread 'JbpmJobExector:192.168.1.100:1'
16:08:23,218 [JbpmJobExector:192.168.1.100:1] DEBUG JbpmContextInfo : creating jbpm context with service factories '[tx, message, scheduler, logging, persistence, authentication]'
16:08:23,218 [JbpmJobExector:192.168.1.100:1] DEBUG JbpmContext : creating JbpmContext
16:08:23,218 [JbpmJobExector:192.168.1.100:1] DEBUG DbPersistenceServiceFactory : creating persistence service
16:08:23,218 [JbpmJobExector:192.168.1.100:1] DEBUG DbPersistenceService : creating hibernate session
16:08:23,218 [main] DEBUG AbstractDbTestCase : going to sleep for 200 millis, waiting for the job executor to process more jobs
16:08:23,218 [JbpmJobExector:192.168.1.100:1] DEBUG DbPersistenceService : beginning hibernate transaction
16:08:23,218 [JbpmJobExector:192.168.1.100:1] DEBUG JobExecutorThread : querying for acquirable job...
16:08:23,375 [JbpmJobExector:192.168.1.100:1] DEBUG JobExecutorThread : trying to obtain a lock for 'timer(ceiling-timer,org.jbpm.taskmgmt.exe.TaskTimerExecutionDbTest$PlusPlus,16:08:22,875)'
16:08:23,406 [JbpmJobExector:192.168.1.100:1] ERROR AssertionFailure : an assertion failure occured (this may indicate a bug in Hibernate, but is more likely due to unsafe use of the session)
org.hibernate.AssertionFailure: collection was not processed by flush(), role=org.jbpm.taskmgmt.def.Task.events
at org.hibernate.engine.CollectionEntry.postFlush(CollectionEntry.java:183)
at org.hibernate.event.def.AbstractFlushingEventListener.postFlush(AbstractFlushingEventListener.java:328)
at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:28)
at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:980)
at org.jbpm.job.executor.JobExecutorThread.acquireJobs(JobExecutorThread.java:125)
at org.jbpm.job.executor.JobExecutorThread.run(JobExecutorThread.java:54)
--
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, 6 months
[JBoss JIRA] Created: (JBRULES-515) java NullPointerException when using constraints between fields in same object
by Sridhar Chandrasekharan (JIRA)
java NullPointerException when using constraints between fields in same object
------------------------------------------------------------------------------
Key: JBRULES-515
URL: http://jira.jboss.com/jira/browse/JBRULES-515
Project: JBoss Rules
Issue Type: Bug
Security Level: Public (Everyone can see)
Affects Versions: 3.0.4
Environment: Linux
Reporter: Sridhar Chandrasekharan
Assigned To: Mark Proctor
Consider the following files:-
1) Foo.java
package com.foo;
public class Foo {
private int a;
private int b;
public Foo(int a, int b) {
super();
this.a = a;
this.b = b;
}
public boolean test()
{
return (a > b);
}
public int getA() {
return a;
}
public int getB() {
return b;
}
}
******************************************************************************
2) FooTest.java
package com.foo;
import java.io.InputStreamReader;
import java.io.*;
import org.drools.RuleBase;
import org.drools.RuleBaseFactory;
import org.drools.WorkingMemory;
import org.drools.compiler.PackageBuilder;
import org.drools.rule.Package;
public class FooTest {
/**
* This is a sample file to launch a rule package from a rule source file.
*/
public static final void main(String[] args) {
try {
//load up the rulebase
RuleBase ruleBase = readRule();
WorkingMemory workingMemory = ruleBase.newWorkingMemory();
//go !
workingMemory.fireAllRules();
} catch (Throwable t) {
t.printStackTrace();
}
}
/**
* Please note that this is the "low level" rule assembly API.
*/
private static RuleBase readRule() throws Exception {
//read in the source
Reader source = new InputStreamReader( FooTest.class.getResourceAsStream( "/Foo.drl" ) );
//optionally read in the DSL (if you are using it).
//Reader dsl = new InputStreamReader( DroolsTest.class.getResourceAsStream( "/mylang.dsl" ) );
//Use package builder to build up a rule package.
//An alternative lower level class called "DrlParser" can also be used...
PackageBuilder builder = new PackageBuilder();
//this wil parse and compile in one step
//NOTE: There are 2 methods here, the one argument one is for normal DRL.
builder.addPackageFromDrl( source );
//Use the following instead of above if you are using a DSL:
//builder.addPackageFromDrl( source, dsl );
//get the compiled package (which is serializable)
Package pkg = builder.getPackage();
//add the package to a rulebase (deploy the rule package).
RuleBase ruleBase = RuleBaseFactory.newRuleBase();
ruleBase.addPackage( pkg );
return ruleBase;
}
}
***************************************************
3) Foo.drl
package com.foo
rule "Initialization rule"
when
#conditions
then
assert(new Foo(1,1));
assert(new Foo(2,1));
assert(new Foo(2,3));
assert(new Foo(3,2));
assert(new Foo(3,4));
assert(new Foo(4,3));
end
rule "a greater than b"
when
f : Foo(x : a, b < x)
then
System.out.println("a=" + f.getA() + " b=" + f.getB() );
end
******************************************
I get the following error when running the program
java.lang.NullPointerException
at org.drools.rule.BoundVariableConstraint.isAllowed(Unknown Source)
at org.drools.common.BetaNodeBinder.isAllowed(Unknown Source)
at org.drools.reteoo.LeftInputAdapterNode.assertObject(Unknown Source)
at org.drools.reteoo.ObjectSource.propagateAssertObject(Unknown Source)
at org.drools.reteoo.ObjectTypeNode.assertObject(Unknown Source)
at org.drools.reteoo.Rete.assertObject(Unknown Source)
at org.drools.reteoo.ReteooRuleBase.assertObject(Unknown Source)
at org.drools.reteoo.ReteooWorkingMemory.doAssertObject(Unknown Source)
at org.drools.common.AbstractWorkingMemory.assertObject(Unknown Source)
at org.drools.base.DefaultKnowledgeHelper.assertObject(Unknown Source)
at org.drools.base.DefaultKnowledgeHelper.assertObject(Unknown Source)
at com.foo.Rule_Initialization_rule_0.consequence(Rule_Initialization_rule_0.java:7)
at com.foo.Rule_Initialization_rule_0ConsequenceInvoker.evaluate(Rule_Initialization_rule_0ConsequenceInvoker.java:18)
at org.drools.common.DefaultAgenda.fireActivation(Unknown Source)
at org.drools.common.DefaultAgenda.fireNextItem(Unknown Source)
at org.drools.common.AbstractWorkingMemory.fireAllRules(Unknown Source)
at org.drools.common.AbstractWorkingMemory.fireAllRules(Unknown Source)
at com.foo.FooTest.main(FooTest.java:27)
org.drools.spi.ConsequenceException: java.lang.NullPointerException
at org.drools.common.DefaultAgenda.fireActivation(Unknown Source)
at org.drools.common.DefaultAgenda.fireNextItem(Unknown Source)
at org.drools.common.AbstractWorkingMemory.fireAllRules(Unknown Source)
at org.drools.common.AbstractWorkingMemory.fireAllRules(Unknown Source)
at com.foo.FooTest.main(FooTest.java:27)
Caused by: java.lang.NullPointerException
at org.drools.rule.BoundVariableConstraint.isAllowed(Unknown Source)
at org.drools.common.BetaNodeBinder.isAllowed(Unknown Source)
at org.drools.reteoo.LeftInputAdapterNode.assertObject(Unknown Source)
at org.drools.reteoo.ObjectSource.propagateAssertObject(Unknown Source)
at org.drools.reteoo.ObjectTypeNode.assertObject(Unknown Source)
at org.drools.reteoo.Rete.assertObject(Unknown Source)
at org.drools.reteoo.ReteooRuleBase.assertObject(Unknown Source)
at org.drools.reteoo.ReteooWorkingMemory.doAssertObject(Unknown Source)
at org.drools.common.AbstractWorkingMemory.assertObject(Unknown Source)
at org.drools.base.DefaultKnowledgeHelper.assertObject(Unknown Source)
at org.drools.base.DefaultKnowledgeHelper.assertObject(Unknown Source)
at com.foo.Rule_Initialization_rule_0.consequence(Rule_Initialization_rule_0.java:7)
at com.foo.Rule_Initialization_rule_0ConsequenceInvoker.evaluate(Rule_Initialization_rule_0ConsequenceInvoker.java:18)
... 5 more
If I change the 2nd rule to
rule "a greater than b"
when
f : Foo()
and eval(f.test())
then
System.out.println("a=" + f.getA() + " b=" + f.getB() );
end
It works as expected.
--
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, 6 months