[jBPM] - jbpm 5.3 - kSession.dispose() - Error: Session was previously disposed
by Pedro Gonçalves
Pedro Gonçalves [https://community.jboss.org/people/pgoncalves] created the discussion
"jbpm 5.3 - kSession.dispose() - Error: Session was previously disposed"
To view the discussion, visit: https://community.jboss.org/message/745092#745092
--------------------------------------------------------------
I'm using jbpm5.3, with spring and hibernate.
In the method I use to start a process instance, if I use the kSession.dispose() it will give me the error below, but if not, it will work well! (The application was just started, so no kSessions used before, and the database was clean)
It is not supposed to call dispose() when kSession will not be used anymore (I have one kSession per process instance).
When I call kSession.dispose() for the first time, I got the error:
java.lang.IllegalStateException: Illegal method call. This session was previously disposed.
at org.drools.reteoo.DisposedReteooWorkingMemory.getProcessRuntime(DisposedReteooWorkingMemory.java:270)
at org.drools.impl.StatefulKnowledgeSessionImpl.getProcessRuntime(StatefulKnowledgeSessionImpl.java:874)
at org.drools.persistence.SingleSessionCommandService$SynchronizationImpl.afterCompletion(SingleSessionCommandService.java:448)
at org.drools.persistence.jta.JtaTransactionSynchronizationAdapter.afterCompletion(JtaTransactionSynchronizationAdapter.java:25)
at bitronix.tm.BitronixTransaction.fireAfterCompletionEvent(BitronixTransaction.java:497)
at bitronix.tm.BitronixTransaction.rollback(BitronixTransaction.java:283)
at bitronix.tm.BitronixTransactionManager.rollback(BitronixTransactionManager.java:129)
at org.springframework.transaction.jta.JtaTransactionManager.doRollback(JtaTransactionManager.java:1037)
(......)
How I start the process instance:
public void startProcess(CoreData coreData, String definitionId) {
//Creating variables ...
(...)
//taskService is a spring bean
LocalTaskService localTaskService = new LocalTaskService(taskService);
//GetKSession with null will create a new kSession
StatefulKnowledgeSession kSession = getKSession(null, localTaskService);
JPAWorkingMemoryDbLogger jbpmLogger = new JPAWorkingMemoryDbLogger(kSession);
ProcessInstance processInstance = kSession.startProcess(definitionId, variables);
jbpmLogger.dispose();
//If I remove this kSession.dispose() it will work well, but will give a optimistic lock error later....
kSession.dispose();
}
How I create the kSession:
public StatefulKnowledgeSession getKSession(Integer kSessionId, LocalTaskService localTaskService) {
StatefulKnowledgeSession kSession;
Environment env = KnowledgeBaseFactory.newEnvironment();
env.set(EnvironmentName.ENTITY_MANAGER_FACTORY, entityManagerWorkflow.getEntityManagerFactory());
env.set(EnvironmentName.TRANSACTION_MANAGER, TransactionManagerServices.getTransactionManager());
if (kSessionId == null) {
kSession = JPAKnowledgeService.newStatefulKnowledgeSession(knowledgeBaseProvider.getKbase(), null, env);
} else {
kSession = JPAKnowledgeService.loadStatefulKnowledgeSession(kSessionId, knowledgeBaseProvider.getKbase(), null, env);
}
/*
* Adding Listner
* */
CustomProcessEventListener customProcessEventListener = new CustomProcessEventListener();
kSession.addEventListener(customProcessEventListener);
/*
* Register WorkItemHandler
* */
GenericHTWorkItemHandler handler = new GenericHTWorkItemHandler(kSession);
handler.setClient(localTaskService);
handler.setLocal(true);
handler.setIpAddress("127.0.0.1");
handler.setPort(9123);
handler.connect();
kSession.getWorkItemManager().registerWorkItemHandler("Human Task", handler);
return kSession;
}
Thanks
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/745092#745092]
Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&con...]
12 years, 5 months
[jBPM] - Issue deploying designer.war
by jnorris
jnorris [https://community.jboss.org/people/jnorris] created the discussion
"Issue deploying designer.war"
To view the discussion, visit: https://community.jboss.org/message/743347#743347
--------------------------------------------------------------
Hi All,
For some reason yesterday the designer.war file (v2.2) stopped deploying due to a class not found exception with log4j. All of the other wars deploy without any issues. Any help would be greatly appreciated. The exception is given below.
Thanks,
Jim
07:35:16,437 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-5) MSC00001: Failed to start service jboss.deployment.unit."designer.war".INSTALL: org.jboss.msc.service.StartException in service jboss.deployment.unit."designer.war".INSTALL: Failed to process phase INSTALL of deployment "designer.war"
at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:121)
at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1824)
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1759)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [:1.6.0_24]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [:1.6.0_24]
at java.lang.Thread.run(Thread.java:662) [:1.6.0_24]
Caused by: java.lang.RuntimeException: Error getting reflective information for class org.jbpm.designer.web.server.DictionaryServlet
at org.jboss.as.server.deployment.reflect.DeploymentReflectionIndex.getClassIndex(DeploymentReflectionIndex.java:70)
at org.jboss.as.ee.component.EEModuleClassDescription$DefaultConfigurator.configure(EEModuleClassDescription.java:176)
at org.jboss.as.ee.component.deployers.EEClassConfigurationProcessor$1.compute(EEClassConfigurationProcessor.java:147)
at org.jboss.as.ee.component.deployers.EEClassConfigurationProcessor$1.compute(EEClassConfigurationProcessor.java:122)
at org.jboss.as.ee.component.LazyValue.get(LazyValue.java:40)
at org.jboss.as.ee.component.EEApplicationDescription.getClassConfiguration(EEApplicationDescription.java:183)
at org.jboss.as.ee.component.ComponentDescription.createConfiguration(ComponentDescription.java:153)
at org.jboss.as.ee.component.deployers.EEModuleConfigurationProcessor.deploy(EEModuleConfigurationProcessor.java:70)
at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:115)
... 5 more
Caused by: java.lang.NoClassDefFoundError: Lorg/apache/log4j/Logger;
at java.lang.Class.getDeclaredFields0(Native Method) [:1.6.0_24]
at java.lang.Class.privateGetDeclaredFields(Class.java:2291) [:1.6.0_24]
at java.lang.Class.getDeclaredFields(Class.java:1743) [:1.6.0_24]
at org.jboss.as.server.deployment.reflect.ClassReflectionIndex.<init>(ClassReflectionIndex.java:57)
at org.jboss.as.server.deployment.reflect.DeploymentReflectionIndex.getClassIndex(DeploymentReflectionIndex.java:66)
... 13 more
Caused by: java.lang.ClassNotFoundException: org.apache.log4j.Logger from [Module "deployment.designer.war:main" from Service Module Loader]
at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:191)
at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:361)
at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:333)
at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:310)
at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:103)
... 18 more
07:35:17,609 ERROR [stderr] (MSC service thread 1-3) SLF4J: This version of SLF4J requires log4j version 1.2.12 or later. See also http://www.slf4j.org/codes.html#log4j_version http://www.slf4j.org/codes.html#log4j_version
07:35:17,937 ERROR [stderr] (MSC service thread 1-3) log4j:WARN No appenders could be found for logger (org.reflections.Reflections).
07:35:17,937 ERROR [stderr] (MSC service thread 1-3) log4j:WARN Please initialize the log4j system properly.
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/743347#743347]
Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&con...]
12 years, 5 months
[jBPM] - Re: Difficulties Invoking Rule Task
by ashutosh gupta
ashutosh gupta [https://community.jboss.org/people/ashu_akg21] created the discussion
"Re: Difficulties Invoking Rule Task"
To view the discussion, visit: https://community.jboss.org/message/745044#745044
--------------------------------------------------------------
Hi Tihomir,
We are using JBPM 5.3 and we are facing the same problem [getting Rule task to fire after Human Task]. When we tried to follow the method suggested, we are getting only the following events within AgendaEventListener:
AgendaEventListener a=new AgendaEventListener() {
@Override
public void beforeActivationFired(
org.drools.event.rule.BeforeActivationFiredEvent arg0) {
// TODO Auto-generated method stub
}
@Override
public void agendaGroupPushed(
org.drools.event.rule.AgendaGroupPushedEvent arg0) {
// TODO Auto-generated method stub
}
@Override
public void agendaGroupPopped(
org.drools.event.rule.AgendaGroupPoppedEvent arg0) {
// TODO Auto-generated method stub
}
@Override
public void afterActivationFired(
org.drools.event.rule.AfterActivationFiredEvent arg0) {
// TODO Auto-generated method stub
}
@Override
public void activationCreated(
org.drools.event.rule.ActivationCreatedEvent arg0) {
// TODO Auto-generated method stub
}
@Override
public void activationCancelled(
org.drools.event.rule.ActivationCancelledEvent arg0) {
// TODO Auto-generated method stub
}
};
We cant find afterRuleFlowGroupActivated event here. Could you please advise how we can move forward?
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/745044#745044]
Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&con...]
12 years, 5 months
[EJB3] - injecting env-entry into interceptor by @Resource does not work
by gunter zeilinger
gunter zeilinger [https://community.jboss.org/people/gunterze] created the discussion
"injecting env-entry into interceptor by @Resource does not work"
To view the discussion, visit: https://community.jboss.org/message/744771#744771
--------------------------------------------------------------
I use an Interceptor to initialize a POJO Service deployed as EJB Singleton:
public class LdapDicomConfigurationInterceptor {
@Resource(name="ldapURL") String ldapURL;
@Resource(name="userDN") String userDN;
@Resource(name="password") String password;
@Resource(name="baseDN") String baseDN;
@PostConstruct
void init(InvocationContext ctx) {
LdapDicomConfiguration dc = (LdapDicomConfiguration) ctx.getTarget();
LdapEnv env = new LdapEnv();
env.setUrl(ldapURL);
env.setUserDN(userDN);
env.setPassword(password);
try {
dc.init(env, baseDN);
} catch (Exception e) {
throw new RuntimeException(e);
}
}
@PreDestroy
void close(InvocationContext ctx) {
LdapDicomConfiguration dc = (LdapDicomConfiguration) ctx.getTarget();
dc.close();
}
}
ejb-jar.xml:
<ejb-jar
xmlns=" http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee"
xmlns:xsi=" http://www.w3.org/2001/XMLSchema-instance http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation=" http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/ejb-jar_3_1.xsd http://java.sun.com/xml/ns/javaee/ejb-jar_3_1.xsd"
version="3.1">
<enterprise-beans>
<session>
<ejb-name>DicomConfiguration</ejb-name>
<ejb-class>org.dcm4che.conf.ldap.LdapDicomConfiguration</ejb-class>
<session-type>Singleton</session-type>
<init-on-startup>true</init-on-startup>
</session>
</enterprise-beans>
<interceptors>
<interceptor>
<interceptor-class>org.dcm4chee.conf.ldap.LdapDicomConfigurationInterceptor</interceptor-class>
<env-entry>
<env-entry-name>ldapURL</env-entry-name>
<env-entry-type>java.lang.String</env-entry-type>
<env-entry-value>ldap://localhost:389</env-entry-value>
</env-entry>
<env-entry>
<env-entry-name>userDN</env-entry-name>
<env-entry-type>java.lang.String</env-entry-type>
<env-entry-value>cn=admin,dc=nodomain</env-entry-value>
</env-entry>
<env-entry>
<env-entry-name>password</env-entry-name>
<env-entry-type>java.lang.String</env-entry-type>
<env-entry-value>admin</env-entry-value>
</env-entry>
<env-entry>
<env-entry-name>baseDN</env-entry-name>
<env-entry-type>java.lang.String</env-entry-type>
<env-entry-value>dc=nodomain</env-entry-value>
</env-entry>
</interceptor>
</interceptors>
<assembly-descriptor>
<container-transaction>
<method>
<ejb-name>DicomConfiguration</ejb-name>
<method-name>*</method-name>
</method>
<trans-attribute>NotSupported</trans-attribute>
</container-transaction>
<interceptor-binding>
<ejb-name>DicomConfiguration</ejb-name>
<interceptor-class>org.dcm4chee.conf.ldap.LdapDicomConfigurationInterceptor</interceptor-class>
</interceptor-binding>
</assembly-descriptor>
</ejb-jar>
But LdapDicomConfigurationInterceptor fields does not get injected.
Specifiying injection fields in ejb-jar.xml by
<env-entry>
<env-entry-name>password</env-entry-name>
<env-entry-type>java.lang.String</env-entry-type>
<env-entry-value>admin</env-entry-value>
+ <injection-target>+
+ <injection-target-class>org.dcm4chee.conf.ldap.LdapDicomConfigurationInterceptor</injection-target-class>+
+ <injection-target-name>password</injection-target-name>+
+ </injection-target>+
</env-entry>
instead of @Resource works.
AS: jboss-as-7.1.1.Final
JAVA: OpenJDK 64-Bit Server VM (build 20.0-b12, mixed mode
OS: Linux amd64 3.3.7-1-ARCH
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/744771#744771]
Start a new discussion in EJB3 at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&con...]
12 years, 5 months
[jBPM] - About jBPM5
by Jay Patel
Jay Patel [https://community.jboss.org/people/jay4smile] created the discussion
"About jBPM5"
To view the discussion, visit: https://community.jboss.org/message/744983#744983
--------------------------------------------------------------
Hello,
I am new bee to jBPM and Drools.
I have downloaded jBPM5 final version.
and installed it successfully.
I have some Questions.!
1) When I am creating helloWorld.bpmn, it opens in XML format,I am unable to open it in pallet.
2) I have created custom task as per video shown in *http://vimeo.com/29457538 http://vimeo.com/29457538.*
But that task is not visible in Pallet.which configuration is left?
3) I want to call restlet web service with jBPM is it possible??
4) I try to run sample program (came with jBPM installer) sample -> evaluation Program. I got error like
*HornetQHTWorkItemHandler cannot be resolved to a type*
* The import org.jbpm.process.workitem.wsht cannot be resolved*
I am unable to trace the problem.
So, can anyone guide me how can I solved above listed Problems??
If any one have web Application example with jBPM ,Please help me and provide me that example..
Thanks and Regards,
Jay Patel
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/744983#744983]
Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&con...]
12 years, 5 months
[jBPM] - Using multiple kSessions
by Richard Evans
Richard Evans [https://community.jboss.org/people/r3vans] created the discussion
"Using multiple kSessions"
To view the discussion, visit: https://community.jboss.org/message/744551#744551
--------------------------------------------------------------
I have not been able to get multiple sessions working properly:
* I declare multiple sessions in the spring context (see below).
* I start a pool of threads. As each thread is executed I grab session and save it in a ThreadLocal.
* I despatch calls to kSession.startProcess in each thread.
Is this a reasonable approach?
I find that this will run OK for a while but ultimately will fail either with an NPE in ProcessInstanceImpl getProcess because kruntime is null OR will fail to commit a transaction because it has already been committed.
Regards,
Richard
<drools:ksession id="kSession1" type="stateful" kbase="kBase">
<drools:configuration>
<drools:work-item-handlers>
<!-- Process : ServiceNowCMDB CreateCI -->
<drools:work-item-handler name="ServiceNowCmdbMapperST" ref="ServiceNowCmdbMapperHandler"/>
...etc
</drools:work-item-handlers>
<!-- jBPM Persistence -->
<drools:jpa-persistence>
<drools:transaction-manager ref="transactionManager" />
<drools:entity-manager-factory ref="entityManagerFactory" />
</drools:jpa-persistence>
</drools:configuration>
</drools:ksession>
<drools:ksession id="kSession2" type="stateful" kbase="kBase">
<drools:configuration>
<drools:work-item-handlers>
<!-- Process : ServiceNowCMDB CreateCI -->
<drools:work-item-handler name="ServiceNowCmdbMapperST" ref="ServiceNowCmdbMapperHandler"/>
...etc
</drools:work-item-handlers>
<!-- jBPM Persistence -->
<drools:jpa-persistence>
<drools:transaction-manager ref="transactionManager" />
<drools:entity-manager-factory ref="entityManagerFactory" />
</drools:jpa-persistence>
</drools:configuration>
</drools:ksession>
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/744551#744551]
Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&con...]
12 years, 5 months