-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Upgrade jBPM from 5.3 to 5.4 to allow admin to view enrollments #190
Conversation
@slifty: sorry for introducing probable merge conflicts! |
Would you like to add a note to one of your commit messages saying that this fixes #171? |
@brainwane oh yeah! Thanks, I'd forgotten about that issue. |
Now that #182 is merged, this PR needs to update |
Remove the vendored jBPM and its dependencies' jars from the repo, and manage them in gradle. gradle knows how to pull in transitive dependencies, so we do not need to name them explicitly: we only need the top-level dependencies that we refer to directly, in code or in configuration. Issue #16 Manage sets of dependencies via Gradle or another tool
Use IntelliJ's Optimize Imports to enforce import layout: `import static` lines last, java and javax in the middle, and everything else first.
jBPM 5.3 doesn't play well with PostgreSQL and JPA 2: > org.postgresql.util.PSQLException: Large Objects may not be used in > auto-commit mode This was reported in issue JBPM-3763[1] and fixed in jBPM 5.4. Upgrade jBPM to 5.4, and its dependencies to the versions shipped with jBPM 5.4, to address this issue. Some APIs changed in the upgrade, and notably the persistence definition of `ProcessInstanceInfo` was moved into a separate file which we must now include in our `persistence.xml`. The schema for jBPM's entities changed, so as part of the upgrade, finally extract the schema into its own SQL file, make sure it has sensible types and keys in PostgreSQL, and delete the old schema from `legacy_seed.sql`. Update the docs to match. [1] https://issues.jboss.org/browse/JBPM-3763 Issue #1 Support PostgreSQL or other open source database Issue #171 Service administrator cannot view or approve pending enrollments
I migrated the jBPM DDL and data from |
Hmm, it fails to deploy for me:
I tested this by dropping the database, recreating it, and running:
I can deploy master with this same process, so I think it's something to do with this branch. Am I skipping a step? |
@cecilia-donnelly hm, that's very strange... that error looks like one of the errors @slifty was having during the migration from ant to gradle, before renaming things in Maybe a clean build will fix it. Will you try In the meantime, I'll try deploying on another server to see if I can reproduce this issue. |
When trying on another machine, I get this in the server log:
@cecilia-donnelly do you have something similar? |
I end up in the same place, but following a different path:
|
jBPM 5.4 pulls in more dependencies than 5.3 does, but some of them are provided by Wildfly - with a different version. These newer versions conflict with the older versions, so exclude the transitive dependencies in gradle. Issue #171 Service administrator cannot view or approve pending enrollments
It turns out that the new version of jBPM was pulling in more dependencies than the old version, and in particular it was pulling in conflicting versions of libraries provided by Wildfly. I excluded them in gradle and was able to deploy on the SGC box where I was able to reproduce this issue (I'm still not clear why it's not a problem on my laptop @cecilia-donnelly Please try this again when you have a moment! |
You can see the dependencies gradle is managing with the $ ./gradlew cms-portal-services:dependencies
------------------------------------------------------------
Project :cms-portal-services
------------------------------------------------------------
archives - Configuration for archive artifacts.
No dependencies
default - Configuration for default artifacts.
+--- project :cms-web
+--- project :cms-business-process
| +--- project :services
| +--- project :cms-business-model
| +--- org.jbpm:jbpm-human-task-core:5.4.0.Final
| | +--- org.jbpm:jbpm-workitems:5.4.0.Final
| | | +--- org.jbpm:jbpm-flow:5.4.0.Final
| | | | +--- org.drools:knowledge-api:5.5.0.Final
| | | | | \--- org.slf4j:slf4j-api:1.6.4
| | | | +--- org.drools:drools-core:5.5.0.Final
| | | | | +--- org.mvel:mvel2:2.1.3.Final
| | | | | +--- org.drools:knowledge-api:5.5.0.Final (*)
| | | | | +--- org.drools:knowledge-internal-api:5.5.0.Final
| | | | | | +--- org.drools:knowledge-api:5.5.0.Final (*)
| | | | | | \--- org.slf4j:slf4j-api:1.6.4
| | | | | \--- org.slf4j:slf4j-api:1.6.4
| | | | +--- com.google.protobuf:protobuf-java:2.4.1
| | | | \--- org.slf4j:slf4j-api:1.6.4
| | | +--- org.jbpm:jbpm-bpmn2:5.4.0.Final
| | | | +--- org.jbpm:jbpm-flow-builder:5.4.0.Final
| | | | | +--- org.jbpm:jbpm-flow:5.4.0.Final (*)
| | | | | \--- org.drools:drools-compiler:5.5.0.Final
| | | | | +--- org.drools:drools-core:5.5.0.Final (*)
| | | | | +--- org.antlr:antlr-runtime:3.3
| | | | | | \--- org.antlr:stringtemplate:3.2.1
| | | | | | \--- antlr:antlr:2.7.7
| | | | | +--- org.antlr:antlr:3.3
| | | | | | \--- org.antlr:antlr-runtime:3.3 (*)
| | | | | +--- org.antlr:stringtemplate:3.2.1 (*)
| | | | | +--- antlr:antlr:2.7.7
| | | | | +--- org.eclipse.jdt.core.compiler:ecj:3.5.1
| | | | | +--- org.mvel:mvel2:2.1.3.Final
| | | | | +--- com.thoughtworks.xstream:xstream:1.4.1
| | | | | | +--- xmlpull:xmlpull:1.1.3.1
| | | | | | \--- xpp3:xpp3_min:1.1.4c
| | | | | \--- org.slf4j:slf4j-api:1.6.4
| | | | \--- org.slf4j:slf4j-api:1.6.4
| | | +--- javax.mail:mail:1.4
| | | | \--- javax.activation:activation:1.1
| | | +--- javax.activation:activation:1.1
| | | +--- commons-io:commons-io:1.4
| | | +--- org.apache.commons:commons-compress:1.0
| | | +--- org.apache.commons:commons-exec:1.0.1
| | | +--- jivesoftware:smack:3.1.0
| | | +--- rome:rome:1.0
| | | | \--- jdom:jdom:1.0
| | | +--- commons-net:commons-net:2.0
| | | +--- jdom:jdom:1.0
| | | +--- org.slf4j:slf4j-api:1.6.4
| | | +--- wsdl4j:wsdl4j:1.6.2
| | | +--- org.apache.neethi:neethi:3.0.2
| | | | \--- org.codehaus.woodstox:woodstox-core-asl:4.0.8
| | | | +--- javax.xml.stream:stax-api:1.0-2
| | | | \--- org.codehaus.woodstox:stax2-api:3.0.2
| | | | \--- javax.xml.stream:stax-api:1.0-2
| | | \--- org.apache.ws.xmlschema:xmlschema-core:2.0.2
| | +--- org.mvel:mvel2:2.1.3.Final
| | +--- org.drools:drools-persistence-jpa:5.5.0.Final
| | | +--- org.drools:knowledge-api:5.5.0.Final (*)
| | | +--- org.drools:drools-core:5.5.0.Final (*)
| | | +--- org.drools:drools-compiler:5.5.0.Final (*)
| | | +--- com.google.protobuf:protobuf-java:2.4.1
| | | +--- dom4j:dom4j:1.6.1
| | | | \--- xml-apis:xml-apis:1.0.b2
| | | +--- org.javassist:javassist:3.14.0-GA
| | | \--- org.slf4j:slf4j-api:1.6.4
| | +--- commons-collections:commons-collections:3.2.1
| | +--- org.slf4j:slf4j-api:1.6.4
| | +--- dom4j:dom4j:1.6.1 (*)
| | \--- org.javassist:javassist:3.14.0-GA
| \--- org.jbpm:jbpm-persistence-jpa:5.4.0.Final
| +--- org.jbpm:jbpm-flow-builder:5.4.0.Final (*)
| \--- org.drools:drools-persistence-jpa:5.5.0.Final (*)
+--- org.jbpm:jbpm-human-task-core:5.4.0.Final (*)
+--- org.jbpm:jbpm-persistence-jpa:5.4.0.Final (*)
+--- project :cms-business-model
\--- project :services
deploy - Classpath for deployable modules, not transitive.
+--- project :cms-web
\--- project :cms-business-process
earlib - Classpath for module dependencies.
+--- org.jbpm:jbpm-human-task-core:5.4.0.Final
| +--- org.jbpm:jbpm-workitems:5.4.0.Final
| | +--- org.jbpm:jbpm-flow:5.4.0.Final
| | | +--- org.drools:knowledge-api:5.5.0.Final
| | | | \--- org.slf4j:slf4j-api:1.6.4
| | | +--- org.drools:drools-core:5.5.0.Final
| | | | +--- org.mvel:mvel2:2.1.3.Final
| | | | +--- org.drools:knowledge-api:5.5.0.Final (*)
| | | | +--- org.drools:knowledge-internal-api:5.5.0.Final
| | | | | +--- org.drools:knowledge-api:5.5.0.Final (*)
| | | | | \--- org.slf4j:slf4j-api:1.6.4
| | | | \--- org.slf4j:slf4j-api:1.6.4
| | | +--- com.google.protobuf:protobuf-java:2.4.1
| | | \--- org.slf4j:slf4j-api:1.6.4
| | +--- org.jbpm:jbpm-bpmn2:5.4.0.Final
| | | +--- org.jbpm:jbpm-flow-builder:5.4.0.Final
| | | | +--- org.jbpm:jbpm-flow:5.4.0.Final (*)
| | | | \--- org.drools:drools-compiler:5.5.0.Final
| | | | +--- org.drools:drools-core:5.5.0.Final (*)
| | | | +--- org.antlr:antlr-runtime:3.3
| | | | | \--- org.antlr:stringtemplate:3.2.1
| | | | | \--- antlr:antlr:2.7.7
| | | | +--- org.antlr:antlr:3.3
| | | | | \--- org.antlr:antlr-runtime:3.3 (*)
| | | | +--- org.antlr:stringtemplate:3.2.1 (*)
| | | | +--- antlr:antlr:2.7.7
| | | | +--- org.eclipse.jdt.core.compiler:ecj:3.5.1
| | | | +--- org.mvel:mvel2:2.1.3.Final
| | | | +--- com.thoughtworks.xstream:xstream:1.4.1
| | | | | +--- xmlpull:xmlpull:1.1.3.1
| | | | | \--- xpp3:xpp3_min:1.1.4c
| | | | \--- org.slf4j:slf4j-api:1.6.4
| | | \--- org.slf4j:slf4j-api:1.6.4
| | +--- javax.mail:mail:1.4
| | | \--- javax.activation:activation:1.1
| | +--- javax.activation:activation:1.1
| | +--- commons-io:commons-io:1.4
| | +--- org.apache.commons:commons-compress:1.0
| | +--- org.apache.commons:commons-exec:1.0.1
| | +--- jivesoftware:smack:3.1.0
| | +--- rome:rome:1.0
| | | \--- jdom:jdom:1.0
| | +--- commons-net:commons-net:2.0
| | +--- jdom:jdom:1.0
| | +--- org.slf4j:slf4j-api:1.6.4
| | +--- wsdl4j:wsdl4j:1.6.2
| | +--- org.apache.neethi:neethi:3.0.2
| | | \--- org.codehaus.woodstox:woodstox-core-asl:4.0.8
| | | +--- javax.xml.stream:stax-api:1.0-2
| | | \--- org.codehaus.woodstox:stax2-api:3.0.2
| | | \--- javax.xml.stream:stax-api:1.0-2
| | \--- org.apache.ws.xmlschema:xmlschema-core:2.0.2
| +--- org.mvel:mvel2:2.1.3.Final
| +--- org.drools:drools-persistence-jpa:5.5.0.Final
| | +--- org.drools:knowledge-api:5.5.0.Final (*)
| | +--- org.drools:drools-core:5.5.0.Final (*)
| | +--- org.drools:drools-compiler:5.5.0.Final (*)
| | +--- com.google.protobuf:protobuf-java:2.4.1
| | +--- dom4j:dom4j:1.6.1
| | | \--- xml-apis:xml-apis:1.0.b2
| | +--- org.javassist:javassist:3.14.0-GA
| | \--- org.slf4j:slf4j-api:1.6.4
| +--- commons-collections:commons-collections:3.2.1
| +--- org.slf4j:slf4j-api:1.6.4
| +--- dom4j:dom4j:1.6.1 (*)
| \--- org.javassist:javassist:3.14.0-GA
+--- org.jbpm:jbpm-persistence-jpa:5.4.0.Final
| +--- org.jbpm:jbpm-flow-builder:5.4.0.Final (*)
| \--- org.drools:drools-persistence-jpa:5.5.0.Final (*)
+--- project :cms-business-model
\--- project :services
(*) - dependencies omitted (listed previously)
BUILD SUCCESSFUL
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I built, deployed, and tested this change. Works for me! 💯
I don't know much about JBPM, but I think I understand everything going on in this change at least at a high level, thanks to @jasonaowen's commit messages.
When a user with the
Service Administrator
role tried to view pending enrollments, they would get an error page, and the server log would show a very long stack trace ending in:This is a bug in jBPM, and it was fixed in version 5.4!
First, move jBPM and its dependencies into gradle (thanks @slifty!). gradle knows about libraries' dependencies, and will automatically pull in such transitive dependencies. You can see this by running
Once gradle manages jBPM, it is easy to upgrade. There were a few minor API changes, so also clean up
LocalHumanTaskHandler
a bit in a separate commit before the upgrade.I was able to test this change by creating an enrollment as a provider, then logging in as the admin and viewing the enrollments! I could even reject enrollments (approving them is blocked on further Hibernate changes).
Issue #1 Support PostgreSQL or other open source database
Issue #16 Manage sets of dependencies via Gradle or another tool
Resolves #171 Service administrator cannot view or approve pending enrollments