eclipse-ee4j / glassfish

Eclipse GlassFish
https://eclipse-ee4j.github.io/glassfish/
386 stars 144 forks source link

Embedded glassfish context lookup() fails with javax.naming.NamingException despite working from calling program #24548

Open Blavo opened 1 year ago

Blavo commented 1 year ago

If I deploy a very simple web app to an embedded glassfish based on glassfish-embedded-all-7.0.6.jar, and that app does a context lookup() to lookup, say, a remote EJB, the lookup will fail with a javax.naming.NamingException saying that the name is not found; this assumes that the bypass in #24541 has been applied to the calling app (otherwise the error in #24541 will occur)

Environment Details

Glassfish 7.0.6 java version "17.0.7" 2023-04-18 LTS Java(TM) SE Runtime Environment (build 17.0.7+8-LTS-224) Java HotSpot(TM) 64-Bit Server VM (build 17.0.7+8-LTS-224, mixed mode, sharing) Mac OS 12.4 Monterey Database not applicable


Problem Description

So, I have a stand alone (non-enterprise client) app. I run the app with the bypass for #24541 in place. The app does a context lookup() against some running glassfish server. This works. The app then starts glassfish embedded and deploys a very simple web app to the embedded glassfish. (Currently that app can't have any EJBs, or it won't deploy - see #24521). The app does exactly the same context lookup(). The lookup() fails saying the name isn't found. Since the lookup() already worked outside embedded glassfish it should work from within embedded glassfish.

The problem is reliably reproducible.

Steps to reproduce

1 Start a convenient glassfish that has a remote EJB for which the class definition is available in a JAR 2 Obtain the JNDI name for the remote reference to the chosen EJB from the glassfish log 3 Put that JNDI name as the value of 'lookupString' in the attached LookerUpper source 4 Compile LookerUpper as a class library 5 Compile the attached WebApp as a web application with the EJB JAR and the LookerUpper JAR in the compile class path 6 Obtain the path to the .war file produced in the above step 7 Change the value of 'warPath' in the attached TestRepeatedEmbeddedLookups source to the path from above 8 Copy the domain.xml file from the above glassfish somewhere convenient 9 Change the following ports in the copied domain XML file to avoid clashes with the running glassfish:

For extra credit

