2 Replies Latest reply on Jul 12, 2007 8:41 AM by jaikiran pai

    JNDI-Lookup in Thread failed

    stefan lotties Newbie

      Hi,

      we use hibernate3 (for jbpm) in our application and we're encountering a problem with jndi. We use some scheduling-mechanism which invokes a thread which itself does something with jbpm. Anyway, because of another application server (oc4j 10.1.3) we had to set a context-classloader to all user-threads. But when we set the context-classloader to our threads jbpm is not possible to do jndi-lookups:

      org.hibernate.TransactionException: Unable to locate UserTransaction to check status
       at com.pironet.pbng.prj.cms.workflow.jbpm.CommandExecutorEventProcessor$1.doInJbpm(CommandExecutorEventProcessor.java:142)
       at com.pironet.pbng.prj.cms.workflow.jbpm.spring.JbpmTemplate$1.doInHibernate(JbpmTemplate.java:66)
       at org.springframework.orm.hibernate3.HibernateTemplate.execute(HibernateTemplate.java:372)
       at org.springframework.orm.hibernate3.HibernateTemplate.execute(HibernateTemplate.java:338)
       at com.pironet.pbng.prj.cms.workflow.jbpm.spring.JbpmTemplate.execute(JbpmTemplate.java:59)
       at com.pironet.pbng.prj.cms.workflow.jbpm.JbpmAccessor.execute(JbpmAccessor.java:52)
       at com.pironet.pbng.prj.cms.workflow.jbpm.CommandExecutorEventProcessor.processEvent(CommandExecutorEventProcessor.java:85)
       at com.pironet.pbng.prj.comet.scheduling.WorkflowTimelineEventHandler.processEvent(WorkflowTimelineEventHandler.java:68)
       at com.pironet.pbng.messaging.notify.NotifierImpl.issueEvent(NotifierImpl.java:212)
       at com.pironet.pbng.messaging.notify.NotifierForwarder$1.run(NotifierForwarder.java:95)
      Caused by: javax.naming.NameNotFoundException: UserTransaction not bound
       at org.jnp.server.NamingServer.getBinding(NamingServer.java:529)
       at org.jnp.server.NamingServer.getBinding(NamingServer.java:537)
       at org.jnp.server.NamingServer.getObject(NamingServer.java:543)
       at org.jnp.server.NamingServer.lookup(NamingServer.java:267)
       at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:625)
       at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:716)
       at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:587)
       at javax.naming.InitialContext.lookup(InitialContext.java:347)
       at org.hibernate.transaction.JTATransactionFactory.isTransactionInProgress(JTATransactionFactory.java:98)
       at org.hibernate.jdbc.JDBCContext.isTransactionInProgress(JDBCContext.java:187)
       at org.hibernate.impl.SessionImpl.isTransactionInProgress(SessionImpl.java:369)
       at org.hibernate.impl.SessionImpl.autoFlushIfRequired(SessionImpl.java:962)
       at org.hibernate.impl.SessionImpl.iterate(SessionImpl.java:1188)
       at org.hibernate.impl.QueryImpl.iterate(QueryImpl.java:46)
       at org.jbpm.db.MessagingSession.getMessageIterator(MessagingSession.java:118)
       at org.jbpm.db.MessagingSession.hasNextMessage(MessagingSession.java:56)
       at com.pironet.pbng.prj.cms.workflow.jbpm.CommandExecutorEventProcessor$1.doInJbpm(CommandExecutorEventProcessor.java:100)
       ... 9 more
      


      we use this name to lookup: java:comp/UserTransaction

      If we remove the setting of a context-classloader everything works fine (in jboss, but not in oc4j 10.1.3). Do I have to change the name to lookup in some way? Or even something in some jboss-configuration?

      thanks,
      stefan