I have updated the lib and dependency of my project including :
- From OpenJDK 11 to OpenJDK 17.0.2
- From JavaEE to Jakarta 9
- From Springboot 2.7.4 to 3.0.1
The application can be built successfully, and I try to deploy it to Payara Server 6.2022.2 that running OpenJDK 17. However, the following errors are kept throwing and Spring cannot be started.
I have confirmed that the Springboot is the latest version and supports Java 17 environment. Is there any dependency missing?
My pom.xml :
<modelVersion>4.0.0</modelVersion> <parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> <version>3.0.1</version> <relativePath/> </parent> <version>1.0</version> <packaging>war</packaging> <properties> <java.version>17</java.version> <maven.compiler.source>17</maven.compiler.source> <maven.compiler.target>17</maven.compiler.target> </properties> <build> <plugins> <plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> </plugin> </plugins> </build> <dependencies> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-context</artifactId> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> <exclusions> <exclusion> <artifactId>tomcat-embed-logging-juli</artifactId> <groupId>org.apache.tomcat.embed</groupId> </exclusion> <exclusion> <artifactId>tomcat-embed-websocket</artifactId> <groupId>org.apache.tomcat.embed</groupId> </exclusion> <exclusion> <artifactId>tomcat-embed-el</artifactId> <groupId>org.apache.tomcat.embed</groupId> </exclusion> </exclusions> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-autoconfigure</artifactId> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-loader</artifactId> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-security</artifactId> </dependency> <dependency> <groupId>org.springframework.security</groupId> <artifactId>spring-security-web</artifactId> </dependency> <dependency> <groupId>org.springframework.security</groupId> <artifactId>spring-security-oauth2-resource-server</artifactId> </dependency> <dependency> <groupId>org.springframework.security</groupId> <artifactId>spring-security-oauth2-jose</artifactId> </dependency> <dependency> <groupId>jakarta.platform</groupId> <artifactId>jakarta.jakartaee-api</artifactId> <version>9.0.0</version> <type>jar</type> </dependency> </dependencies>
The content of module-info
requires jakarta.jakartaee.api; requires spring.beans; requires spring.boot; requires spring.boot.loader; requires spring.boot.autoconfigure; requires spring.context; requires spring.core; requires spring.security.config; requires spring.security.core; requires spring.security.web; requires spring.web;
The Application Class :
import com.xyz.web.application.resources.env;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
@SpringBootApplication
@EnableConfigurationProperties(env.class)
public class Application extends SpringBootServletInitializer {
public static void main(String[] args) {
SpringApplication.run(Application.class, args);
}
}
The log of Payara Server :
SEVERE: Exception while visiting org/springframework/beans/factory/aot/BeanRegistrationsAotContribution$Registration.class of size 2202 java.lang.UnsupportedOperationException: Record requires ASM8 at org.objectweb.asm.ClassVisitor.visitRecordComponent(ClassVisitor.java:305) at org.objectweb.asm.ClassReader.readRecordComponent(ClassReader.java:953) at org.objectweb.asm.ClassReader.accept(ClassReader.java:731) at org.objectweb.asm.ClassReader.accept(ClassReader.java:424) at org.glassfish.hk2.classmodel.reflect.Parser$5.on(Parser.java:336) at com.sun.enterprise.v3.server.ReadableArchiveScannerAdapter.handleEntry(ReadableArchiveScannerAdapter.java:164) at com.sun.enterprise.v3.server.ReadableArchiveScannerAdapter.onSelectedEntries(ReadableArchiveScannerAdapter.java:130) at org.glassfish.hk2.classmodel.reflect.Parser.doJob(Parser.java:321) at org.glassfish.hk2.classmodel.reflect.Parser.access$300(Parser.java:44) at org.glassfish.hk2.classmodel.reflect.Parser$3.call(Parser.java:280) at org.glassfish.hk2.classmodel.reflect.Parser$3.call(Parser.java:269) at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) at java.base/java.lang.Thread.run(Thread.java:833)
SEVERE: Exception while visiting org/springframework/boot/cloud/CloudPlatform.class of size 3703 java.lang.UnsupportedOperationException: PermittedSubclasses requires ASM9 at org.objectweb.asm.ClassVisitor.visitPermittedSubclass(ClassVisitor.java:266) at org.objectweb.asm.ClassReader.accept(ClassReader.java:706) at org.objectweb.asm.ClassReader.accept(ClassReader.java:424) at org.glassfish.hk2.classmodel.reflect.Parser$5.on(Parser.java:336) at com.sun.enterprise.v3.server.ReadableArchiveScannerAdapter.handleEntry(ReadableArchiveScannerAdapter.java:164) at com.sun.enterprise.v3.server.ReadableArchiveScannerAdapter.onSelectedEntries(ReadableArchiveScannerAdapter.java:130) at org.glassfish.hk2.classmodel.reflect.Parser.doJob(Parser.java:321) at org.glassfish.hk2.classmodel.reflect.Parser.access$300(Parser.java:44) at org.glassfish.hk2.classmodel.reflect.Parser$3.call(Parser.java:280) at org.glassfish.hk2.classmodel.reflect.Parser$3.call(Parser.java:269) at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) at java.base/java.lang.Thread.run(Thread.java:833)
SEVERE: Exception while visiting org/springframework/boot/context/config/ConfigDataNotFoundAction.class of size 1750 java.lang.UnsupportedOperationException: PermittedSubclasses requires ASM9 at org.objectweb.asm.ClassVisitor.visitPermittedSubclass(ClassVisitor.java:266) at org.objectweb.asm.ClassReader.accept(ClassReader.java:706) at org.objectweb.asm.ClassReader.accept(ClassReader.java:424) at org.glassfish.hk2.classmodel.reflect.Parser$5.on(Parser.java:336) at com.sun.enterprise.v3.server.ReadableArchiveScannerAdapter.handleEntry(ReadableArchiveScannerAdapter.java:164) at com.sun.enterprise.v3.server.ReadableArchiveScannerAdapter.onSelectedEntries(ReadableArchiveScannerAdapter.java:130) at org.glassfish.hk2.classmodel.reflect.Parser.doJob(Parser.java:321) at org.glassfish.hk2.classmodel.reflect.Parser.access$300(Parser.java:44) at org.glassfish.hk2.classmodel.reflect.Parser$3.call(Parser.java:280) at org.glassfish.hk2.classmodel.reflect.Parser$3.call(Parser.java:269) at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) at java.base/java.lang.Thread.run(Thread.java:833)
SEVERE: Exception while visiting org/springframework/boot/jdbc/DatabaseDriver.class of size 9179 java.lang.UnsupportedOperationException: PermittedSubclasses requires ASM9 at org.objectweb.asm.ClassVisitor.visitPermittedSubclass(ClassVisitor.java:266) at org.objectweb.asm.ClassReader.accept(ClassReader.java:706) at org.objectweb.asm.ClassReader.accept(ClassReader.java:424) at org.glassfish.hk2.classmodel.reflect.Parser$5.on(Parser.java:336) at com.sun.enterprise.v3.server.ReadableArchiveScannerAdapter.handleEntry(ReadableArchiveScannerAdapter.java:164) at com.sun.enterprise.v3.server.ReadableArchiveScannerAdapter.onSelectedEntries(ReadableArchiveScannerAdapter.java:130) at org.glassfish.hk2.classmodel.reflect.Parser.doJob(Parser.java:321) at org.glassfish.hk2.classmodel.reflect.Parser.access$300(Parser.java:44) at org.glassfish.hk2.classmodel.reflect.Parser$3.call(Parser.java:280) at org.glassfish.hk2.classmodel.reflect.Parser$3.call(Parser.java:269) at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) at java.base/java.lang.Thread.run(Thread.java:833)
SEVERE: Exception while visiting org/springframework/boot/convert/DurationStyle.class of size 3821 java.lang.UnsupportedOperationException: PermittedSubclasses requires ASM9 at org.objectweb.asm.ClassVisitor.visitPermittedSubclass(ClassVisitor.java:266) at org.objectweb.asm.ClassReader.accept(ClassReader.java:706) at org.objectweb.asm.ClassReader.accept(ClassReader.java:424) at org.glassfish.hk2.classmodel.reflect.Parser$5.on(Parser.java:336) at com.sun.enterprise.v3.server.ReadableArchiveScannerAdapter.handleEntry(ReadableArchiveScannerAdapter.java:164) at com.sun.enterprise.v3.server.ReadableArchiveScannerAdapter.onSelectedEntries(ReadableArchiveScannerAdapter.java:130) at org.glassfish.hk2.classmodel.reflect.Parser.doJob(Parser.java:321) at org.glassfish.hk2.classmodel.reflect.Parser.access$300(Parser.java:44) at org.glassfish.hk2.classmodel.reflect.Parser$3.call(Parser.java:280) at org.glassfish.hk2.classmodel.reflect.Parser$3.call(Parser.java:269) at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) at java.base/java.lang.Thread.run(Thread.java:833)
SEVERE: Exception while visiting org/springframework/boot/convert/PeriodStyle.class of size 3986 java.lang.UnsupportedOperationException: PermittedSubclasses requires ASM9 at org.objectweb.asm.ClassVisitor.visitPermittedSubclass(ClassVisitor.java:266) at org.objectweb.asm.ClassReader.accept(ClassReader.java:706) at org.objectweb.asm.ClassReader.accept(ClassReader.java:424) at org.glassfish.hk2.classmodel.reflect.Parser$5.on(Parser.java:336) at com.sun.enterprise.v3.server.ReadableArchiveScannerAdapter.handleEntry(ReadableArchiveScannerAdapter.java:164) at com.sun.enterprise.v3.server.ReadableArchiveScannerAdapter.onSelectedEntries(ReadableArchiveScannerAdapter.java:130) at org.glassfish.hk2.classmodel.reflect.Parser.doJob(Parser.java:321) at org.glassfish.hk2.classmodel.reflect.Parser.access$300(Parser.java:44) at org.glassfish.hk2.classmodel.reflect.Parser$3.call(Parser.java:280) at org.glassfish.hk2.classmodel.reflect.Parser$3.call(Parser.java:269) at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) at java.base/java.lang.Thread.run(Thread.java:833)