This issue probably masks another (as it was masked by #24541) - see Payara/payara #6299. Rather than wait for the solution for this one to be delivered before testing the potentially masked issue I mention it here so the two can be resolved at the same time.

To provided a test of the masked issue the reproducer for this one does 50 lookup()s , not just the one that would be enough to demonstrate the issue raised here,

The masked issue is that after 'sufficient' lookup() calls being received from the one client a server will switch to a faster, but less debuggable, implementation of the lookup. In the payara issue this 2nd implementation reliably fails with a ClassCastException. So, if after resolving the issue raised here, you find that some, but not all, of the lookup()s done by the web app succeed with the remainder failing with a ClassCastException, then you have demonstrated the masked issue (and you have a reproducer).

Impact of Issue

I intend to offer two alternate configurations of my project to my intended customers - one that runs as a remote client of a non-embedded server and (the preferred one) that runs as a client of an embedded server. I can continue development using the former but at some stage I will need a fix to this before I can resume QA of, and ship, the latter.

LookerUpper.txt StackTrace.txt WebApp.txt TestRepeatedEmbeddedLookups.txt

Blavo commented 1 year ago

G'day,

Issue #24541 was that a context lookup() from an embedded glassfish app failed on a reference to method removed at Java 9. The fix to #24541 was a new glassfish-embedded-all.jar. I expected that with the fix in place that issue would revert to this one ie that issue was masking this one (whose reproducer has a bypass for the issue in the class path). That didn't happen - the lookup() actually worked with the fix in place. That led me to wonder if the fix fixed this issue as well.

So I applied the fix to #24541 to my copy of the reproducer for this issue by substituting the supplied glassfish-embedded-all.jar for glassfish-embedded-all-7.0.6.jar and removing pfl-basic-4.1.2 from the class path. The change had no effect.

There is one obvious difference between #24541 and this issue. In the former we use a short cut - we do the lookup() from a normal Java application with an embedded-all JAR in the class path. In the past that has been reliable in reproducing errors that occur in embedded glassfish apps and simplifies the reproducer. In the reproducer for this issue we don't use the short cut - we actually deploy a very simple app to an embedded glassfish.

github-actions[bot] commented 2 months ago

This issue has been marked as inactive and old and will be closed in 7 days if there is no further activity. If you want the issue to remain open please add a comment

Blavo commented 2 months ago

G’day,

Alexander Pincuk fixed issue #24522 and made a build available to me for testing. The test was successful and I presume the fix is in line for the next build (7.0.17 ?).

The link to his build no longer works but presumably the build, or one that incorporates it, still exists.

I suggest it would be worth retrying this issue on that build since the two issues are in the same area.

Otherwise, yes, I would like the issue left open.

Ian Blavins 0408 848 548

On 22 Aug 2024, at 10:21, github-actions[bot] @.***> wrote:

This issue has been marked as inactive and old and will be closed in 7 days if there is no further activity. If you want the issue to remain open please add a comment

— Reply to this email directly, view it on GitHub https://github.com/eclipse-ee4j/glassfish/issues/24548#issuecomment-2303336654, or unsubscribe https://github.com/notifications/unsubscribe-auth/AOKL4EMMFCSCNHQTWOSCG4TZSUVH5AVCNFSM6AAAAABM5BKOUSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGMBTGMZTMNRVGQ. You are receiving this because you authored the thread.

avpinchuk commented 2 months ago

Hi @Blavo,

Try with the latest master, please:

https://ci.eclipse.org/glassfish/job/glassfish_build-and-test-using-jenkinsfile/job/master/1524/artifact/bundles/glassfish.zip https://ci.eclipse.org/glassfish/job/glassfish_build-and-test-using-jenkinsfile/job/master/1524/artifact/embedded/glassfish-embedded-all.jar

Blavo commented 2 months ago

G’day,

The problem reproducer has two parts:

Using the target libraries you supplied both parts now fail with the second part failing in a different way than expected.

Ian Blavins 0408 848 548

On 22 Aug 2024, at 16:15, Alexander Pinčuk @.***> wrote:

Hi @Blavo https://github.com/Blavo,

Try with the latest master, please:

https://ci.eclipse.org/glassfish/job/glassfish_build-and-test-using-jenkinsfile/job/master/1524/artifact/bundles/glassfish.zip https://ci.eclipse.org/glassfish/job/glassfish_build-and-test-using-jenkinsfile/job/master/1524/artifact/bundles/glassfish.zip https://ci.eclipse.org/glassfish/job/glassfish_build-and-test-using-jenkinsfile/job/master/1524/artifact/embedded/glassfish-embedded-all.jar https://ci.eclipse.org/glassfish/job/glassfish_build-and-test-using-jenkinsfile/job/master/1524/artifact/embedded/glassfish-embedded-all.jar — Reply to this email directly, view it on GitHub https://github.com/eclipse-ee4j/glassfish/issues/24548#issuecomment-2303865912, or unsubscribe https://github.com/notifications/unsubscribe-auth/AOKL4EKMARIORXVZHPRXKRLZSV6XTAVCNFSM6AAAAABM5BKOUSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGMBTHA3DKOJRGI. You are receiving this because you were mentioned.

@. ~ % java -jar "/Users/ian/Desktop/Development/ProblemReproducers/Glassfish 7/Open/GF7RemoteBeanLookup 24548/TestRepeatedEmbeddedLookups/dist/TestRepeatedEmbeddedLookups.jar" Instantiated lookerUpper Aug 26, 2024 8:48:35 PM com.sun.enterprise.v3.server.CommonClassLoaderServiceImpl findDerbyClient INFO: Cannot find javadb client jar file, derby jdbc driver will not be available by default. Set up naming context Lookup string is: java:global/TestProblem24548WebApp/CommentBeanRemote!q.simpleGF7WebAppInterfaces.CommentServiceRemote Aug 26, 2024 8:48:36 PM org.glassfish.enterprise.iiop.impl.GlassFishORBManager getORB INFO: ORB initialization succeeded: @. java.lang.Error: Could not initialize access to ClassLoader.defineClass method. at com.sun.ejb.codegen.ClassGenerator.(ClassGenerator.java:67) at com.sun.ejb.codegen.Generator.generate(Generator.java:131) at com.sun.ejb.codegen.EjbClassGeneratorFactory.generate(EjbClassGeneratorFactory.java:116) at com.sun.ejb.codegen.EjbClassGeneratorFactory.ensureGenericHome(EjbClassGeneratorFactory.java:59) at com.sun.ejb.EJBUtils.loadGeneratedGenericEJBHomeClass(EJBUtils.java:342) at com.sun.ejb.EJBUtils.lookupRemote30BusinessObject(EJBUtils.java:282) at com.sun.ejb.containers.RemoteBusinessObjectFactory.getObjectInstance(RemoteBusinessObjectFactory.java:44) at java.naming/javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:342) at com.sun.enterprise.naming.impl.SerialContext.getObjectInstance(SerialContext.java:877) at com.sun.enterprise.naming.impl.SerialContext.lookup(SerialContext.java:834) at com.sun.enterprise.naming.impl.SerialContext.lookup(SerialContext.java:257) at java.naming/javax.naming.InitialContext.lookup(InitialContext.java:409) at testrepeatedembeddedlookups.LookerUpper.lookup(LookerUpper.java:45) at testrepeatedembeddedlookups.TestRepeatedEmbeddedLookups.main(TestRepeatedEmbeddedLookups.java:34) Caused by: java.lang.reflect.InaccessibleObjectException: Unable to make protected final java.lang.Class java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int) throws java.lang.ClassFormatError accessible: module java.base does not "opens java.lang" to unnamed module @60d14f0f at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:354) at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:297) at java.base/java.lang.reflect.Method.checkCanSetAccessible(Method.java:199) at java.base/java.lang.reflect.Method.setAccessible(Method.java:193) at com.sun.ejb.codegen.ClassGenerator.lambda$static$0(ClassGenerator.java:58) at java.base/java.security.AccessController.doPrivileged(AccessController.java:569) at com.sun.ejb.codegen.ClassGenerator.(ClassGenerator.java:64) ... 13 more Lookup 1 from client failed with java.lang.Error with message Could not initialize access to ClassLoader.defineClass method. @.*** ~ %

