Deploying app with new SpringFramework 6.0.0 web jar file get missing CDI error

I opened contact with Payara last night, but wanted to share with the Forum.

I have a very simple webapp with a Hello World servlet. It deploys fine. But, when I add the dependency for SpringFramework 6.0.0 WEB jar file, I get two errors in the Payara (most recent version) logs. I’m using Java 17.

Maven dependency:

	<dependency>
		<groupId>org.springframework</groupId>
		<artifactId>spring-web</artifactId>
	    <version>6.0.0</version>
	</dependency>

Errors:

  1. There’s a slew of these error messages:

Exception while visiting org/springframework/aot/generate/GeneratedClasses$Owner.class of size 2205
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.reflec[2022-11-18T10:29:09.444-0500] [Payara 6.2022.1] [SEVERE] [jakarta.enterprise.resource.webcontainer.faces.config] [tid: _ThreadID=176 _ThreadName=admin-thread-pool::admin-listener(2)] [timeMillis: 1668785349444] [levelValue: 1000] [[
Critical error during deployment:
java.lang.IllegalStateException: CDI is not available
at com.sun.faces.util.Util.getCdiBeanManager(Util.java:1493)
at com.sun.faces.el.ELUtils.addCDIELResolver(ELUtils.java:192)
at com.sun.faces.el.ELUtils.buildFacesResolver(ELUtils.java:164)
at com.sun.faces.application.ApplicationAssociate.initializeELResolverChains(ApplicationAssociate.java:416)
at com.sun.faces.application.applicationimpl.ExpressionLanguage.performOneTimeELInitialization(ExpressionLanguage.java:144)
at com.sun.faces.application.applicationimpl.ExpressionLanguage.getELResolver(ExpressionLanguage.java:89)
at com.sun.faces.application.ApplicationImpl.getELResolver(ApplicationImpl.java:200)
at com.sun.faces.el.ELContextImpl.(ELContextImpl.java:60)
at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:202)
at org.apache.catalina.core.StandardContext.contextListenerStart(StandardContext.java:5172)
at com.sun.enterprise.web.WebModule.contextListenerStart(WebModule.java:681)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:5750)
t.Parser.doJob(Parser.java:321)…

  1. And then a few of these:

[2022-11-18T10:29:09.444-0500] [Payara 6.2022.1] [SEVERE] [jakarta.enterprise.resource.webcontainer.faces.config] [tid: _ThreadID=176 _ThreadName=admin-thread-pool::admin-listener(2)] [timeMillis: 1668785349444] [levelValue: 1000] [[
Critical error during deployment:
java.lang.IllegalStateException: CDI is not available
at com.sun.faces.util.Util.getCdiBeanManager(Util.java:1493)
at com.sun.faces.el.ELUtils.addCDIELResolver(ELUtils.java:192)
at com.sun.faces.el.ELUtils.buildFacesResolver(ELUtils.java:164)
at com.sun.faces.application.ApplicationAssociate.initializeELResolverChains(ApplicationAssociate.java:416)
at com.sun.faces.application.applicationimpl.ExpressionLanguage.performOneTimeELInitialization(ExpressionLanguage.java:144)
at com.sun.faces.application.applicationimpl.ExpressionLanguage.getELResolver(ExpressionLanguage.java:89)
at com.sun.faces.application.ApplicationImpl.getELResolver(ApplicationImpl.java:200)
at com.sun.faces.el.ELContextImpl.(ELContextImpl.java:60)
at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:202)
at org.apache.catalina.core.StandardContext.contextListenerStart(StandardContext.java:5172)
at com.sun.enterprise.web.WebModule.contextListenerStart(WebModule.java:681)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:5750)
at com.sun.enterprise.web.WebModule.start(WebModule.java:619)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:958)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:941)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:694)
at com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:1813)
at com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:1565)
at com.sun.enterprise.web.WebApplication.start(WebApplication.java:107)
at org.glassfish.internal.data.EngineRef.start(EngineRef.java:123)
at org.glassfish.internal.data.ModuleInfo.start(ModuleInfo.java:292)
at org.glassfish.internal.data.ApplicationInfo.start(ApplicationInfo.java:361)
at com.sun.enterprise.v3.server.ApplicationLifecycle.initialize(ApplicationLifecycle.java:630)
at org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:616)