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

Spring Boot jar launcher does not work in folders containing certain chars #38660

Closed
pashazadeh opened this issue Dec 5, 2023 · 1 comment
Closed
Assignees
Labels
type: regression A regression from a previous release
Milestone

Comments

@pashazadeh
Copy link

I have my microservices fat-jars in a folder name containing "#" in its name. It worked fine with Spring Boot 3.1.5 and 3.1.6, but now on Spring Boot 3.2.0 I got following error:

Exception in thread "main" java.lang.IllegalStateException: Unable to create JarFileArchive URL
        at org.springframework.boot.loader.net.protocol.jar.JarUrl.create(JarUrl.java:77)
        at org.springframework.boot.loader.net.protocol.jar.JarUrl.create(JarUrl.java:61)
        at org.springframework.boot.loader.net.protocol.jar.JarUrl.create(JarUrl.java:51)
        at org.springframework.boot.loader.launch.JarFileArchive.getNestedJarUrl(JarFileArchive.java:100)
        at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197)
        at java.base/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:179)
        at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197)
        at java.base/java.util.zip.ZipFile$EntrySpliterator.tryAdvance(ZipFile.java:558)
        at java.base/java.util.Spliterator.forEachRemaining(Spliterator.java:332)
        at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509)
        at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499)
        at java.base/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:921)
        at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
        at java.base/java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:682)
        at org.springframework.boot.loader.launch.JarFileArchive.getClassPathUrls(JarFileArchive.java:90)
        at org.springframework.boot.loader.launch.ExecutableArchiveLauncher.getClassPathUrls(ExecutableArchiveLauncher.java:102)
        at org.springframework.boot.loader.launch.Launcher.launch(Launcher.java:50)
        at org.springframework.boot.loader.launch.JarLauncher.main(JarLauncher.java:58)
Caused by: java.net.MalformedURLException: no !/ in spec
        at java.base/java.net.URL.<init>(URL.java:708)
        at org.springframework.boot.loader.net.protocol.jar.JarUrl.create(JarUrl.java:74)
        ... 17 more
Caused by: java.lang.IllegalStateException: no !/ in spec
        at org.springframework.boot.loader.net.protocol.jar.Handler.extractAbsolutePath(Handler.java:77)
        at org.springframework.boot.loader.net.protocol.jar.Handler.extractPath(Handler.java:65)
        at org.springframework.boot.loader.net.protocol.jar.Handler.parseURL(Handler.java:55)
        at java.base/java.net.URL.<init>(URL.java:703)

It was hard to determine the root of error, but now as a workaround I changed the folder names (removing "#" from their names).

By the way our OS is Redhat Linux.

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Dec 5, 2023
@philwebb philwebb added type: regression A regression from a previous release and removed status: waiting-for-triage An issue we've not yet triaged labels Dec 5, 2023
@philwebb philwebb added this to the 3.2.x milestone Dec 5, 2023
@philwebb philwebb self-assigned this Dec 6, 2023
@philwebb philwebb changed the title Spring Boot 3.2 launcher does not work when jar containing folder name contains # Spring Boot 3.2 launcher does not work in folders containing certain chars Dec 7, 2023
@philwebb philwebb changed the title Spring Boot 3.2 launcher does not work in folders containing certain chars Spring Boot jar launcher does not work in folders containing certain chars Dec 7, 2023
@philwebb
Copy link
Member

philwebb commented Dec 7, 2023

Thanks for the report @pashazadeh. I think I've managed to fix this for 3.2.1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: regression A regression from a previous release
Projects
None yet
Development

No branches or pull requests

3 participants