Issue with Activiti/JPA example when using Activiti 5.20 in TomCat+MySql
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-22-2016 09:31 PM
I have slighted changed activiti-spring-jpa example that is shiped with Activiti 5.20 to use MySql.
It worked fine when using JUnit, however, when I deployed it in TomCat I got an exception
21-May-2016 23:44:05.903 SEVERE [localhost-startStop-1] org.apache.catalina.core.StandardContext.listenerStart Exception sending context initialized event to listener instance of class org.activiti.explorer.servlet.WebConfigurer
java.lang.NoClassDefFoundError: javax/persistence/ValidationMode
Steps:
a) I have created a clean TomCat 9.0 installation
b) I created a jar file containing the JPAStringTest java files and configuration files
c) I placed this jar file inside C:\Tomcat 9.0\webapps\activiti-explorer-5.20\WEB-INF\lib
d) I placed the configuration files into C:\Tomcat 9.0\webapps\activiti-explorer-5.20\WEB-INF\classes
I am attaching the exception and configuration files.
My guess is that there is a conflict between the libraries used by the example and the libraries used by activiti 5.20
It worked fine when using JUnit, however, when I deployed it in TomCat I got an exception
21-May-2016 23:44:05.903 SEVERE [localhost-startStop-1] org.apache.catalina.core.StandardContext.listenerStart Exception sending context initialized event to listener instance of class org.activiti.explorer.servlet.WebConfigurer
java.lang.NoClassDefFoundError: javax/persistence/ValidationMode
Steps:
a) I have created a clean TomCat 9.0 installation
b) I created a jar file containing the JPAStringTest java files and configuration files
c) I placed this jar file inside C:\Tomcat 9.0\webapps\activiti-explorer-5.20\WEB-INF\lib
d) I placed the configuration files into C:\Tomcat 9.0\webapps\activiti-explorer-5.20\WEB-INF\classes
I am attaching the exception and configuration files.
My guess is that there is a conflict between the libraries used by the example and the libraries used by activiti 5.20
Labels:
- Labels:
-
Archive
4 REPLIES 4
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-23-2016 02:20 AM
Hi,
Is
Regards
Martin
Is
ValidationMode
in the class path?Regards
Martin
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-25-2016 07:57 AM
The pom of the activiti-spring example indicates
<dependency>
<groupId>javax.persistence</groupId>
<artifactId>persistence-api</artifactId>
<scope>provided</scope>
</dependency>
the local Maven repository download two jars when generating activiti
javax.persistance.1.0 & javax.persistance.1.0.2
javax/persistence/ValidationMode is not available in any of these jars
Checking in the internet, I saw the following explanation:
This error occurs because JPA 1 API is brought in, but method getValidationMode exists only since JPA 2.
However, I do not know what jar would be compatible with activiti.
What puzzle me is that I am just using activiti spring example with is bundle with the distribution. It works fine when using JUnit test, but fails when deployed in TomCat inside activiti-explorer.war
Therefore, the activiti-explorer.war may be incomplete (missing a required jar, but which one should be added?)
<dependency>
<groupId>javax.persistence</groupId>
<artifactId>persistence-api</artifactId>
<scope>provided</scope>
</dependency>
the local Maven repository download two jars when generating activiti
javax.persistance.1.0 & javax.persistance.1.0.2
javax/persistence/ValidationMode is not available in any of these jars
Checking in the internet, I saw the following explanation:
This error occurs because JPA 1 API is brought in, but method getValidationMode exists only since JPA 2.
However, I do not know what jar would be compatible with activiti.
What puzzle me is that I am just using activiti spring example with is bundle with the distribution. It works fine when using JUnit test, but fails when deployed in TomCat inside activiti-explorer.war
Therefore, the activiti-explorer.war may be incomplete (missing a required jar, but which one should be added?)
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-27-2016 03:40 PM
I was finally able to find the issue 
Activiti pom's indicates (by design) that JPA, hibernate, javax, etc to have test or provided scope. Therefore, the required libraries are not included in the activiti war file. In addition, activiti pom indicates javax.persistance 1.0. Most of hibernate 4.x libraries use a new version. The issue was to find a consistent set of libraries to correctly deploy with activiti.

Activiti pom's indicates (by design) that JPA, hibernate, javax, etc to have test or provided scope. Therefore, the required libraries are not included in the activiti war file. In addition, activiti pom indicates javax.persistance 1.0. Most of hibernate 4.x libraries use a new version. The issue was to find a consistent set of libraries to correctly deploy with activiti.
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-03-2016 02:53 AM
Thanks for posting the solution you found!
