5 Replies Latest reply on Oct 24, 2011 12:21 PM by swiderski.maciej

    jBPM 5.1, OpenJPA and WebSphere 7

    trjiii

      I am working on trying to use jBPM 5.1 on Websphere 7 which uses OpenJPA as its default JPA persistence provider.  Unfortunately, the client is not allowing us to use Hibernate so I need to be able to use OpenJPA with jBPM 5.1.  Has anyone tried to do this?

       

      Thanks in advance for any information!

       

      Thomas

        • 1. Re: jBPM 5.1, OpenJPA and WebSphere 7
          trjiii

          Ok so no one is using all three.  Is there anyone who is using jBPM 5.1 along with OpenJPA? 

          • 2. Re: jBPM 5.1, OpenJPA and WebSphere 7
            salaboy21

            Not that I know, but are you having issues? let us know and we can work on fix thos eissues to support OpenJPA, it should be so difficult.

            Cheers

            • 3. Re: jBPM 5.1, OpenJPA and WebSphere 7
              trjiii

              Thanks Mauricio.  Yes I am having some issues.  Some of them I have been able to work around and some have me completely stuck. 

               

              I broke trying to use OpenJPA this into two parts.  First I tried to get Process Information to persist.  After that I tried to get the Human Tasks to persist. 

               

              First, when I tried to get the Process information persisted, I ran into my first problem.  In JpaProcessPersistenceContext.getProcessInstancesWaitingForEvent, there is a call to the ProcessInstanceWaitingForEvent named query.  This named query contains a Hibernate specific keyword in the query itself, "elements".  I went back and look at the ProcessInstanceInfo class and noticed that it has a Hibernate Specific annotation that is being used(@CollectionOfElements).  This functionality is not available in JPA 1.0.  In JPA 2.0 , they added a @ElementCollection annotation that is similar but I still do not think JPQL will support the "elements" keyword as it is HQL.  I could work around this issue by changing the named query to just return all the ProcessInstanceInfo objects and loop through them in getProcessInstancesWaitingForEvent and verify whether or not the supplied type is in the eventTypes set and capture the ID in an array list(I would not suggest this for a production environment but it suffices for testing).  Once I did that, recompiled and re-jared everything, the Process information(session, workitem, etc) seem to persist fine.

               

              The next part I tried to tackle was trying to get Human Tasks to work with OpenJPA.  I have run at least two issues when dealing with trying to get Tasks to work with OpenJPA.  First, some of the classes(don't have the list in front of me) were runtime enhanced and IBM in their infinite wisdom WAS switched off dynamic runtime enhancement by default so the EntityManager wouldn't load. I exploded the JAR and ran the runtime enhancement against the .class files and went to load again.  Now I have run into mapping trouble...I am currently receiving the followin exception when I try to run the application.  It seems to be barfing on the Deadlines property in the Task class.  If you have any ideas I would appreciate the help.  I am currently running inside WAS with Db2 as the database but am trying to reproduce in a standalone application...

               

              Thanks for any help you can provide!

               

              Caused by: <openjpa-1.2.3-SNAPSHOT-r422266:965640 fatal user error> org.apache.openjpa.persistence.ArgumentException: You have supplied columns for "org.jbpm.task.Task.deadlines.org.jbpm.task.Deadlines.endDeadlines", but this mapping cannot have columns in this context.

                    at org.apache.openjpa.jdbc.meta.MappingInfo.assertNoSchemaComponents(MappingInfo.java:327)

                    at org.apache.openjpa.jdbc.meta.strats.RelationToManyTableFieldStrategy.map(RelationToManyTableFieldStrategy.java:96)

                    at org.apache.openjpa.jdbc.meta.strats.RelationCollectionTableFieldStrategy.map(RelationCollectionTableFieldStrategy.java:94)

                    at org.apache.openjpa.jdbc.meta.FieldMapping.setStrategy(FieldMapping.java:121)

                    at org.apache.openjpa.jdbc.meta.RuntimeStrategyInstaller.installStrategy(RuntimeStrategyInstaller.java:80)

                    at org.apache.openjpa.jdbc.meta.FieldMapping.resolveMapping(FieldMapping.java:454)

                    at org.apache.openjpa.jdbc.meta.FieldMapping.resolve(FieldMapping.java:419)

                    at org.apache.openjpa.jdbc.meta.ClassMapping.resolveMapping(ClassMapping.java:840)

                    at org.apache.openjpa.meta.ClassMetaData.resolve(ClassMetaData.java:1647)

                    at org.apache.openjpa.jdbc.meta.ValueMappingImpl.resolve(ValueMappingImpl.java:474)

                    at org.apache.openjpa.jdbc.meta.strats.EmbedFieldStrategy.map(EmbedFieldStrategy.java:107)

                    at org.apache.openjpa.jdbc.meta.FieldMapping.setStrategy(FieldMapping.java:121)

                    at org.apache.openjpa.jdbc.meta.RuntimeStrategyInstaller.installStrategy(RuntimeStrategyInstaller.java:80)

                    at org.apache.openjpa.jdbc.meta.FieldMapping.resolveMapping(FieldMapping.java:454)

                    at org.apache.openjpa.jdbc.meta.FieldMapping.resolve(FieldMapping.java:419)

                    at org.apache.openjpa.jdbc.meta.ClassMapping.resolveMapping(ClassMapping.java:840)

                    at org.apache.openjpa.meta.ClassMetaData.resolve(ClassMetaData.java:1647)

                    at org.apache.openjpa.meta.MetaDataRepository.processBuffer(MetaDataRepository.java:812)

                    at org.apache.openjpa.meta.MetaDataRepository.resolveMapping(MetaDataRepository.java:772)

                    at org.apache.openjpa.meta.MetaDataRepository.resolve(MetaDataRepository.java:650)

               

               

               

               

               

               

               

               

               

              • 4. Re: jBPM 5.1, OpenJPA and WebSphere 7
                trjiii

                OK.....I upgraded to OpenJPA 2.0.3 becuase I thought these might be JPA 1.0/2.0 issues...but after rebuilding and enhancing again...I get the following...

                 

                 

                 

                 

                 

                 

                 

                 

                 

                 

                 

                 

                 

                 

                 

                 

                 

                 

                 

                 

                 

                 

                Caused by: <openjpa-2.0.2-SNAPSHOT-r422266:1084264 fatal user error> org.apache.openjpa.persistence.ArgumentException: You have supplied columns for "org.jbpm.task.Task.deadlines.org.jbpm.task.Deadlines.endDeadlines", but this mapping cannot have columns in this context.
                at org.apache.openjpa.jdbc.meta.MappingInfo.assertNoSchemaComponents(MappingInfo.java:382)
                at org.apache.openjpa.jdbc.meta.strats.RelationToManyTableFieldStrategy.map(RelationToManyTableFieldStrategy.java:97)
                at org.apache.openjpa.jdbc.meta.strats.RelationCollectionTableFieldStrategy.map(RelationCollectionTableFieldStrategy.java:95)
                at org.apache.openjpa.jdbc.meta.FieldMapping.setStrategy(FieldMapping.java:146)
                at org.apache.openjpa.jdbc.meta.RuntimeStrategyInstaller.installStrategy(RuntimeStrategyInstaller.java:82)
                at org.apache.openjpa.jdbc.meta.FieldMapping.resolveMapping(FieldMapping.java:496)
                at org.apache.openjpa.jdbc.meta.FieldMapping.resolve(FieldMapping.java:461)
                at org.apache.openjpa.jdbc.meta.ClassMapping.resolveMapping(ClassMapping.java:853)
                at org.apache.openjpa.meta.ClassMetaData.resolve(ClassMetaData.java:1791)
                at org.apache.openjpa.jdbc.meta.ValueMappingImpl.resolve(ValueMappingImpl.java:498)
                at org.apache.openjpa.jdbc.meta.strats.EmbedFieldStrategy.map(EmbedFieldStrategy.java:109)
                at org.apache.openjpa.jdbc.meta.FieldMapping.setStrategy(FieldMapping.java:146)
                at org.apache.openjpa.jdbc.meta.RuntimeStrategyInstaller.installStrategy(RuntimeStrategyInstaller.java:82)
                at org.apache.openjpa.jdbc.meta.FieldMapping.resolveMapping(FieldMapping.java:496)
                at org.apache.openjpa.jdbc.meta.FieldMapping.resolve(FieldMapping.java:461)
                at org.apache.openjpa.jdbc.meta.ClassMapping.resolveMapping(ClassMapping.java:853)
                at org.apache.openjpa.meta.ClassMetaData.resolve(ClassMetaData.java:1791)
                at org.apache.openjpa.meta.MetaDataRepository.processBuffer(MetaDataRepository.java:790)
                at org.apache.openjpa.meta.MetaDataRepository.resolveMapping(MetaDataRepository.java:751)
                at org.apache.openjpa.meta.MetaDataRepository.resolve(MetaDataRepository.java:631)

                Any suggestions?  Are the task entity classes tied that closely to Hibernate?

                • 5. Re: jBPM 5.1, OpenJPA and WebSphere 7
                  swiderski.maciej

                  Just a wild guess, I came across a post saying that it could be caused by entity being not listed in persistence.xml file. SOo I checked and it looks like there is a small typo in the Human Task persistence.xml file. There are duplicated entries for Deadline entity but there is no for Deadlines.

                   

                  Worth trying if that makes any difference.

                   

                  HTH