8 Replies Latest reply on Sep 15, 2008 11:58 AM by xalperte

    jBPM 3.2.1 on AS 4.2.1

    angelo.dangelo

      Hi,
      I deployed jbpm-enterprise (3.2.1) application on AS 4.2.1, following DeployJbpm3.2WebAppUnderJBoss4.2.x wiki page.
      But, after logged in the web-console, I have the following error on the web page:

      Error loading process list:
      An exception of type "org.hibernate.InvalidMappingException" was thrown.
      The message is: Could not parse mapping document from resource
      org/jbpm/graph/def/Node.hbm.xml

      How can I solve this problem?
      Thanks
      Angelo

        • 1. Re: jBPM 3.2.1 on AS 4.2.1
          mputz

          Angelo,

          the steps outlined at http://wiki.jboss.org/wiki/Wiki.jsp?page=DeployJbpm3.2WebAppUnderJBoss4.2.x only applied to jBPM 3.2.GA until now.

          I have just added some additional information regarding jBPM 3.2.1 - please check these out and let us know if that worked for you.

          Thanks!

          • 2. Re: jBPM 3.2.1 on AS 4.2.1
            angelo.dangelo

            Martin,
            I didn't build jbpm-console from source but I only replaced the libraries and now it works fine.
            Thank you!

            ...another question:
            Now I'm using hypersonic database, but I would use Oracle 10.
            Where I can find the scripts for oracle db? What are the steps I have to do?

            Thank you in advance.
            Angelo

            • 3. Re: jBPM 3.2.1 on AS 4.2.1
              mputz

              Angelo,

              good to hear that it's working now.

              Now on to the move to Oracle ;-)

              First, please have a look at Chapter 8 of the docu for a general overview of the necessary steps for switching the database backend:
              http://docs.jboss.com/jbpm/v3.2/userguide/html/thejbpmdatabase.html
              (Please note that the user guide is sometimes still referring to the 3.1 version and contains therefore outdated path references!)

              The steps in short are the following:
              1.) create the db schema
              2.) deploy the appropriate *-ds.xml datasource configuration file
              3.) copy the db driver to the server/your_config/lib folder
              4.) tell hibernate which db you are using by updating jbpm-enterprise.ear/lib/jbpm-configs.jar/hibernate.cfg.xml with the correct hibernate.dialect property value

              Regarding step 1.), the scripts for different databases including Oracle can be found in the jbpm-jpdl-3.2.1/db folder - for Oracle it's the file 'jbpm.jpdl.oracle.sql'. (If you were using jBPM 3.2.GA then the ddl statements for the tables for the identity components are missing in this file, however. This has been changed recently so if you checked out the latest version from CVS or work with 3.2.1 you should be fine and get a script which contains the create statements for all tables.)

              In order to execute this start sqlplus with a user with sufficient privileges and invoke '@<path-to-file>/jbpm.jpdl.oracle.sql'.

              After that you might want to insert the test users to play around; here are the relevant sql statements for this:

              INSERT INTO JBPM_ID_GROUP VALUES(1,'G','sales','organisation',NULL);
              INSERT INTO JBPM_ID_GROUP VALUES(2,'G','admin','security-role',NULL);
              INSERT INTO JBPM_ID_GROUP VALUES(3,'G','user','security-role',NULL);
              INSERT INTO JBPM_ID_GROUP VALUES(4,'G','hr','organisation',NULL);
              INSERT INTO JBPM_ID_GROUP VALUES(5,'G','manager','security-role',NULL);
              INSERT INTO JBPM_ID_USER VALUES(1,'U','user','user@sample.domain','user');
              INSERT INTO JBPM_ID_USER VALUES(2,'U','manager','manager@sample.domain','manager');
              INSERT INTO JBPM_ID_USER VALUES(3,'U','admin','admin@sample.domain','admin');
              INSERT INTO JBPM_ID_USER VALUES(4,'U','shipper','shipper@sample.domain','shipper');
              INSERT INTO JBPM_ID_MEMBERSHIP VALUES(1,'M',NULL,NULL,2,4);
              INSERT INTO JBPM_ID_MEMBERSHIP VALUES(2,'M',NULL,NULL,3,4);
              INSERT INTO JBPM_ID_MEMBERSHIP VALUES(3,'M',NULL,NULL,4,4);
              INSERT INTO JBPM_ID_MEMBERSHIP VALUES(4,'M',NULL,NULL,4,3);
              INSERT INTO JBPM_ID_MEMBERSHIP VALUES(5,'M',NULL,NULL,1,3);
              INSERT INTO JBPM_ID_MEMBERSHIP VALUES(6,'M',NULL,NULL,2,3);
              INSERT INTO JBPM_ID_MEMBERSHIP VALUES(7,'M',NULL,NULL,3,3);
              INSERT INTO JBPM_ID_MEMBERSHIP VALUES(8,'M',NULL,NULL,3,2);
              INSERT INTO JBPM_ID_MEMBERSHIP VALUES(9,'M',NULL,NULL,2,2);
              INSERT INTO JBPM_ID_MEMBERSHIP VALUES(10,'M',NULL,NULL,2,5);
              INSERT INTO JBPM_ID_MEMBERSHIP VALUES(11,'M',NULL,'boss',2,1);
              INSERT INTO JBPM_ID_MEMBERSHIP VALUES(12,'M',NULL,NULL,1,1);


              • 4. Re: jBPM 3.2.1 on AS 4.2.1
                angelo.dangelo

                Martin, it is OK!
                Thank you.

                • 5. Re: jBPM 3.2.1 on AS 4.2.1
                  mputz

                  Great! You're welcome.

                  Enjoy working with jBPM! Cheers!

                  • 6. Re: jBPM 3.2.1 on AS 4.2.1
                    ansantharam

                    I built the jbpm-bpel.war file from jbpm-bpel-1.1.GA src, it works fine if i deploy it to Jboss 4.2.2GA and fails in JBoss portal 2.6.4GA with the following error.

                    org.hibernate.InvalidMappingException: Could not parse mapping document from resource org/jbpm/graph/def/Node.
                    hbm.xml

                    Any help is greatly appreciated.

                    • 7. Re: jBPM 3.2.1 on AS 4.2.1
                      xalperte

                       

                      "ansantharam" wrote:
                      I built the jbpm-bpel.war file from jbpm-bpel-1.1.GA src, it works fine if i deploy it to Jboss 4.2.2GA and fails in JBoss portal 2.6.4GA with the following error.

                      org.hibernate.InvalidMappingException: Could not parse mapping document from resource org/jbpm/graph/def/Node.
                      hbm.xml

                      Any help is greatly appreciated.


                      I'm having the same problem. When I deploy the enterprise.ear file in a JBoss AS 4.2.2.GA + JBoss Portal 2.6.5.SP1, at login time, the Console informs that "org.hibernate.InvalidMappingException: Could not parse mapping document from resource org/jbpm/graph/def/Node.hbm.xml".

                      The Hibernate files of my instalation has been upgraded to the new ones:
                      Hibernate3 3.2.6.ga
                      Hibernate EntityManager 3.3.2.GA
                      Hibernate Anotations 3.3.1.GA
                      Hibernate Commons Annotations 3.0.0.GA
                      Hibernate Validator 3.0.0.GA
                      EHCache 1.3.0


                      The login-config.xml of the JBoss AS has already been modified to add the "jbpm" application-policy.

                      My hibernate.cfg.xml file looks like: (also the User/Group/Membership entities has been uncommented)
                       <!-- hibernate dialect -->
                       <property name="hibernate.dialect">org.hibernate.dialect.MySQLInnoDBDialect</property>
                      
                       <property name="hibernate.cache.provider_class">org.hibernate.cache.HashtableCacheProvider</property>
                      
                       <!-- DataSource properties (begin) -->
                       <property name="hibernate.connection.datasource">java:/JbpmDS</property>
                       <!-- DataSource properties (end) -->
                      
                       <!-- JTA transaction properties (begin) -->
                       <property name="hibernate.transaction.factory_class">org.hibernate.transaction.JTATransactionFactory</property>
                       <property name="hibernate.transaction.manager_lookup_class">org.hibernate.transaction.JBossTransactionManagerLookup</property>
                      


                      My jbpm.cfg.xml looks like:
                      <jbpm-configuration>
                      
                       <!--
                       The default configurations can be found in org/jbpm/default.jbpm.cfg.xml
                       Those configurations can be overwritten by putting this file called
                       jbpm.cfg.xml on the root of the classpath and put in the customized values.
                       -->
                      
                       <jbpm-context>
                       <service name="persistence" factory="org.jbpm.persistence.jta.JtaDbPersistenceServiceFactory" />
                       <service name="message" factory="org.jbpm.msg.jms.JmsMessageServiceFactoryImpl" />
                       <service name="scheduler" factory="org.jbpm.scheduler.ejbtimer.EntitySchedulerServiceFactory" />
                       <service name="tx" factory="org.jbpm.tx.TxServiceFactory" />
                       <service name="logging" factory="org.jbpm.logging.db.DbLoggingServiceFactory" />
                       <service name="authentication" factory="org.jbpm.security.authentication.DefaultAuthenticationServiceFactory" />
                       </jbpm-context>
                      
                       <!-- configuration property used by persistence service impl org.jbpm.persistence.db.DbPersistenceServiceFactory -->
                       <string name="resource.hibernate.cfg.xml" value="hibernate.cfg.xml" />
                      
                       <!-- configuration resource files pointing to default configuration files in jbpm-jpdl.jar -->
                       <string name="resource.business.calendar" value="org/jbpm/calendar/jbpm.business.calendar.properties" />
                       <string name="resource.default.modules" value="org/jbpm/graph/def/jbpm.default.modules.properties" />
                       <string name="resource.converter" value="org/jbpm/db/hibernate/jbpm.converter.properties" />
                       <string name="resource.action.types" value="org/jbpm/graph/action/action.types.xml" />
                       <string name="resource.node.types" value="org/jbpm/graph/node/node.types.xml" />
                       <string name="resource.parsers" value="org/jbpm/jpdl/par/jbpm.parsers.xml" />
                       <string name="resource.varmapping" value="org/jbpm/context/exe/jbpm.varmapping.xml" />
                       <string name="resource.mail.templates" value="jbpm.mail.templates.xml" />
                      
                       <int name="jbpm.byte.block.size" value="1024" singleton="true" />
                       <string name="jbpm.mail.smtp.host" value="localhost" />
                       <bean name="jbpm.task.instance.factory" class="org.jbpm.taskmgmt.impl.DefaultTaskInstanceFactoryImpl" singleton="true" />
                       <bean name="jbpm.variable.resolver" class="org.jbpm.jpdl.el.impl.JbpmVariableResolver" singleton="true" />
                       <bean name="jbpm.mail.address.resolver" class="org.jbpm.identity.mail.IdentityAddressResolver" singleton="true" />
                      
                       <!-- note that the default job executor needs to be overwritten with a null value -->
                       <null name="jbpm.job.executor" />
                      
                      </jbpm-configuration>
                      


                      I don't know exactly what's the problem, no information is given by the error and no messages are shown in the server.log file.

                      Thanks in advance!
                      Javier


                      • 8. Re: jBPM 3.2.1 on AS 4.2.1
                        xalperte

                        Well, it seems that i found the problem. The JBoss Portal has a module to manage the "CMS Approval" and "User Registration" as a jBPM processes. That module initializes and exposes the jBPM as a MBean service inside the portal.

                        Looking inside the "jboss-portal.sar/portal-workflow.sar/META-INF/jboss-services.xml" there are not way to configure those services in order to use the EJBs registered in the enterprise.ear file of the jPDL Distribution. I think that the JBoss Portal team could improve that behaviour in order to allow define and manage processes through the standard jbpm-console, and also share the BPM System with other applications.

                        Well, i'm going to do the following tasks and when I finish I will publish the results here.

                        Tasks:


                        Create a JEE maven2 project (rudder-jbpm-enterprise.ear)
                        - Add jbpm-console.war as a dependency.

                        - Add the enterprise.jar source code. We need to do that because the enterprise.jar does not exposes the JbpmConfiguration instance, needed by the Portal services.


                        Create a JAR maven2 project (to be deployed into the "server/default/jboss-portal.sar/lib directory")
                        - Implements a new version of the "portal-workflow.sar" services. Those new versions will serve as a gateway between the Portal and the "jBPM MBean" instead of initialize the jBPM as an standalone application.


                        Manual configurations:
                        - sever/default/conf/login-config.xml: modify the application-policy for the "jbpm" in order to use the Portal Users tables.
                        - jboss-portal.sar/portal-workflow.sar/META-INF/jboss-services.xml: modify the services implementation classes reference.


                        I hope this solve the problem.

                        Regards,
                        Javier