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

OWS tries to load jar not in jnlp caused by + in jar name #576

Open
dominikFenzl-nextlane opened this issue Apr 16, 2024 · 8 comments
Open

Comments

@dominikFenzl-nextlane
Copy link

OWS tries to load a jar file, jcef.jar, from the root of the applications deployment dir. This jar does not exist and is not referenced in the jnlp file.

OWS also misses to load the correct jar file present in the jnlp and in the deployment. The correct one is jcef-api-jcef-0b8e42e+cef-122.1.10+gc902316+chromium-122.0.6261.112.jar. This jar file is located in a sub directory of the deployment.

All other jars are loaded correctly.

OS is ubuntu 22.04 jdk is adoptium openjdk 11.2.

Oracle webstart with jdk 8 has no Problem

IcedTea webstart standalone has no problem either.

Copying the file to the wrong location with the wrong name fixes the Problem but is no solution in productive environment.

@FelixJongleur42
Copy link

Disclaimer: I am not a OWS developer ;)

What do you mean by „OWS tries to load a jar file“ - can you see it in what log? Maybe it‘s some mechanism specific to JCEF?

PS I had a similar effect with an OSGI Application (not with JCEF) where some “Bundle logic” tried to load Jars (thus it was not OWS trying to load the jar in my case).

@dominikFenzl-nextlane
Copy link
Author

Where did you find that bundling information, i did not find any entries in pointing to a jcef.jar file.

OWS does not map the correct jar.

This is the output if i try to access a class in the jar

CachedJarFileCallback.addMapping : http://127.0.0.1:8080/ecaros2client/jcef.jar -> http://127.0.0.1:8080/ecaros2client/jcef.jar
.
.
.
Error flag set for resource 'http://127.0.0.1:8080/ecaros2client/jcef.jar'. Can not return a local file for the resource
Error flag set for resource 'http://127.0.0.1:8080/ecaros2client/jcef.jar'. Can not return a local file for the resource
No cache file for cacheable resource 'http://127.0.0.1:8080/ecaros2client/jcef.jar' found.
Error flag set for resource 'http://127.0.0.1:8080/ecaros2client/jcef.jar'. Can not return a local file for the resource
Download done. Shutting down executor
Could not download resource [l=http://127.0.0.1:8080/ecaros2client/jcef.jar v=null s=I] from any of theses urls [http://127.0.0.1:8080/ecaros2client/jcef.jar] caused byExecutionException: java.io.FileNotFoundException: http://127.0.0.1:8080/ecaros2client/jcef.jar caused by FileNotFoundException: http://127.0.0.1:8080/ecaros2client/jcef.jar caused by FileNotFoundException: http://127.0.0.1:8080/ecaros2client/jcef.jar
downloadFrom exception: http://127.0.0.1:8080/ecaros2client/jcef.jar
Exception while downloading resource [l=http://127.0.0.1:8080/ecaros2client/jcef.jar v=null s=I] from http://127.0.0.1:8080/ecaros2client/jcef.jar - message: http://127.0.0.1:8080/ecaros2client/jcef.jar cause: java.io.FileNotFoundException: http://127.0.0.1:8080/ecaros2client/jcef.jar
Will download in background: http://127.0.0.1:8080/ecaros2client/jcef.jar
Failed to determine best URL for [l=http://127.0.0.1:8080/ecaros2client/jcef.jar v=null s=I] will try all of [http://127.0.0.1:8080/ecaros2client/jcef.jar]
failed to determine best URL: java.util.concurrent.ExecutionException: java.lang.RuntimeException: Server returned 404 for http://127.0.0.1:8080/ecaros2client/jcef.jar
For [l=http://127.0.0.1:8080/ecaros2client/jcef.jar v=null s=I] the server returned 404 code for HEAD request for http://127.0.0.1:8080/ecaros2client/jcef.jar
URL connection 'http://127.0.0.1:8080/ecaros2client/jcef.jar' header fields: {null=[HTTP/1.1 404 Not Found], Connection=[keep-alive], Content-Length=[68], Date=[Wed, 17 Apr 2024 06:24:30 GMT], Content-Type=[text/html;charset=UTF-8]}
Following exception should be harmless, but may help in finding root cause.
Candidate URLs for [l=http://127.0.0.1:8080/ecaros2client/jcef.jar v=null s=I]: [http://127.0.0.1:8080/ecaros2client/jcef.jar]
needsUpdateCheck: http://127.0.0.1:8080/ecaros2client/jcef.jar -> true
isCached: CacheKey{location=http://127.0.0.1:8080/ecaros2client/jcef.jar, version=null} = true
Start processing resource: jcef.jar
Prefetching resource jcef.jar
Create resource for 'http://127.0.0.1:8080/ecaros2client/jcef.jar'

All other jars, but not the missing one, are mapped at the applications startup

@patrice0
Copy link

I've experienced a similar (but possibly not identical) issue. If a class file for one of the classes in a .jar file happens to be on my classpath, then it's sometimes loaded instead of the one that's in the .jar file (I would have expected applications run through OpenWebStart to override the CLASSPATH environment variable).

@janakmulani
Copy link
Contributor

jcef-0b8e42e+cef-122.1.10+gc902316+chromium-122.0.6261.112.jar

Perhaps the '+ char in the jar file url is problematic. Is it possible to simplify the name?

@dominikFenzl-nextlane
Copy link
Author

jcef-0b8e42e+cef-122.1.10+gc902316+chromium-122.0.6261.112.jar

Perhaps the '+ char in the jar file url is problematic. Is it possible to simplify the name?

This jar name comes directly from maven central / maven repository so for production it won't be possible to change this. But i can try to exclude this dependency and use a local copy with simplified name tho test if it is realy the name witch is causing the problem.

When i tested i'll reply again

@dominikFenzl-nextlane dominikFenzl-nextlane changed the title OWS tries to load jar not in jnlp OWS tries to load jar not in jnlp caused by + in jar name Jun 25, 2024
@dominikFenzl-nextlane
Copy link
Author

dominikFenzl-nextlane commented Jun 25, 2024

@janakmulani This seems to be the Problem, after adding the jar to a local repository without the + int the name/version openwebstart loads the jar fine.

@sclassen
Copy link
Member

Yes, the + character is used as an encoding for a white space in the URL encoding

@dominikFenzl-nextlane
Copy link
Author

OK i'll try to reach out to the maintainer of the package if he is able to remove the + from the artifacts versions in future releases

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

No branches or pull requests

5 participants