10-10-2011 03:26 AM
<bean id="transactionManager" class="org.springframework.transaction.jta.WebSphereUowTransactionManager" />
<bean id="processEngineConfiguration" class="org.activiti.spring.SpringProcessEngineConfiguration">
<property name="transactionManager" ref="transactionManager" />
</bean>
final ProcessEngineConfiguration pec = ProcessEngineConfiguration.createProcessEngineConfigurationFromResourceDefault();
pec.setJobExecutorActivate(true);
pec.setDataSource(dataSource);
pec.setHistory(ProcessEngineConfiguration.HISTORY_FULL);
pec.setDatabaseSchemaUpdate(ProcessEngineConfiguration.DB_SCHEMA_UPDATE_TRUE);
@Resource(name = "jdbc/persistence-db")
private DataSource dataSource;
service = InitialContext.doLookup("ejblocal:" + DatabaseAccessService.class.getName());
final EntityManager em = service.getEntityManager();
em.persist(businessObject);
em.flush();
<openjpa-2.1.1-SNAPSHOT-r422266:1141200 fatal user error> org.apache.openjpa.persistence.InvalidStateException: Es konnte kein automatischer Lookup der javax.transaction.TransactionManager-Implementierung des EJB-Containers durchgeführt werden.Vergewissern Sie sich, dass die Anwendung in einem mit EJB 1.1 kompatiblen EJB-Container ausgeführt wird, und setzen Sie anschließend die Eigenschaft org.apache.openjpa.ManagedRuntime auf den entsprechenden Wert, um den TransactionManager abzurufen.
at org.apache.openjpa.ee.AutomaticManagedRuntime.getTransactionManager(AutomaticManagedRuntime.java:253)
at org.apache.openjpa.kernel.AbstractBrokerFactory.syncWithManagedTransaction(AbstractBrokerFactory.java:717)
at org.apache.openjpa.kernel.BrokerImpl.initialize(BrokerImpl.java:389)
at com.ibm.ws.persistence.kernel.WsJpaBrokerImpl.initialize(WsJpaBrokerImpl.java:306)
at org.apache.openjpa.kernel.BrokerImpl.initialize(BrokerImpl.java:323)
…
Caused by: javax.naming.ConfigurationException: A JNDI operation on a "java:" name cannot be completed because the server runtime is not able to associate the operation's thread with any J2EE application component. This condition can occur when the JNDI client using the "java:" name is not executed on the thread of a server application request. Make sure that a J2EE application does not execute JNDI operations on "java:" names within static code blocks or in threads created by that J2EE application. Such code does not necessarily run on the thread of a server application request and therefore is not supported by JNDI operations on "java:" names. [Root exception is javax.naming.NameNotFoundException: Name "comp/TransactionSynchronizationRegistry" not found in context "java:".]
at com.ibm.ws.naming.java.javaURLContextImpl.throwExceptionIfDefaultJavaNS(javaURLContextImpl.java:522)
at com.ibm.ws.naming.java.javaURLContextImpl.throwConfigurationExceptionWithDefaultJavaNS(javaURLContextImpl.java:552)
at com.ibm.ws.naming.java.javaURLContextImpl.lookupExt(javaURLContextImpl.java:481)
10-10-2011 03:56 AM
Make sure that a J2EE application does not execute JNDI operations on "java:" names within static code blocks or in threads created by that J2EE application.
10-10-2011 04:05 AM
The jobexecutor responsible for executing the timers uses a different thread than the calling thread. However, it uses the same way of starting a transaction than normal execution of the process would do. The exception states:Make sure that a J2EE application does not execute JNDI operations on "java:" names within static code blocks or in threads created by that J2EE application.
Can't you locate your service in a different way?
10-10-2011 04:13 AM
10-10-2011 09:42 AM
The thread-pool used by activiti is afaik not pluggable. However, the jobexecutor uses a ThreadPoolExecutor. You can potentially subclass the JobExecutor and add it to your ProcessEngineCOnfiguration(Impl).
Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.