[jboss-user] [jBPM] - Re: jBPM 5.1, OpenJPA and WebSphere 7

trjiii do-not-reply at jboss.com
Fri Oct 14 09:55:15 EDT 2011


trjiii [http://community.jboss.org/people/trjiii] created the discussion

"Re: jBPM 5.1, OpenJPA and WebSphere 7"

To view the discussion, visit: http://community.jboss.org/message/631818#631818

--------------------------------------------------------------
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)
 










--------------------------------------------------------------

Reply to this message by going to Community
[http://community.jboss.org/message/631818#631818]

Start a new discussion in jBPM at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20111014/ba655edd/attachment-0001.html 


More information about the jboss-user mailing list