[EJB/JBoss] - Unable to passivate due to ctx lock, then JBossRollbackExcep
by patlv23
Hi
I'm encountering the following with our app running on JBoss 3.2.6 on Linux. I've found what seem to be related topics on this but they said that those issues were resolved in an older JBoss release:
First I get several of each of these:
WARN [Thread-7] org.jboss.ejb.plugins.AbstractInstanceCache:tryToPassivate:163 - Unable to passivate due to ctx lock, id=com.company.ejb.entity.ChildOldEntityPK@1f61b1
WARN [Thread-7] org.jboss.ejb.plugins.AbstractInstanceCache:tryToPassivate:163 - Unable to passivate due to ctx lock, id=com.company.ejb.entity.OtherEntityPK@1f0faa
WARN [Thread-7] org.jboss.ejb.plugins.AbstractInstanceCache:tryToPassivate:163 - Unable to passivate due to ctx lock, id=com.company.ejb.entity.ChildNewEntityPK@202263
WARN [Thread-7] org.jboss.ejb.plugins.AbstractInstanceCache:tryToPassivate:163 - Unable to passivate due to ctx lock, id=com.company.ejb.entity.ParentNewEntityPK@1f61b0
WARN [Thread-7] org.jboss.ejb.plugins.AbstractInstanceCache:tryToPassivate:163 - Unable to passivate due to ctx lock, id=com.company.ejb.entity.ParentOldEntityPK@1f61a9
Then eventually, an exception is thrown:
ERROR [JMS SessionPool Worker-0] org.jboss.ejb.plugins.LogInterceptor:handleException:294 - TransactionRolledbackLocalException in method: public abstract void com.company.ejb.session.BatchSessionLocal.postBatchTxnWrapper(int,int,java.lang.String) throws com.company.common.exception.BatchException, causedBy:
org.jboss.tm.JBossRollbackException: Unable to commit, tx=TransactionImpl:XidImpl [FormatId=257, GlobalId=tjboss3//251, BranchQual=] status=STATUS_NO_TRANSACTION
at org.jboss.tm.TransactionImpl.commit(TransactionImpl.java:415)
at org.jboss.ejb.plugins.TxInterceptorCMT.endTransaction(TxInterceptorCMT.java:456)
at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:369)
at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:148)
at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:111)
at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:191)
at org.jboss.ejb.StatelessSessionContainer.internalInvoke(StatelessSessionContainer.java:331)
at org.jboss.ejb.Container.invoke(Container.java:709)
at org.jboss.ejb.plugins.local.BaseLocalProxyFactory.invoke(BaseLocalProxyFactory.java:419)
at org.jboss.ejb.plugins.local.StatelessSessionProxy.invoke(StatelessSessionProxy.java:83)
at $Proxy328.postCashReceiptBatchTxnWrapper(Unknown Source)
at com.company.ejb.session.BatchSessionBean.doPostBatch(BatchSessionBean.java:723)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invoke(StatelessSessionContainer.java:683)
at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(StatelessSessionInstanceInterceptor.java:72)
at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:84)
at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:282)
at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:148)
at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:111)
at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:191)
at org.jboss.ejb.StatelessSessionContainer.internalInvoke(StatelessSessionContainer.java:331)
at org.jboss.ejb.Container.invoke(Container.java:709)
at org.jboss.ejb.plugins.local.BaseLocalProxyFactory.invoke(BaseLocalProxyFactory.java:419)
at org.jboss.ejb.plugins.local.StatelessSessionProxy.invoke(StatelessSessionProxy.java:83)
at $Proxy325.doPostBatch(Unknown Source)
at com.company.ejb.mdb.BatchProcessorBean.onMessage(BatchProcessorBean.java:97)
...
...
Here is the Algorithm. It is run from a SLSB called from a MDB.
ParentOldEntity
- has many ChildOldEntity
- will have corresponding ParentNewEntity
ChildOldEntity
- has corresponding OtherEntity
- will have corresponding ChildNewEntity
ParentNewEntity
ChildNewEntity
OtherEntity
do a findBy on ParentOldEntity
| Iterate ParentOldEntities
| update ParentOldEntity
| create ParentNewEntity
| do a findBy on ChildOldEntity
| Iterate ChildOldEntities
| update ChildOldEntity
| create ChildNewEntity
| collect RelatedEntity key from ChildNewEntity
| END
| Iterate collected OtherEntity keys
| do a findBy on OtherEntity with key
| update OtherEntity
| END
| END
In our tests, failures seem to depend on the number of ChildOldEntity/OtherEntity.
REAL SERVER
usually 1000 ParentOldEntity
will not fail up to around 15000 ChildOldEntity/OtherEntity
VM SERVER
usually 1000 ParentOldEntity
will not fail up to around 4000 ChildOldEntity/OtherEntity
This is our BMP EntityBean configuration.
<container-configuration>
| <container-name>Standard BMP EntityBean</container-name>
| <call-logging>false</call-logging>
| <container-invoker>org.jboss.proxy.ejb.ProxyFactory</container-invoker>
| <container-interceptors>
| <interceptor>org.jboss.ejb.plugins.LogInterceptor</interceptor>
| <interceptor>org.jboss.ejb.plugins.SecurityInterceptor</interceptor>
| <interceptor>org.jboss.ejb.plugins.TxInterceptorCMT</interceptor>
| <interceptor metricsEnabled="true">org.jboss.ejb.plugins.MetricsInterceptor</interceptor>
| <interceptor>org.jboss.ejb.plugins.EntityInstanceInterceptor</interceptor>
| <interceptor>org.jboss.ejb.plugins.EntitySynchronizationInterceptor</interceptor>
| </container-interceptors>
| <instance-pool>org.jboss.ejb.plugins.EntityInstancePool</instance-pool>
| <instance-cache>org.jboss.ejb.plugins.EntityInstanceCache</instance-cache>
| <persistence-manager>org.jboss.ejb.plugins.BMPPersistenceManager</persistence-manager>
| <transaction-manager>org.jboss.tm.TxManager</transaction-manager>
| <container-invoker-conf>
| <RMIObjectPort>4444</RMIObjectPort>
| <Optimized>True</Optimized>
| </container-invoker-conf>
| <container-cache-conf>
| <cache-policy>org.jboss.ejb.plugins.LRUEnterpriseContextCachePolicy</cache-policy>
| <cache-policy-conf>
| <min-capacity>50</min-capacity>
| <max-capacity>25000</max-capacity>
| <overager-period>300</overager-period>
| <max-bean-age>600</max-bean-age>
| <resizer-period>400</resizer-period>
| <max-cache-miss-period>60</max-cache-miss-period>
| <min-cache-miss-period>1</min-cache-miss-period>
| <cache-load-factor>0.75</cache-load-factor>
| </cache-policy-conf>
| </container-cache-conf>
| <container-pool-conf>
| <MaximumSize>100</MaximumSize>
| <MinimumSize>10</MinimumSize>
| </container-pool-conf>
| <commit-option>C</commit-option>
| </container-configuration>
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4138812#4138812
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4138812
18 years, 1 month
[Tomcat, HTTPD, Servlets & JSP] - Httpd + mod_ssl + Jboss
by igain
Hi All,
We are using jboss 4.2 and fronting it with Apache2 + mod_jk as a load balancer.
Everything is working fine so far. Now we need install SSL cert in our application.
I tried to install it on embedded tomcat inside jboss but when i try to access my application "page cannot be displayed" error coming in browser.
And if i access the application directly from jboss without using apache2 SSL is working fine.
I tried to debug mod_jk and found that response code is coming as 302 and it tried to redirect to https based URL but in browser i see page cannot be displayed error.
Is there any other configuration that i need to do in apache.
Would appreciate any help.
Web server Env is : Apache2.0.52, mod_ssl-2.0.52, mod_jk1.2
App server env is : Jboss 4.2
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4138797#4138797
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4138797
18 years, 1 month
[JBoss jBPM] - Re: Dynamic task creation
by massimiliano_cuccia
I can't find any documentation on how to dinamically create a task instance at runtime. So the code below (and in previous post) is fruit of hours spend in trying ... I achieved something that (seems to) works. And this is the result.
Maybe this is not the correct way, so any help needed!!
<?xml version="1.0" encoding="UTF-8"?>
|
| <process-definition
| xmlns="urn:jbpm.org:jpdl-3.1" name="Interpello">
| <swimlane name="startingUser">
| <assignment expression="user(admin)"></assignment>
| </swimlane>
| <start-state name="start">
| <transition name="" to="inizioInterpello"></transition>
| </start-state>
| <end-state name="end1"></end-state>
| <task-node name="verificaFinale">
| <task name="verifica finale" swimlane="startingUser"></task>
| <transition name="finito" to="end1"></transition>
| <transition name="ripeti" to="inizioInterpello"></transition>
| </task-node>
| <task-node name="inizioInterpello">
| <task name="inizio interpello" swimlane="startingUser"></task>
| <event type="node-leave">
| <action name="actionIstruttoriaInterpello" class="it.unict.interpello.IstruttoriaInterpello"></action>
| </event>
| <transition name="Convoca Interpello" to="chiusuraInterpello"></transition>
| </task-node>
| <task-node name="tCompDoc">
| </task-node>
| <task-node name="chiusuraInterpello">
| <task name="Chiusura interpello" swimlane="startingUser"></task>
| <event type="node-leave">
| <action name="actionChiudiInterpello" class="it.unict.interpello.IstruttoriaInterpello"></action>
| </event>
| <transition name="procedi alla verifica finale" to="verificaFinale"></transition>
| </task-node>
| <process-state name="process1"></process-state>
| <super-state name="super1"></super-state>
| </process-definition>
as you can see in the xml, I created a node-leave action handler, and I call the same class (for testing purpose only) on leaving InizioInterpello and on leaving ChiusuraInterpello.
Below you can read the code of the action handler.
When I execute the InizioInterpello task the code is executed: I can see the output (System.out) and when I show the task list (context.getProcessInstance(processInstanceId).getTaskMgmtInstance().getTaskInstances()) of the process instance I see a task for every user.
But If I execute ChiusuraInterpello I can't see no output, no new task instance were created ... it seems that my action is ignored at all. But the task is closed correctly.
package it.unict.interpello;
|
|
| import it.unict.consulta.ManagerBeansProxy;
| import it.unict.consulta.driver.data.IDocente;
| import it.unict.consulta.driver.manager.IEducationManager;
|
| import java.util.Collection;
|
| import org.jbpm.graph.exe.ExecutionContext;
| import org.jbpm.graph.exe.Token;
| import org.jbpm.graph.node.TaskNode;
| import org.jbpm.taskmgmt.def.Task;
| import org.jbpm.taskmgmt.exe.TaskInstance;
| import org.jbpm.taskmgmt.exe.TaskMgmtInstance;
|
| public class IstruttoriaInterpello implements org.jbpm.graph.def.ActionHandler
| {
| ManagerBeansProxy mbProxy = null;
|
| public void execute(ExecutionContext executionContext) throws Exception
| {
| System.out.println("qqqqq***********************************************************************");
| System.out.println("*** I can see this only when leaving InizioInterpello, but nothing is shown when executing ChiusuraInterpello ***");
| System.out.println("***********************************************************************");
| System.out.println("***********************************************************************");
| System.out.println("***********************************************************************");
| System.out.println("***********************************************************************");
|
| mbProxy = new ManagerBeansProxy();
| IEducationManager edu = mbProxy.getMEducation();
|
| if (edu == null)
| throw new RuntimeException("EducationManager non disponibile");
|
| try
| {
| // determine the sets of users
| Collection<IDocente> lDoc = edu.listaDocenti();
|
| if (lDoc == null || lDoc.size() == 0)
| throw new RuntimeException("Nessun docente");
|
| // for each user creates a personal task instance
| for (IDocente d : lDoc)
| {
| String uname = d.getUsername();
| createAndAssignTask(uname, executionContext);
| }
| }
| catch (Exception ex)
| {
| System.out.println(ex);
| createAndAssignTask("admin", executionContext);
| }
| }
|
| public void createAndAssignTask(String user, ExecutionContext executionContext)
| {
| Token token = null;
| TaskMgmtInstance tmi = null;
| TaskNode taskNode = null;
|
| try
| {
| token = executionContext.getToken();
| tmi = executionContext.getTaskMgmtInstance();
| taskNode = (TaskNode) executionContext.getNode();
|
| // create the new task instance, a clone of tCompDoc
| Task doCompilaDocumento = taskNode.getTask("tCompDoc");
| TaskInstance tCompDoc = tmi.createTaskInstance(doCompilaDocumento, token);
|
| // set the name of the task, the actor that this task is assigned to, and set the creation date
| tCompDoc.setName("consulta: convocazione " + user);
| tCompDoc.setActorId(user);
| tCompDoc.setCreate(token.getEnd());
|
| // build a variable
| tCompDoc.setVariableLocally("XXX"+user, "");
| // bind the newly created task instance to the task.
| tmi.addTaskInstance(tCompDoc);
| // print some outputs
| System.out.println("***********************************************************************");
| System.out.println("creato: " + tCompDoc);
| System.out.println("***********************************************************************");
| } catch (Exception ex)
| {
| ex.printStackTrace();
| }
| }
|
| }
|
What you say about the fork is correct, I think. But Actually I don't know how to bind the newly created task instance to the rest of the process.
Infact the code that create the task doesn't do this.
Any idea on this?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4138781#4138781
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4138781
18 years, 1 month