Hi Marco,

The looking up of things from java:openejb is one of those areas that needs improvement. Going to see if I can't get somewhere with that now.

I had a quick look at the JBMP docs and it looks like they support two modes, one where it runs as a standalone java application and one where it runs as a stateless ejb inside an ejb container. From the config you posted I'm guessing you're running it as a standalone application with OpenEJB embedded inside? Should be fine either way, just want to make sure I understand the goal as there are likely different options one way vs the other.

-David

On Mar 9, 2009, at 7:10 AM, <[email protected]> <[email protected] > wrote:

Hi experts,

I try to get JBPM working with openEJB. The problem is that JBPM cannot get the datasource for the hibernate session.
As far as I found out is that the JBPM uses an own InitialContext.
I try to configure the same initial context properties as for the direct initial context lookup like (part of the hibernate.cfg.xml):

<hibernate-configuration>
 <session-factory>
<property name="hibernate.connection.datasource">java:openejb/ Resource/TestDS</property>

<property name = "hibernate .jndi .java .naming .factory .initial">org.apache.openejb.client.LocalInitialContextFactory</ property> <property name="hibernate.jndi.openejb.deployments.classpath.ear">true</ property> <property name="hibernate.jndi.openejb.jndiname.format">{deploymentId}/ {interfaceType.annotationName}</property> <property name="hibernate.jndi.openejb.altdd.prefix">test</ property> <property name="hibernate.jndi.openejb.validation.output.level">VERBOSE</ property>

   ...

Also I found out the the database is registered under "java:openejb/ Resource/TestDS", where I can access it via lookup in the initial context, but it's not there as jbpm build this session.

Here also a part of the stack trace:

2009-03-09 15:03:51,334 INFO org.hibernate.util.NamingHelper:26 - JNDI InitialContext properties: {java.naming.factory.initial=org.apache.openejb.clie nt.LocalInitialContextFactory, openejb.validation.output.level=VERBOSE, openejb.altdd.prefix=test, openejb.jndiname.format={deploymentId}/{interfaceTy
pe.annotationName}, openejb.deployments.classpath.ear=true}
2009-03-09 15:03:51,334 FATAL org.hibernate.connection.DatasourceConnectionProvider:55 - Could not find datasource: java:openejb/Resource/TestDS javax.naming.NameNotFoundException: Name "java:openejb/Resource/ TestDS" not found. at org .apache.openejb.core.ivm.naming.IvmContext.federate(IvmContext.java: 172) at org.apache.openejb.core.ivm.naming.IvmContext.lookup(IvmContext.java: 129)
       at javax.naming.InitialContext.lookup(InitialContext.java:351)
at org .hibernate .connection .DatasourceConnectionProvider .configure(DatasourceConnectionProvider.java:52) at org .hibernate .connection .ConnectionProviderFactory .newConnectionProvider(ConnectionProviderFactory.java:124) at org .hibernate .connection .ConnectionProviderFactory .newConnectionProvider(ConnectionProviderFactory.java:56) at org .hibernate .cfg.SettingsFactory.createConnectionProvider(SettingsFactory.java: 414) at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java: 62) at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:2073) at org .hibernate.cfg.Configuration.buildSessionFactory(Configuration.java: 1298) at org .jbpm .persistence .db .DbPersistenceServiceFactory .getSessionFactory(DbPersistenceServiceFactory.java:105) at org .jbpm .persistence .db.DbPersistenceService.getSessionFactory(DbPersistenceService.java: 95) at org .jbpm .persistence .jta .JtaDbPersistenceService .isJtaTransactionInProgress(JtaDbPersistenceService.java:68) at org .jbpm .persistence .jta.JtaDbPersistenceService.<init>(JtaDbPersistenceService.java:46) at org .jbpm .persistence .jta .JtaDbPersistenceServiceFactory .openService(JtaDbPersistenceServiceFactory.java:66)
       at org.jbpm.svc.Services.getService(Services.java:177)
at org.jbpm.svc.Services.getPersistenceService(Services.java: 231) at org.jbpm.JbpmContext.getPersistenceService(JbpmContext.java:705)
       at org.jbpm.JbpmContext.getGraphSession(JbpmContext.java:638)


I'm using openEJB 3.1 and JBPM 3.2.5.SP2.
I hope someone knows how to use JBPM within openEJB or can give me a hint.

Regards
Marco


Reply via email to