5 Replies Latest reply on Jul 29, 2008 10:59 AM by ajanz

    how to integrate commandservicebean

    ajanz

      hi,

      i installed jbpm suite 3.2.3

      i want to use the commandservicebean for my application, but i can't find it.

      what must i do to install the commandservicebean?

        • 1. Re: how to integrate commandservicebean
          salaboy21

          You must use jbpm-enterprise.ear..

          • 2. Re: how to integrate commandservicebean
            ajanz

            thats what i did.

            i copied the jbpm-enterprise.ear to the deploy directory

            but i got the following error

            10:06:33,316 WARN [ServiceController] Problem starting service jboss.j2ee:service=EjbModule, module=jbpm-enterprise.jar
            org.jboss.deployment.DeploymentException: type-mapping is not initialized: java:
            JbpmDS was not deployed or type-mapping was not configured.
            at org.jboss.ejb.plugins.cmp.jdbc.metadata.JDBCEntityMetaData.getTypeMap
            ping(JDBCEntityMetaData.java:1103)

            but in the logs appears

            10:05:59,410 INFO [ConnectionFactoryBindingService] Bound ConnectionManager 'jboss.jca:service = DataSourceBinding, name=JbpmDS' to JNDI name 'java:JbpmDS'

            where is the error?

            • 3. Re: how to integrate commandservicebean
              mputz

              Check your datasource configuration file, it must have a section for the type-mapping:

              <metadata><type-mapping>Hypersonic SQL</type-mapping></metadata>
              

              where the value matches one of the entries in server/jbpm/conf/standardjbosscmp-jdbc.xml.



              • 4. Re: how to integrate commandservicebean
                ajanz

                ok. added type mapping to the jbpm-ds

                and datasource mapping in the jbosscmp-jdbc.xml

                <jbosscmp-jdbc>
                 <defaults>
                 <datasource>java:JbpmDS</datasource>
                 <datasource-mapping>Oracle9i</datasource-mapping>
                 <create-table>false</create-table>
                 <remove-table>false</remove-table>
                 <pk-constraint>false</pk-constraint>
                 </defaults>
                 <enterprise-beans>
                 <entity>
                 <ejb-name>TimerEntityBean</ejb-name>
                 <table-name>JBPM_JOB</table-name>
                 <cmp-field>
                 <field-name>timerId</field-name>
                 <column-name>ID_</column-name>
                 </cmp-field>
                 <cmp-field>
                 <field-name>name</field-name>
                 <column-name>NAME_</column-name>
                 </cmp-field>
                 <cmp-field>
                 <field-name>tokenId</field-name>
                 <column-name>TOKEN_</column-name>
                 </cmp-field>
                 <cmp-field>
                 <field-name>processInstanceId</field-name>
                 <column-name>PROCESSINSTANCE_</column-name>
                 </cmp-field>
                 </entity>
                 </enterprise-beans>
                 </jbosscmp-jdbc>
                
                


                but now when i execute the following code
                
                
                 Object returnValue;
                 try {
                 GetProcessDefinitionsCommand cmd = new GetProcessDefinitionsCommand();
                 InitialContext initialContext = new InitialContext();
                 LocalCommandServiceHome localCommandServiceHome = (LocalCommandServiceHome) initialContext
                 .lookup("java:ejb/CommandServiceBean");
                 LocalCommandService localCommandService = localCommandServiceHome
                 .create();
                 returnValue = localCommandService.execute(cmd);
                 localCommandService.remove();
                 } catch (Exception e) {
                 e.printStackTrace();
                 throw new RuntimeException("couldn't execute command", e);
                 }
                



                i got

                13:53:20,598 ERROR [LogInterceptor] RuntimeException in method: public abstract java.lang.Object org.jbpm.command.CommandService.execute(org.jbpm.command.Command):
                org.jbpm.JbpmException: couldn't start JTA transaction

                what is now missing?

                it's now nearly two days trying to get it work.......



                • 5. Re: how to integrate commandservicebean
                  ajanz

                  ok finally made it

                  in the jbpm.cfg.xml was jta defined...dont know why or from where i got this file

                  changing it to

                  <jbpm-configuration>
                  
                   <jbpm-context>
                   <factory>
                   <service name="persistence">
                   <factory>
                  
                   <bean class="org.jbpm.persistence.db.DbPersistenceServiceFactory">
                   <field name="isCurrentSessionEnabled"><true /></field>
                   <field name="isTransactionEnabled"><false /></field>
                   </bean>
                   </factory>
                   </service>
                  


                  solved the problem...


                  really a lot things to configure....