@. ~ % java -jar "/Users/ian/Desktop/Development/ProblemReproducers/Glassfish 7/Open/GF7RemoteBeanLookup 24548/TestRepeatedEmbeddedLookups/dist/TestRepeatedEmbeddedLookups.jar" Instantiated glassfish run time Aug 26, 2024 8:50:30 PM com.sun.enterprise.v3.server.CommonClassLoaderServiceImpl findDerbyClient INFO: Cannot find javadb client jar file, derby jdbc driver will not be available by default. Instantiated glassfish server Aug 26, 2024 8:50:30 PM com.sun.enterprise.v3.services.impl.GrizzlyProxy start0 INFO: Grizzly Framework 4.0.2 started in: 14 ms - bound to [/0.0.0.0:9080] Aug 26, 2024 8:50:30 PM com.sun.enterprise.v3.services.impl.GrizzlyProxy start0 INFO: Grizzly Framework 4.0.2 started in: 0 ms - bound to [/0.0.0.0:9181] Aug 26, 2024 8:50:30 PM com.sun.enterprise.v3.services.impl.GrizzlyProxy start0 INFO: Grizzly Framework 4.0.2 started in: 0 ms - bound to [/0.0.0.0:9848] Aug 26, 2024 8:50:30 PM com.sun.enterprise.security.auth.realm.Realm doInstantiate INFO: Realm [admin-realm] of classtype [com.sun.enterprise.security.auth.realm.file.FileRealm] successfully created. Aug 26, 2024 8:50:30 PM com.sun.enterprise.security.auth.realm.Realm doInstantiate INFO: Realm [file] of classtype [com.sun.enterprise.security.auth.realm.file.FileRealm] successfully created. Aug 26, 2024 8:50:30 PM com.sun.enterprise.security.auth.realm.Realm doInstantiate INFO: Realm [certificate] of classtype [com.sun.enterprise.security.auth.realm.certificate.CertificateRealm] successfully created. Aug 26, 2024 8:50:30 PM org.glassfish.security.services.impl.authorization.AuthorizationServiceImpl initialize INFO: Authorization Service has successfully initialized. Aug 26, 2024 8:50:30 PM com.sun.enterprise.v3.services.impl.GrizzlyProxy start0 INFO: Grizzly Framework 4.0.2 started in: 0 ms - bound to [/0.0.0.0:9700] Aug 26, 2024 8:50:30 PM com.sun.enterprise.v3.server.AppServerStartup postStartupJob INFO: GlassFish (commit: null) startup time: Embedded (312 ms), startup services (270 ms), total (582 ms) Aug 26, 2024 8:50:30 PM com.sun.enterprise.connectors.jms.util.JmsRaUtil getInstalledMqVersion WARNING: Check for a new version of MQ installation failed : /var/folders/gs/rbhbh1nx6vb0gcbtg13yfjjm0000gn/T/gfembed2559384503653078658tmp/lib/install/applications/jmsra/../imqjmsra.rar:/var/folders/gs/rbhbh1nx6vb0gcbtg13yfjjm0000gn/T/gfembed2559384503653078658tmp/lib/install/applications/jmsra/imqjmsra.rar Aug 26, 2024 8:50:30 PM com.sun.enterprise.v3.services.impl.GrizzlyProxy start0 INFO: Grizzly Framework 4.0.2 started in: 0 ms - bound to [/0.0.0.0:9676] Started glassfish server Instantiated deployer Aug 26, 2024 8:50:30 PM org.glassfish.admin.mbeanserver.JMXStartupService$JMXConnectorsStarterThread startConnector INFO: JMXStartupService has started JMXConnector on JMXService URL service:jmx:rmi://192-168-1-111.tpgi.com.au:9686/jndi/rmi://192-168-1-111.tpgi.com.au:9686/jmxrmi Aug 26, 2024 8:50:30 PM org.hibernate.validator.internal.util.Version INFO: HV000001: Hibernate Validator null Aug 26, 2024 8:50:30 PM com.sun.enterprise.security.SecurityLifecycle INFO: Java security manager is disabled. Aug 26, 2024 8:50:30 PM com.sun.enterprise.security.SecurityLifecycle onInitialization INFO: Entering Security Startup Service. Aug 26, 2024 8:50:30 PM com.sun.enterprise.security.PolicyLoader loadPolicy INFO: Loading policy provider org.glassfish.exousia.modules.locked.SimplePolicyProvider. Aug 26, 2024 8:50:30 PM com.sun.enterprise.security.SecurityLifecycle onInitialization INFO: Security Service(s) started successfully. Aug 26, 2024 8:50:31 PM com.sun.enterprise.server.logging.ServerLogFileService getCurrentLogFile WARNING: The GlassFishLogHandler was not found, returning null Aug 26, 2024 8:50:31 PM com.sun.enterprise.web.WebContainer createHttpListener INFO: Created HTTP listener http-listener-1 on host/port 0.0.0.0:9080 Aug 26, 2024 8:50:31 PM com.sun.enterprise.web.WebContainer createHttpListener INFO: Created HTTP listener http-listener-2 on host/port 0.0.0.0:9181 Aug 26, 2024 8:50:31 PM com.sun.enterprise.web.WebContainer createHttpListener INFO: Created HTTP listener admin-listener on host/port 0.0.0.0:9848 Aug 26, 2024 8:50:31 PM com.sun.enterprise.web.WebContainer createHosts INFO: Created virtual server server Aug 26, 2024 8:50:31 PM com.sun.enterprise.web.WebContainer createHosts INFO: Created virtual server __asadmin Aug 26, 2024 8:50:31 PM org.apache.catalina.realm.JAASRealm setContainer INFO: Setting JAAS app name glassfish-web Aug 26, 2024 8:50:31 PM com.sun.enterprise.web.WebContainer loadSystemDefaultWebModules INFO: Virtual server server loaded default web module Aug 26, 2024 8:50:31 PM org.glassfish.web.loader.WebappClassLoader close INFO: close(), this: @.[name=TestProblem24548WebApp], urls=[ file:/private/var/folders/gs/rbhbh1nx6vb0gcbtg13yfjjm0000gn/T/gfembed2559384503653078658tmp/applications/TestProblem24548WebApp/WEB-INF/classes/ file:/private/var/folders/gs/rbhbh1nx6vb0gcbtg13yfjjm0000gn/T/gfembed2559384503653078658tmp/applications/TestProblem24548WebApp/WEB-INF/lib/TestProblem24548Interfaces.jar file:/private/var/folders/gs/rbhbh1nx6vb0gcbtg13yfjjm0000gn/T/gfembed2559384503653078658tmp/applications/TestProblem24548WebApp/WEB-INF/lib/TestProblem24548LookerUpper.jar file:/var/folders/gs/rbhbh1nx6vb0gcbtg13yfjjm0000gn/T/gfembed2559384503653078658tmp/generated/ejb/TestProblem24548WebApp/ ][delegate=true, context=TestProblem24548WebApp, status=RUNNING, antiJARLocking=false, securityManager=false, packageDefinitionSecurityEnabled=false, repositories=RepositoryManager[WEB-INF/classes/], notFound.size=46, pathTimestamps.size=5, resourceEntryCache.size=5] Aug 26, 2024 8:50:31 PM org.glassfish.api.ActionReport failure SEVERE: Exception while deploying the app [TestProblem24548WebApp] Aug 26, 2024 8:50:31 PM com.sun.enterprise.v3.server.ApplicationLifecycle deploy SEVERE: Exception during lifecycle processing java.lang.NoClassDefFoundError: org/apache/derby/client/ClientAutoloadedDriver at java.base/java.lang.ClassLoader.defineClass1(Native Method) at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1012) at java.base/java.security.SecureClassLoader.defineClass(SecureClassLoader.java:150) at java.base/jdk.internal.loader.BuiltinClassLoader.defineClass(BuiltinClassLoader.java:862) at java.base/jdk.internal.loader.BuiltinClassLoader.findClassOnClassPathOrNull(BuiltinClassLoader.java:760) at java.base/jdk.internal.loader.BuiltinClassLoader.loadClassOrNull(BuiltinClassLoader.java:681) at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:639) at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188) at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:520) at java.base/java.lang.Class.forName0(Native Method) at java.base/java.lang.Class.forName(Class.java:467) at java.sql/java.sql.DriverManager.ensureDriversInitialized(DriverManager.java:635) at java.sql/java.sql.DriverManager.drivers(DriverManager.java:440) at org.glassfish.web.loader.ReferenceCleaner.clearReferencesJdbc(ReferenceCleaner.java:95) at org.glassfish.web.loader.ReferenceCleaner.clearReferences(ReferenceCleaner.java:74) at org.glassfish.web.loader.WebappClassLoader.close(WebappClassLoader.java:1140) at org.glassfish.web.loader.WebappClassLoader.preDestroy(WebappClassLoader.java:1196) at org.glassfish.deployment.common.DeploymentContextImpl.getClassLoader(DeploymentContextImpl.java:252) at org.glassfish.deployment.common.DeploymentContextImpl.getClassLoader(DeploymentContextImpl.java:204) at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:518) at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:257) at org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:471) at com.sun.enterprise.v3.admin.CommandRunnerImpl$2$1.run(CommandRunnerImpl.java:574) at com.sun.enterprise.v3.admin.CommandRunnerImpl$2$1.run(CommandRunnerImpl.java:570) at java.base/java.security.AccessController.doPrivileged(AccessController.java:399) at java.base/javax.security.auth.Subject.doAs(Subject.java:376) at com.sun.enterprise.v3.admin.CommandRunnerImpl$2.execute(CommandRunnerImpl.java:569) at com.sun.enterprise.v3.admin.CommandRunnerImpl$3.run(CommandRunnerImpl.java:600) at com.sun.enterprise.v3.admin.CommandRunnerImpl$3.run(CommandRunnerImpl.java:592) at java.base/java.security.AccessController.doPrivileged(AccessController.java:399) at java.base/javax.security.auth.Subject.doAs(Subject.java:376) at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:591) at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1484) at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1862) at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1738) at com.sun.enterprise.admin.cli.embeddable.DeployerImpl.deploy(DeployerImpl.java:110) at testrepeatedembeddedlookups.TestRepeatedEmbeddedLookups.main(TestRepeatedEmbeddedLookups.java:66) Caused by: java.lang.ClassNotFoundException: org.apache.derby.client.ClientAutoloadedDriver at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:641) at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188) at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:520) ... 37 more

