0

We are attempting to upgrade a Java maven project to Tomcat 10 and Java 17. One major issue we have encountered with this is the javax to jakarta migration. Using the Apache migration tool, we were able to convert a war file of our project and launch it successfully in the target environment (Tomcat 10/Java 17). However, this does not allow us to debug and use our maven project how we need in eclipse.

The alternative solution we were looking to implement was to convert just the jars that were causing issues using the migration tool, and include them locally in our project. The two jars referenced are the Activit-engine and Activiti-spring jars (and their dependencies). I have converted these jars, confirmed that they no longer have javax references, and included them in both the build and classpath. However, when launching the server, I am still receiving the following error:

SEVERE: Exception sending context initialized event to listener instance of class [org.springframework.web.context.ContextLoaderListener]
org.springframework.beans.factory.CannotLoadBeanClassException: Error loading class [org.activiti.spring.SpringProcessEngineConfiguration] for bean with name 'processEngineConfiguration' defined in class path resource [coreActiviti.xml]: problem with class file or dependent class
    at org.springframework.beans.factory.support.AbstractBeanFactory.resolveBeanClass(AbstractBeanFactory.java:1508)
 ...
    at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractAppljava.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:568)
    at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:347)
    at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:478)
Caused by: java.lang.NoClassDefFoundError: org/springframework/context/ApplicationContextAware
    at java.base/java.lang.ClassLoader.defineClass1(Native Method)
    at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1012)

Through verbose logging, I was able to see that that class is in fact being loaded too. [6.211s][info][class,load] org.springframework.context.ApplicationContextAware source: file:/opt/eclipse-workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp3/wtpwebapps/coreCopy/WEB-INF/lib/spring-context-6.0.6.jar

Some of the pom.xml configuration:

<dependency>
            <groupId>org.activiti</groupId>
            <artifactId>activiti-engine</artifactId>
            <version>7.2.0</version>
            <scope>system</scope>
            <systemPath>${activiti.enginepath}</systemPath>
            <exclusions>
                <exclusion>
                    <groupId>de.odysseus.juel</groupId>
                    <artifactId>juel-api</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>de.odysseus.juel</groupId>
                    <artifactId>juel-spi</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>javax.el</groupId>
                    <artifactId>javax.el-api</artifactId>
                </exclusion>
                <exclusion>
                    <artifactId>tomcat-jasper</artifactId>
                    <groupId>org.apache.tomcat</groupId>
                </exclusion>
                <exclusion>
                    <artifactId>commons-lang3</artifactId>
                    <groupId>org.apache.commons</groupId>
                </exclusion>
                <exclusion>
                    <artifactId>spring-beans</artifactId>
                    <groupId>org.springframework</groupId>
                </exclusion>
                <exclusion>
                    <artifactId>jakarta.mail</artifactId>
                    <groupId>com.sun.mail</groupId>
                </exclusion>
                <exclusion>
                    <artifactId>activation</artifactId>
                    <groupId>javax.activation</groupId>
                </exclusion>
                <exclusion>
                    <artifactId>slf4j-api</artifactId>
                    <groupId>org.slf4j</groupId>
                </exclusion>
                <exclusion>
                    <artifactId>jcl-over-slf4j</artifactId>
                    <groupId>org.slf4j</groupId>
                </exclusion>
                <exclusion>
                    <groupId>joda-time</groupId>
                    <artifactId>joda-time</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>org.activiti</groupId>
            <artifactId>activiti-process-model-api</artifactId>
            <version>${activiti.version}</version>
            <scope>system</scope>
            <systemPath>${activiti.processpath}</systemPath>
            <exclusions>
                <exclusion>
                    <groupId>de.odysseus.juel</groupId>
                    <artifactId>juel-api</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>de.odysseus.juel</groupId>
                    <artifactId>juel-spi</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>javax.el</groupId>
                    <artifactId>javax.el-api</artifactId>
                </exclusion>
                <exclusion>
                    <artifactId>tomcat-jasper</artifactId>
                    <groupId>org.apache.tomcat</groupId>
                </exclusion>
                <exclusion>
                    <artifactId>commons-lang3</artifactId>
                    <groupId>org.apache.commons</groupId>
                </exclusion>
                <exclusion>
                    <artifactId>spring-beans</artifactId>
                    <groupId>org.springframework</groupId>
                </exclusion>
                <exclusion>
                    <artifactId>jakarta.mail</artifactId>
                    <groupId>com.sun.mail</groupId>
                </exclusion>
                <exclusion>
                    <artifactId>activation</artifactId>
                    <groupId>javax.activation</groupId>
                </exclusion>
                <exclusion>
                    <artifactId>slf4j-api</artifactId>
                    <groupId>org.slf4j</groupId>
                </exclusion>
                <exclusion>
                    <artifactId>jcl-over-slf4j</artifactId>
                    <groupId>org.slf4j</groupId>
                </exclusion>
                <exclusion>
                    <groupId>joda-time</groupId>
                    <artifactId>joda-time</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
Cameron Grande
  • 163
  • 1
  • 10

0 Answers0