citrusframework / citrus

Framework for automated integration tests with focus on messaging integration
https://citrusframework.org
Apache License 2.0
453 stars 134 forks source link

Release 4.3.0 not loading citrus-api on Windows machines #1200

Closed bbortt closed 1 month ago

bbortt commented 1 month ago

Citrus Version

Release 4.3.0.

Expected behavior

Citrus-Simulator (or tests, but I didn't test that) starts on Windows hosts.

Actual behavior

It does not, because https://github.com/citrusframework/citrus/commit/bd7ebff8c34909b0d17c399e7c8b9349c2562d0a introduces a bug: Path#of throws on Windows, because the : is an illegal character:

Caused by: java.nio.file.InvalidPathException: Illegal char <:> at index 2: /C:/Users/[...]/4.3.0/citrus-api-4.3.0.jar

new File(ROOT.toString().substring("file:".length())).toPath() should be used instead.

jurgis-sipols commented 3 weeks ago

There is a problem also in Linux hosts with version 4.3.1. With 4.2.1 works ok. Could there be another bug? @christophd @bbortt

Failed to create File system from jar 'jar:nested:/app/application.jar/!BOOT-INF/lib/citrus-api-4.3.1.jar!/'

java.nio.file.NoSuchFileException: ested:/app/application.jar/!BOOT-INF/lib/citrus-api-4.3.1.jar!
    at jdk.zipfs/jdk.nio.zipfs.ZipFileSystem.<init>(ZipFileSystem.java:166)
    at jdk.zipfs/jdk.nio.zipfs.ZipFileSystemProvider.getZipFileSystem(ZipFileSystemProvider.java:125)
    at jdk.zipfs/jdk.nio.zipfs.ZipFileSystemProvider.newFileSystem(ZipFileSystemProvider.java:120)
    at java.base/java.nio.file.FileSystems.newFileSystem(FileSystems.java:528)
    at java.base/java.nio.file.FileSystems.newFileSystem(FileSystems.java:475)
    at org.citrusframework.spi.ResourcePathTypeResolver.<clinit>(ResourcePathTypeResolver.java:122)
    at org.citrusframework.endpoint.EndpointBuilder.<clinit>(EndpointBuilder.java:52)
    at org.citrusframework.http.endpoint.builder.HttpEndpoints.<init>(HttpEndpoints.java:31)
    at org.citrusframework.http.endpoint.builder.HttpEndpoints.http(HttpEndpoints.java:39)
bbortt commented 3 weeks ago

oh damn.. that's a bug introduced in bd7ebff8c34909b0d17c399e7c8b9349c2562d0a and released in 4.3.0.

the "fix" commit 3ddf451bf699a81e155b4adfb1ca5401e16a0fe2 and and #1200 have nothing to do with this bug, because that would fail on windows likewise. the code just furiously sub-strings on file:. even if citrus-api is in a nested jar.

I've opened #1204.

bbortt commented 3 weeks ago

oh and thanks for reporting it @jurgis-sipols 😉