Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FISH-8044 Avoid crashing due to FileSystemNotFound while behind a Spring boot #6448

Merged
merged 1 commit into from
Feb 3, 2024

Conversation

ctabin
Copy link
Contributor

@ctabin ctabin commented Oct 13, 2023

Hi,

We are using payara-embedded-all to deploy our application. This dependency (among) other are (re-)packaged in an überjar for the delivery.
While making some test to migrate from this überjar to spring boot, we hit the exception below while deploying our app with

Deployer earDeployer = glassfish.getDeployer();
earDeployer.deploy("myFile.ear");

This is because the URIs returned are pointing to internal jar (and hence starting with jar:<path> (for instance jar:file:/path/to/app-spring-boot.jar!/BOOT-INF/lib/mylib-1.0.0.jar!/). So, I suggest to simply ignore those in this case.

Here is the stacktrace that this PR intended to fix.

SEVERE: Exception during lifecycle processing
org.glassfish.deployment.common.DeploymentException
        at org.glassfish.javaee.full.deployment.EarDeployer.prepare(EarDeployer.java:188)
        at com.sun.enterprise.v3.server.ApplicationLifecycle.prepareModule(ApplicationLifecycle.java:1255)
        at com.sun.enterprise.v3.server.ApplicationLifecycle.prepare(ApplicationLifecycle.java:514)
        at org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:570)
        at com.sun.enterprise.v3.admin.CommandRunnerImpl$2$1.run(CommandRunnerImpl.java:556)
        at com.sun.enterprise.v3.admin.CommandRunnerImpl$2$1.run(CommandRunnerImpl.java:552)
        at java.base/java.security.AccessController.doPrivileged(AccessController.java:400)
        at java.base/javax.security.auth.Subject.doAs(Subject.java:453)
        at com.sun.enterprise.v3.admin.CommandRunnerImpl$2.execute(CommandRunnerImpl.java:551)
        at com.sun.enterprise.v3.admin.CommandRunnerImpl$3.run(CommandRunnerImpl.java:582)
        at com.sun.enterprise.v3.admin.CommandRunnerImpl$3.run(CommandRunnerImpl.java:574)
        at java.base/java.security.AccessController.doPrivileged(AccessController.java:400)
        at java.base/javax.security.auth.Subject.doAs(Subject.java:453)
        at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:573)
        at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1497)
        at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1879)
        at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1755)
        at com.sun.enterprise.admin.cli.embeddable.DeployerImpl.deploy(DeployerImpl.java:131)
        at ...
Caused by: java.lang.RuntimeException
        at org.glassfish.javaee.core.deployment.JavaEEDeployer.prepare(JavaEEDeployer.java:228)
        at org.glassfish.ejb.startup.EjbDeployer.prepare(EjbDeployer.java:232)
        at com.sun.enterprise.v3.server.ApplicationLifecycle.prepareModule(ApplicationLifecycle.java:1255)
        at org.glassfish.javaee.full.deployment.EarDeployer.prepareBundle(EarDeployer.java:301)
        at org.glassfish.javaee.full.deployment.EarDeployer.lambda$prepare$0(EarDeployer.java:164)
        at org.glassfish.javaee.full.deployment.EarDeployer.doOnBundles(EarDeployer.java:221)
        at org.glassfish.javaee.full.deployment.EarDeployer.doOnAllTypedBundles(EarDeployer.java:233)
        at org.glassfish.javaee.full.deployment.EarDeployer.doOnAllBundles(EarDeployer.java:259)
        at org.glassfish.javaee.full.deployment.EarDeployer.prepare(EarDeployer.java:162)
        ... 23 more
Caused by: java.nio.file.FileSystemNotFoundException
        at jdk.zipfs/jdk.nio.zipfs.ZipFileSystemProvider.getFileSystem(ZipFileSystemProvider.java:156)
        at jdk.zipfs/jdk.nio.zipfs.ZipFileSystemProvider.getPath(ZipFileSystemProvider.java:142)
        at java.base/java.nio.file.Path.of(Path.java:209)
        at java.base/java.nio.file.Paths.get(Paths.java:98)
        at org.glassfish.loader.util.ASClassLoaderUtil.getModulesClasspath(ASClassLoaderUtil.java:275)
        at org.glassfish.loader.util.ASClassLoaderUtil.getModuleClassPath(ASClassLoaderUtil.java:120)
        at org.glassfish.loader.util.ASClassLoaderUtil.getModuleClassPath(ASClassLoaderUtil.java:146)
        at org.glassfish.javaee.core.deployment.JavaEEDeployer.getModuleClassPath(JavaEEDeployer.java:116)
        at org.glassfish.ejb.startup.EjbDeployer.generateArtifacts(EjbDeployer.java:427)
        at org.glassfish.javaee.core.deployment.JavaEEDeployer.prepare(JavaEEDeployer.java:223)

We are using payara-embedded-all 6.2023.9 with JDK17 and Spring boot 3.1.4.

@ctabin ctabin changed the title Avoid crashing due to FileSystemNotFound while behind a Spring boot e… Avoid crashing due to FileSystemNotFound while behind a Spring boot Oct 13, 2023
@ctabin ctabin force-pushed the fix-fsnf-spring-boot branch from ea87e73 to f566d17 Compare October 13, 2023 09:28
@ctabin ctabin force-pushed the fix-fsnf-spring-boot branch from f566d17 to 47d17eb Compare October 13, 2023 09:30
@ctabin
Copy link
Contributor Author

ctabin commented Oct 13, 2023

Jenkins test please

@Pandrex247 Pandrex247 changed the title Avoid crashing due to FileSystemNotFound while behind a Spring boot FISH-8044 Avoid crashing due to FileSystemNotFound while behind a Spring boot Nov 13, 2023
@luiseufrasio luiseufrasio self-requested a review January 15, 2024 12:54
Copy link
Contributor

@luiseufrasio luiseufrasio left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ctabin Could you please provide the Spring boot app and the EAR file you used to reproduce it?

@ctabin
Copy link
Contributor Author

ctabin commented Jan 23, 2024

@luiseufrasio I'll provide a test case asap.

@ctabin
Copy link
Contributor Author

ctabin commented Jan 29, 2024

@luiseufrasio Please find a reproducer here. As stated in the README, it seems that with the latest version of spring-boot-maven-plugin (3.2.2), the issue does not appear anymore.

@ctabin ctabin requested a review from luiseufrasio January 29, 2024 22:24
Copy link
Contributor

@luiseufrasio luiseufrasio left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@luiseufrasio luiseufrasio merged commit 326646d into payara:master Feb 3, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants