8 Replies Latest reply on Jan 12, 2012 12:01 PM by pbrewer_uk

    jBPM 5.2 setup on Jboss7.1b

    pushpak1981

      Hi

       

      I have installed jBPM 5.2 on Jboss 7.1b. I modified the following files to point to my oracle 11g database.

       

      1. standalone.xml

      2. jbpm-gwt-console-server.war

           a. persistence.xml

           b. hibernate.cfg.xml

           c. JBPMorm.xml

       

      After starting the server JPA is loaded and the following error occurs:

       

       

      18:50:18,828 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-2) MSC00001: Failed to start service jboss.persistenceunit."jbpm-gwt-console-server.war#org.jbpm.persistence.jpa": org.jboss.msc.service.StartException in service jboss.persistenceunit."j

              at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1780) [jboss-msc-1.0.1.GA.jar:]

              at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885) [:1.6.0_03]

              at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907) [:1.6.0_03]

              at java.lang.Thread.run(Thread.java:619) [:1.6.0_03]

      Caused by: javax.persistence.PersistenceException: [PersistenceUnit: org.jbpm.persistence.jpa] Unable to build EntityManagerFactory

              at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:914)

              at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:890)

              at org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.java:73)

              at org.jboss.as.jpa.service.PersistenceUnitServiceImpl.createContainerEntityManagerFactory(PersistenceUnitServiceImpl.java:149)

              at org.jboss.as.jpa.service.PersistenceUnitServiceImpl.start(PersistenceUnitServiceImpl.java:79)

              at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1824) [jboss-msc-1.0.1.GA.jar:]

              at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1759) [jboss-msc-1.0.1.GA.jar:]

              ... 3 more

      Caused by: org.hibernate.MappingException: Could not determine type for: java.util.Set, at table: ProcessInstanceInfo, for columns: [org.hibernate.mapping.Column(eventTypes)]

              at org.hibernate.mapping.SimpleValue.getType(SimpleValue.java:304)

              at org.hibernate.mapping.SimpleValue.isValid(SimpleValue.java:288)

              at org.hibernate.mapping.Property.isValid(Property.java:216)

              at org.hibernate.mapping.PersistentClass.validate(PersistentClass.java:467)

              at org.hibernate.mapping.RootClass.validate(RootClass.java:268)

              at org.hibernate.cfg.Configuration.validate(Configuration.java:1287)

              at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1718)

              at org.hibernate.ejb.EntityManagerFactoryImpl.<init>(EntityManagerFactoryImpl.java:76)

              at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:905)

              ... 9 more

       

      Is there anything wrong in the configuration.

        • 1. Re: jBPM 5.2 setup on Jboss7.1b error
          salaboy21

          It looks like there is some problem with Oracle mappings in the database. Can you search here in the forums a thread that talks the changes that needs to be done to work with oracle? Cheers

          • 2. Re: jBPM 5.2 setup on Jboss7.1b error
            pushpak1981

            Thanks for the reply. Is there any table called EventTypes in JBPM5 ? I went through the code ProcessInstanceInfo it shows table join with EventTypes table.

            • 3. Re: jBPM 5.2 setup on Jboss7.1b error
              salaboy21

              It's using the org.hibernate.annotations.CollectionOfElements; annotation. + @JoinTable(name = "EventTypes", joinColumns = @JoinColumn(name = "InstanceId"))

              You should read how that annotation gets mapped into oracle.. probably that's where the solution is.. I'm pretty sure that someone else already write about that.

              Cheers

              • 4. Re: jBPM 5.2 setup on Jboss7.1b error
                dejewi

                Tony D did you solve this error?

                I have similar problem but I use postgresql database

                • 5. Re: jBPM 5.2 setup on Jboss7.1b error
                  pushpak1981

                  no i am still struggling on it to get it up and running.

                  • 6. Re: jBPM 5.2 setup on Jboss7.1b error
                    dejewi

                    I have solved it

                    I my case when I opened class ProcessInstanceInfo then my IDE start highlight @CollectionOfElements annotation in line 66.

                    So solution to my exception[1] was to add a hibernate-annotations dependency/library to my pom.xml[2]

                    I hope that will help you too

                     

                    [1] Caused by: org.hibernate.MappingException: Could not determine type for: java.util.Set, at table: ProcessInstanceInfo, for columns: [org.hibernate.mapping.Column(eventTypes)]

                     

                    [2]   <dependency>

                                <groupId>org.hibernate</groupId>

                                <artifactId>hibernate-annotations</artifactId>

                                <version>3.4.0.GA</version>

                            </dependency>

                    • 7. Re: jBPM 5.2 setup on Jboss7.1b error
                      pushpak1981

                      Hi,

                       

                      Thanks for the reply.. On which server you are trying to deploy your jBPM 5.2.

                      I went through the link http://kverlaen.blogspot.com/2011/07/jbpm5-on-as7-lightning.html

                       

                      In that its mentioned to comment the JPA subsystem in standalone.xml file. when i commented the the tables are also not getting created. i.e. the JPA is not getting loaded ?

                       

                      You mentioned regarding pom.xml file. which is the pom.xml file ? is it the file present in jbpm-gwt-console-server.war ?

                      • 8. Re: jBPM 5.2 setup on Jboss7.1b
                        pbrewer_uk

                        I had this same issue and solved it by updating the orm.xml file with the following:

                        {code:xml}

                        <?xml version="1.0" encoding="UTF-8"?>

                        <entity-mappings version="2.0" xmlns="http://java.sun.com/xml/ns/persistence/orm" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence/orm http://java.sun.com/xml/ns/persistence/orm_2_0.xsd">

                        <named-native-query name="ProcessInstancesWaitingForEvent" result-set-mapping="ProcessInstancesWaitingForEvent.mapping">

                            <query>

                            select distinct

                              p.InstanceId

                            from

                              ProcessInstanceInfo p

                            join

                              EventTypes e on p.InstanceId=e.InstanceId

                            and

                              :type = e.eventTypes

                            </query>

                        </named-native-query>

                        <sql-result-set-mapping name="ProcessInstancesWaitingForEvent.mapping">

                          <column-result name="InstanceId" />

                        </sql-result-set-mapping>

                        <entity class="org.jbpm.persistence.processinstance.ProcessInstanceInfo">

                            <attributes>

                                <element-collection name="eventTypes">

                                    <collection-table name="EventTypes">

                                        <join-column name="InstanceId" />

                                    </collection-table>

                                </element-collection>

                            </attributes>

                        </entity>

                         

                        </entity-mappings>

                        {code}

                         

                        What I'm not sure about is how to restore state once its been saved.

                         

                        HTH

                         

                        Pete