6 Replies Latest reply on Apr 4, 2011 1:50 PM by Piotr Tempes

    jbpm, process definitions, jboss - looking for knowledge

    Piotr Tempes Newbie

      Hi. I decided to write here because I am stucked with a project on my studies. I need to write an agent (java application) which would be capable of retrieving business process definitions from jboss, connect to choosen instance of the process and intercept events like process started, process ended, process made a transition from one state to another, etc so that collected data could be sent to the console written by another team member and visualised there.

       

      So I downloaded jbpm full installer and it installed everything for me, next I was able to find a lot of sample codes, but none of them worked. Those codes were ripped of it's context, so I don't have a knowledge on architecture and cofiguration of those technologies. From my research I found out that an agent in order to meet it's tasks can use for example:

       

      1. drools api - that idea came from looking into jbpm-gwt-console code. I downloaded source code from jboss/jbpm site and there I found two classes: ProcessManagement and CommandDelegate which I assume are doing exactly the thing I need to. I assume that they get ProcessDefinition from jboss through KnowledgeBase, KnowledgeAgent, etc... but I don't know how, and I am unable to run this code. I am not sure if this is a right path to folow.

       

      2. my second thought is to use JbpmContext and GraphSession class from Jbpm api but that way I got a lot of various exceptions etc... for example no query defined if I call findAllProcessDefinition etc... I am not even sure if I get the JbpmContext correctly. I don;t know from what place it gets it's configuration, dependecies, etc...

       

      Please guide my toward correct direction. What is the best way to pull from jboss deployed process definitions and than ho to monitor it's instances? What api, technologies, libraries I need? How can I configure it?

        • 1. Re: jbpm, process definitions, jboss - looking for knowledge
          Matus Majchrak Newbie

          Hi Piotr,

           

          First things first, In order to access process definitions you have to have access to the guvnor repository(or fake it as Jbpm5 demo does using -Djbpm.console.directory)

           

          KnowledgeAgent kagent = KnowledgeAgentFactory.newKnowledgeAgent("Guvnor default");
          kagent.applyChangeSet(ResourceFactory.newClassPathResource("ChangeSet.xml"));
          kagent.monitorResourceChangeEvents(false);
          KnowledgeBase kbase = kagent.getKnowledgeBase();
          
          

          ChangeSet.xml file will direct the knowledge agent to resources it should care about. For example:

           

          <change-set xmlns='http://drools.org/drools-5.0/change-set'
                      xmlns:xs='http://www.w3.org/2001/XMLSchema-instance'
                      xs:schemaLocation='http://drools.org/drools-5.0/change-set http://anonsvn.jboss.org/repos/labs/labs/jbossrules/trunk/drools-api/src/main/resources/change-set-1.0.0.xsd' >
              <add>
                  <resource source='http://localhost:8080/drools-guvnor/org.drools.guvnor.Guvnor/package/defaultPackage/LATEST' type='PKG' basicAuthentication="enabled" username="admin" password="admin" />
              </add>
          </change-set>
          

          This will tell your agent to look for your localhost's repository default package.

          Try to deploy some processes into default package so that you have something to work with: http://people.redhat.com/kverlaen/jBPM5-guvnor-integration.swf

          You can now test it by listing deployed processes:

           

          for (Process process : kbase.getProcesses()) {
               System.out.println("I found process in Guvnor: " + process.getId());
          }
          

           

          Now for the knowledgeSession.Depending on where does your application run, you have to obtain an EntityManagerFactory for drools persistence.

          See the persistence.xml in jbpm5-installers/db folder.

           

          EntityManagerFactory emf = Persistence.createEntityManagerFactory("org.drools.persistence.jpa");
          Environment env = KnowledgeBaseFactory.newEnvironment();
          env.set(EnvironmentName.ENTITY_MANAGER_FACTORY, emf);
          Properties properties = new Properties();
          properties.put("drools.processInstanceManagerFactory","org.jbpm.persistence.processinstance.JPAProcessInstanceManagerFactory");
          properties.put("drools.processSignalManagerFactory","org.jbpm.persistence.processinstance.JPASignalManagerFactory");
          KnowledgeSessionConfiguration config = KnowledgeBaseFactory.newKnowledgeSessionConfiguration(properties);
          kSession = JPAKnowledgeService.loadStatefulKnowledgeSession(1, kbase, config, env);
          

          The above code will try to load an existing Statefull knowledge session. If this does not exsit you will receive an error and you have to create a fresh kSession like this:

           

          env = KnowledgeBaseFactory.newEnvironment();
          env.set(EnvironmentName.ENTITY_MANAGER_FACTORY, emf);
          kSession = JPAKnowledgeService.newStatefulKnowledgeSession(kbase, config, env);
          

           

          And thats basicaly it. You can now get a list of processes:

           

          knowledgeSession.getKnowledgeBase().getProcesses()
          

           

          register a ProcessEventListener to intercept process lifecycle events:

           

          knowledgeSession.addEventListener(... your class implementing ProcessEventListener)
          

           

          or get list of process instances:

           

          knowledgeSession.getProcessInstances();
          

           

           

          So basicaly you have to hook up your application to guvnor to access process related resources and obtain JPA entity management factory to be able to construct or obtain knowledge session. After that, you should have all the thigs you need to fulfill your tasks.

          regards

          matus

          • 2. Re: jbpm, process definitions, jboss - looking for knowledge
            Piotr Tempes Newbie

            one hundred thanks for tutorial. Now I am struggling with access to my datasource... My goal is to reach it from standalone application. Here's what I got when I try to get through this line of code:

             

            EntityManagerFactory emf = Persistence.createEntityManagerFactory("org.drools.persistence.jpa");
            

             

            Exception in thread "main" java.lang.RuntimeException: Could not initialize stateful knowledge session: [PersistenceUnit: org.drools.persistence.jpa] Unable to build EntityManagerFactory
                at org.jbpm.integration.console.CommandDelegate.newStatefulKnowledgeSession(CommandDelegate.java:179)
                at org.jbpm.integration.console.CommandDelegate.getSession(CommandDelegate.java:187)
                at org.jbpm.integration.console.CommandDelegate.<init>(CommandDelegate.java:70)
                at org.jbpm.integration.console.CommandDelegate.main(CommandDelegate.java:293)
            Caused by: javax.persistence.PersistenceException: [PersistenceUnit: org.drools.persistence.jpa] Unable to build EntityManagerFactory
                at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:677)
                at org.hibernate.ejb.HibernatePersistence.createEntityManagerFactory(HibernatePersistence.java:126)
                at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:52)
                at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:34)
                at org.jbpm.integration.console.CommandDelegate.newStatefulKnowledgeSession(CommandDelegate.java:125)
                ... 3 more
            Caused by: org.hibernate.HibernateException: Could not find datasource
                at org.hibernate.connection.DatasourceConnectionProvider.configure(DatasourceConnectionProvider.java:79)
                at org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:137)
                at org.hibernate.ejb.InjectionSettingsFactory.createConnectionProvider(InjectionSettingsFactory.java:29)
                at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:89)
                at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:2101)
                at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1325)
                at org.hibernate.cfg.AnnotationConfiguration.buildSessionFactory(AnnotationConfiguration.java:867)
                at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:669)
                ... 7 more
            Caused by: javax.naming.CommunicationException: Receive timed out [Root exception is java.net.SocketTimeoutException: Receive timed out]
                at org.jnp.interfaces.NamingContext.discoverServer(NamingContext.java:1678)
                at org.jnp.interfaces.NamingContext.checkRef(NamingContext.java:1795)
                at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:693)
                at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:686)
                at javax.naming.InitialContext.lookup(InitialContext.java:409)
                at org.hibernate.connection.DatasourceConnectionProvider.configure(DatasourceConnectionProvider.java:75)
                ... 14 more
            Caused by: java.net.SocketTimeoutException: Receive timed out
                at java.net.PlainDatagramSocketImpl.receive0(Native Method)
                at java.net.AbstractPlainDatagramSocketImpl.receive(AbstractPlainDatagramSocketImpl.java:135)
                at java.net.DatagramSocket.receive(DatagramSocket.java:729)
                at org.jnp.interfaces.NamingContext.discoverServer(NamingContext.java:1647)
                ... 19 more
            

             

            My configuration:

            persistence.xml in eclipse:

             

            <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
            <persistence version="1.0"
                         xsi:schemaLocation="http://java.sun.com/xml/ns/persistence
                                             http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd
                                             http://java.sun.com/xml/ns/persistence/orm 
                                             http://java.sun.com/xml/ns/persistence/orm_1_0.xsd"
                         xmlns:orm="http://java.sun.com/xml/ns/persistence/orm"
                         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                         xmlns="http://java.sun.com/xml/ns/persistence">
            
              <persistence-unit name="org.drools.persistence.jpa" transaction-type="JTA">
                <provider>org.hibernate.ejb.HibernatePersistence</provider>
                <jta-data-source>DefaultDS</jta-data-source>
                <!-- <jta-data-source>jdbc:h2:tcp://localhost/~/test</jta-data-source> -->
                <class>org.jbpm.persistence.processinstance.ProcessInstanceInfo</class>
                <class>org.drools.persistence.info.SessionInfo</class>
                <class>org.drools.persistence.info.WorkItemInfo</class>
                <properties>
                  <property name="hibernate.dialect" value="org.hibernate.dialect.MySQLDialect"/>            
                  <property name="hibernate.max_fetch_depth" value="3"/>
                  <property name="hibernate.hbm2ddl.auto" value="update" />
                  <property name="hibernate.show_sql" value="false" />    
                  <property name="hibernate.transaction.manager_lookup_class" value="org.hibernate.transaction.JBossTransactionManagerLookup" />
                </properties>        
              </persistence-unit>
            
            </persistence>
            
            

             

            and hibernate.cfg.xml:

             

            <?xml version='1.0' encoding='utf-8'?>
            <!DOCTYPE hibernate-configuration PUBLIC
                    "-//Hibernate/Hibernate Configuration DTD 3.0//EN"
                    "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
            
            <hibernate-configuration>
                <session-factory>
                    <property name="connection.driver_class">com.mysql.jdbc.Driver</property>
                    <property name="connection.url">jdbc:mysql://localhost:3306/jbossdb</property>
                    <!--property name="connection.url">jdbc:h2:file:/NotBackedUp/data/mydb</property-->
                    <property name="connection.username">root</property>
                    <property name="connection.password"></property>
                    <property name="connection.pool_size">1</property>
                    <property name="dialect">org.hibernate.dialect.MySQLDialect</property>
                    <property name="current_session_context_class">thread</property>
                    <property name="cache.provider_class">org.hibernate.cache.NoCacheProvider</property>
                    <property name="show_sql">true</property>
                    <property name="hbm2ddl.auto">update</property>
                    <!-- <mapping resource="AuditLog.hbm.xml"/> -->
                </session-factory>
            </hibernate-configuration>
            

             

            and mysql-ds.xml

             

            <?xml version="1.0" encoding="UTF-8"?>
            
            <!-- See http://www.jboss.org/community/wiki/Multiple1PC for information about local-tx-datasource -->
            <!-- $Id: mysql-ds.xml 88948 2009-05-15 14:09:08Z jesper.pedersen $ -->
            <!--  Datasource config for MySQL using 3.0.9 available from:
            http://www.mysql.com/downloads/api-jdbc-stable.html
            -->
            
            <datasources>
              <local-tx-datasource>
                <jndi-name>DefaultDS</jndi-name>
                <use-java-context>false</use-java-context>
                <connection-url>jdbc:mysql://localhost:3306/jbossdb</connection-url>
                <driver-class>com.mysql.jdbc.Driver</driver-class>
                <user-name>root</user-name>
                <password></password>
                <exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.MySQLExceptionSorter</exception-sorter-class-name>
                <!-- should only be used on drivers after 3.22.1 with "ping" support
                <valid-connection-checker-class-name>org.jboss.resource.adapter.jdbc.vendor.MySQLValidConnectionChecker</valid-connection-checker-class-name>
                -->
                <!-- sql to call when connection is created
                <new-connection-sql>some arbitrary sql</new-connection-sql>
                  -->
                <!-- sql to call on an existing pooled connection when it is obtained from pool - MySQLValidConnectionChecker is preferred for newer drivers
                <check-valid-connection-sql>some arbitrary sql</check-valid-connection-sql>
                  -->
            
                <!-- corresponding type-mapping in the standardjbosscmp-jdbc.xml (optional) -->
                <metadata>
                   <type-mapping>mySQL</type-mapping>
                </metadata>
              </local-tx-datasource>
            </datasources>
            
            

             

            jboss starts without errors and exception. In addition I got message:

             

            06:07:44,421 INFO  [WrapperDataSourceService] Bound ConnectionManager 'jboss.jca:service=DataSourceBinding,name=DefaultDS' to JNDI name 'DefaultDS'
            

             

            Any idea why the datasource could not be found?

            Thanks in advance

            • 3. Re: jbpm, process definitions, jboss - looking for knowledge
              Matus Majchrak Newbie

              Hi glad that helped a bit ., regarding the problem you encounter, there might be an issue with connection to in-memory H2 instance from different JVM, Try to deploy your app as EJB module to see if it works, or you can configure jbpm to use different DB - I saw a post on the forum explaining the necessary steps(you probably have to modify the config files in jbpm-installer/db and re-run the ant install.demo)

              • 4. Re: jbpm, process definitions, jboss - looking for knowledge
                Piotr Tempes Newbie

                thanks a lot for suggestion. Now I have changed database to mysql, but the problem still remained... I found good article about changing java context to global jndi referance here:

                 

                http://www.engfers.com/2008/08/07/exposing_accessing-jboss-jndi-objects_datasources-from-an-external-jvm/

                 

                I followed instructions and only stacktrace changed:

                 

                [2011:04:92 09:04:506:info] ResourceChangeNotification created
                [2011:04:92 09:04:515:info] ResourceChangeScanner reconfigured with interval=60
                [2011:04:92 09:04:515:info] ResourceChangeScanner created with default interval=60
                [2011:04:92 09:04:515:debug] ResourceChangeNotification monitor added monitor=org.drools.io.impl.ResourceChangeScannerImpl@1cffeb4
                [2011:04:92 09:04:521:debug] KnowledgeAgent building resource map
                [2011:04:92 09:04:522:info] KnowledgeAgent created, with configuration:
                monitorChangeSetEvents=true scanResources=true scanDirectories=true newInstance=true
                [2011:04:92 09:04:531:info] KnowledgeAgent has started listening for ChangeSet notifications
                [2011:04:92 09:04:987:info] KnowledgeAgent applying ChangeSet
                [2011:04:92 09:04:994:debug] KnowledgeAgent notifier subscribing to resource=[UrlResource path='http://localhost:8080/drools-guvnor/org.drools.guvnor.Guvnor/package/defaultPackage/LATEST']
                [2011:04:92 09:04:995:debug] ResourceChangeNotification subscribing listener=org.drools.agent.impl.KnowledgeAgentImpl@155d3a3 to resource=[UrlResource path='http://localhost:8080/drools-guvnor/org.drools.guvnor.Guvnor/package/defaultPackage/LATEST']
                [2011:04:92 09:04:995:debug] ResourceChangeScanner subcribing notifier=org.drools.io.impl.ResourceChangeNotifierImpl@1b994de to resource=[UrlResource path='http://localhost:8080/drools-guvnor/org.drools.guvnor.Guvnor/package/defaultPackage/LATEST']
                [2011:04:92 09:04:995:debug] KnowledgeAgent rebuilding KnowledgeBase using ChangeSet
                [2011:04:92 09:04:119:exception]
                java.lang.RuntimeException: KnowledgeAgent exception while trying to deserialize KnowledgeDefinitionsPackage  
                    at org.drools.agent.impl.KnowledgeAgentImpl.createPackageFromResource(KnowledgeAgentImpl.java:732)
                    at org.drools.agent.impl.KnowledgeAgentImpl.addResourcesToKnowledgeBase(KnowledgeAgentImpl.java:965)
                    at org.drools.agent.impl.KnowledgeAgentImpl.rebuildResources(KnowledgeAgentImpl.java:774)
                    at org.drools.agent.impl.KnowledgeAgentImpl.buildKnowledgeBase(KnowledgeAgentImpl.java:646)
                    at org.drools.agent.impl.KnowledgeAgentImpl.applyChangeSet(KnowledgeAgentImpl.java:190)
                    at org.drools.agent.impl.KnowledgeAgentImpl.applyChangeSet(KnowledgeAgentImpl.java:172)
                    at org.jbpm.integration.console.CommandDelegate.newStatefulKnowledgeSession(CommandDelegate.java:78)
                    at org.jbpm.integration.console.CommandDelegate.getSession(CommandDelegate.java:187)
                    at org.jbpm.integration.console.CommandDelegate.<init>(CommandDelegate.java:70)
                    at org.jbpm.integration.console.CommandDelegate.main(CommandDelegate.java:293)
                Caused by: java.io.FileNotFoundException: http://localhost:8080/drools-guvnor/org.drools.guvnor.Guvnor/package/defaultPackage/LATEST
                    at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1401)
                    at org.drools.io.impl.UrlResource.grabStream(UrlResource.java:210)
                    at org.drools.io.impl.UrlResource.getInputStream(UrlResource.java:146)
                    at org.drools.agent.impl.KnowledgeAgentImpl.createPackageFromResource(KnowledgeAgentImpl.java:720)
                    ... 9 more
                [2011:04:92 09:04:122:debug] KnowledgeAgent obtaining pkg resource=[UrlResource path='http://localhost:8080/drools-guvnor/org.drools.guvnor.Guvnor/package/defaultPackage/LATEST']
                [2011:04:92 09:04:123:exception]
                java.lang.RuntimeException: KnowledgeAgent exception while trying to deserialize KnowledgeDefinitionsPackage  
                    at org.drools.agent.impl.KnowledgeAgentImpl.addResourcesToKnowledgeBase(KnowledgeAgentImpl.java:993)
                    at org.drools.agent.impl.KnowledgeAgentImpl.rebuildResources(KnowledgeAgentImpl.java:774)
                    at org.drools.agent.impl.KnowledgeAgentImpl.buildKnowledgeBase(KnowledgeAgentImpl.java:646)
                    at org.drools.agent.impl.KnowledgeAgentImpl.applyChangeSet(KnowledgeAgentImpl.java:190)
                    at org.drools.agent.impl.KnowledgeAgentImpl.applyChangeSet(KnowledgeAgentImpl.java:172)
                    at org.jbpm.integration.console.CommandDelegate.newStatefulKnowledgeSession(CommandDelegate.java:78)
                    at org.jbpm.integration.console.CommandDelegate.getSession(CommandDelegate.java:187)
                    at org.jbpm.integration.console.CommandDelegate.<init>(CommandDelegate.java:70)
                    at org.jbpm.integration.console.CommandDelegate.main(CommandDelegate.java:293)
                Caused by: java.lang.NullPointerException
                    at org.drools.agent.impl.KnowledgeAgentImpl.addResourcesToKnowledgeBase(KnowledgeAgentImpl.java:984)
                    ... 8 more
                [2011:04:92 09:04:125:info] KnowledgeAgent new KnowledgeBase now built and in use
                [2011:04:92 09:04:126:debug] KnowledgeAgent finished rebuilding KnowledgeBase using ChangeSet
                [2011:04:92 09:04:126:debug] KnowledgeAgent unsubscribing from resource=[UrlResource path='http://localhost:8080/drools-guvnor/org.drools.guvnor.Guvnor/package/defaultPackage/LATEST']
                [2011:04:92 09:04:126:debug] ResourceChangeNotification unsubscribing listener=org.drools.agent.impl.KnowledgeAgentImpl@155d3a3 to resource=[UrlResource path='http://localhost:8080/drools-guvnor/org.drools.guvnor.Guvnor/package/defaultPackage/LATEST']
                [2011:04:92 09:04:127:debug] ResourceChangeScanner unsubcribing notifier=org.drools.io.impl.ResourceChangeNotifierImpl@1b994de to resource=[UrlResource path='http://localhost:8080/drools-guvnor/org.drools.guvnor.Guvnor/package/defaultPackage/LATEST']
                [2011:04:92 09:04:127:debug] ResourceChangeScanner resource=[UrlResource path='http://localhost:8080/drools-guvnor/org.drools.guvnor.Guvnor/package/defaultPackage/LATEST'] now has no subscribers
                [2011:04:92 09:04:127:info] KnowledgeAgent has stopped listening for ChangeSet notifications
                jbpm.console.directory property not found
                Loading process from file system: Evaluation.bpmn
                SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
                SLF4J: Defaulting to no-operation (NOP) logger implementation
                SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
                log4j:WARN No appenders could be found for logger (org.jnp.interfaces.TimedSocketFactory).
                log4j:WARN Please initialize the log4j system properly.
                Exception in thread "main" java.lang.RuntimeException: Could not initialize stateful knowledge session: [PersistenceUnit: org.drools.persistence.jpa] Unable to build EntityManagerFactory
                    at org.jbpm.integration.console.CommandDelegate.newStatefulKnowledgeSession(CommandDelegate.java:179)
                    at org.jbpm.integration.console.CommandDelegate.getSession(CommandDelegate.java:187)
                    at org.jbpm.integration.console.CommandDelegate.<init>(CommandDelegate.java:70)
                    at org.jbpm.integration.console.CommandDelegate.main(CommandDelegate.java:293)
                Caused by: javax.persistence.PersistenceException: [PersistenceUnit: org.drools.persistence.jpa] Unable to build EntityManagerFactory
                    at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:677)
                    at org.hibernate.ejb.HibernatePersistence.createEntityManagerFactory(HibernatePersistence.java:126)
                    at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:52)
                    at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:34)
                    at org.jbpm.integration.console.CommandDelegate.newStatefulKnowledgeSession(CommandDelegate.java:125)
                    ... 3 more
                Caused by: org.hibernate.HibernateException: Could not locate TransactionManager
                    at org.hibernate.transaction.JNDITransactionManagerLookup.getTransactionManager(JNDITransactionManagerLookup.java:60)
                    at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:357)
                    at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1327)
                    at org.hibernate.cfg.AnnotationConfiguration.buildSessionFactory(AnnotationConfiguration.java:867)
                    at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:669)
                    ... 7 more
                Caused by: javax.naming.NameNotFoundException: TransactionManager not bound
                    at org.jnp.server.NamingServer.getBinding(NamingServer.java:771)
                    at org.jnp.server.NamingServer.getBinding(NamingServer.java:779)
                    at org.jnp.server.NamingServer.getObject(NamingServer.java:785)
                    at org.jnp.server.NamingServer.lookup(NamingServer.java:443)
                    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
                    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
                    at java.lang.reflect.Method.invoke(Method.java:616)
                    at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:322)
                    at sun.rmi.transport.Transport$1.run(Transport.java:177)
                    at java.security.AccessController.doPrivileged(Native Method)
                    at sun.rmi.transport.Transport.serviceCall(Transport.java:173)
                    at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:553)
                    at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:808)
                    at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:667)
                    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
                    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
                    at java.lang.Thread.run(Thread.java:636)
                    at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:273)
                    at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:251)
                    at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:160)
                    at org.jnp.server.NamingServer_Stub.lookup(Unknown Source)
                    at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:726)
                    at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:686)
                    at javax.naming.InitialContext.lookup(InitialContext.java:409)
                    at org.hibernate.transaction.JNDITransactionManagerLookup.getTransactionManager(JNDITransactionManagerLookup.java:57)
                    ... 11 more
                

                 

                do I need to configure a transactionManager somehow?

                • 5. Re: jbpm, process definitions, jboss - looking for knowledge
                  npereira Newbie

                  Hi,

                   

                  I'm having the same issue. I'm using mysql, but the same error that you are describing is happening to me to.

                   

                   

                  Regards

                  • 6. Re: jbpm, process definitions, jboss - looking for knowledge
                    Piotr Tempes Newbie

                    well I found out that transaction managers/datasources aren't remotely accesible... You need register your jndi as global jndi and acces it by http or jnp:

                     

                    http://www.engfers.com/2008/08/07/exposing_accessing-jboss-jndi-objects_datasources-from-an-external-jvm/

                     

                    and if it comes to transaction managers, I am not sure if it is possible at all:

                     

                    "While it does support propagating transaction contexts                        with remote calls, it does not support propagating                        transaction contexts to other virtual machines, so all                        transactional work must be done in the same virtual                        machine as the JBoss server."

                     

                    from:

                    http://docs.jboss.org/jbossas/jboss4guide/r1/html/ch4.chapt.html

                     

                    after all I gave up... I am now writing web application which I am going to deploy on jboss and try to connect to it via rmi or something like that.

                     

                    Good luck to you

                    btw. if you manage to do that after all please let me know how