Aug 26, 2024 8:50:31 PM org.glassfish.web.loader.WebappClassLoader close INFO: close(), this: @.***[name=TestProblem24548WebApp], urls=[ file:/private/var/folders/gs/rbhbh1nx6vb0gcbtg13yfjjm0000gn/T/gfembed2559384503653078658tmp/applications/TestProblem24548WebApp/WEB-INF/classes/ file:/private/var/folders/gs/rbhbh1nx6vb0gcbtg13yfjjm0000gn/T/gfembed2559384503653078658tmp/applications/TestProblem24548WebApp/WEB-INF/lib/TestProblem24548Interfaces.jar file:/private/var/folders/gs/rbhbh1nx6vb0gcbtg13yfjjm0000gn/T/gfembed2559384503653078658tmp/applications/TestProblem24548WebApp/WEB-INF/lib/TestProblem24548LookerUpper.jar file:/var/folders/gs/rbhbh1nx6vb0gcbtg13yfjjm0000gn/T/gfembed2559384503653078658tmp/generated/ejb/TestProblem24548WebApp/ ][delegate=true, context=TestProblem24548WebApp, status=RUNNING, antiJARLocking=false, securityManager=false, packageDefinitionSecurityEnabled=false, repositories=RepositoryManager[WEB-INF/classes/], notFound.size=46, pathTimestamps.size=5, resourceEntryCache.size=5] Aug 26, 2024 8:50:31 PM org.glassfish.deployment.admin.DeployCommand execute SEVERE: org/apache/derby/client/ClientAutoloadedDriver java.lang.ClassNotFoundException: org.apache.derby.client.ClientAutoloadedDriver at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:641) at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188) at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:520) at java.base/java.lang.ClassLoader.defineClass1(Native Method) at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1012) at java.base/java.security.SecureClassLoader.defineClass(SecureClassLoader.java:150) at java.base/jdk.internal.loader.BuiltinClassLoader.defineClass(BuiltinClassLoader.java:862) at java.base/jdk.internal.loader.BuiltinClassLoader.findClassOnClassPathOrNull(BuiltinClassLoader.java:760) at java.base/jdk.internal.loader.BuiltinClassLoader.loadClassOrNull(BuiltinClassLoader.java:681) at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:639) at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188) at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:520) at java.base/java.lang.Class.forName0(Native Method) at java.base/java.lang.Class.forName(Class.java:467) at java.sql/java.sql.DriverManager.ensureDriversInitialized(DriverManager.java:635) at java.sql/java.sql.DriverManager.drivers(DriverManager.java:440) at org.glassfish.web.loader.ReferenceCleaner.clearReferencesJdbc(ReferenceCleaner.java:95) at org.glassfish.web.loader.ReferenceCleaner.clearReferences(ReferenceCleaner.java:74) at org.glassfish.web.loader.WebappClassLoader.close(WebappClassLoader.java:1140) at org.glassfish.web.loader.WebappClassLoader.preDestroy(WebappClassLoader.java:1196) at org.glassfish.deployment.common.DeploymentContextImpl.preDestroy(DeploymentContextImpl.java:164) at com.sun.enterprise.v3.server.ApplicationLifecycle$2.actOn(ApplicationLifecycle.java:311) at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:555) at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:257) at org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:471) at com.sun.enterprise.v3.admin.CommandRunnerImpl$2$1.run(CommandRunnerImpl.java:574) at com.sun.enterprise.v3.admin.CommandRunnerImpl$2$1.run(CommandRunnerImpl.java:570) at java.base/java.security.AccessController.doPrivileged(AccessController.java:399) at java.base/javax.security.auth.Subject.doAs(Subject.java:376) at com.sun.enterprise.v3.admin.CommandRunnerImpl$2.execute(CommandRunnerImpl.java:569) at com.sun.enterprise.v3.admin.CommandRunnerImpl$3.run(CommandRunnerImpl.java:600) at com.sun.enterprise.v3.admin.CommandRunnerImpl$3.run(CommandRunnerImpl.java:592) at java.base/java.security.AccessController.doPrivileged(AccessController.java:399) at java.base/javax.security.auth.Subject.doAs(Subject.java:376) at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:591) at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1484) at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1862) at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1738) at com.sun.enterprise.admin.cli.embeddable.DeployerImpl.deploy(DeployerImpl.java:110) at testrepeatedembeddedlookups.TestRepeatedEmbeddedLookups.main(TestRepeatedEmbeddedLookups.java:66)

Exception in thread "main" java.lang.RuntimeException: Failed to deploy app at testrepeatedembeddedlookups.TestRepeatedEmbeddedLookups.main(TestRepeatedEmbeddedLookups.java:68)