IcedTea-Web
IcedTea-Web copied to clipboard
.jar resource file downloaded multiple times in a short period of time.
I've had the same issue with version 1.6.3 so I've updated javaws to version 1.8.3. The problem is still there.
I'm using icedtea javaws (version: icedtea-web 1.8.3 to distribute my java application. My app is a long running application that runs for long periods of time (weeks or months).
My jnlp file looks like this:
<jnlp spec="1.0+" codebase="/">
<information>
<title>My Application</title>
<vendor>Software Studio</vendor>
<offline-allowed/>
</information>
<resources>
<!-- Application Resources -->
<jar href="MyApplication-1.0.jar"></jar>
</resources>
<application-desc main-class="com.myapp.application.Application">
<!-- Application Arguments -->
</application-desc>
<security>
<all-permissions/>
</security>
</jnlp>
The application jnlp file and the resource MyApplication-1.0.jar file are hosted in an apache web server. I've noticed in the access logs that some clients are requesting the jar file multiple times in a short period of time. This randomly occurs over time and with different clients, all them running the same javaws version. Below is a snippet of the content of my apache access_log file showing this issue:
172.3.95.128 (85.58.55.24) - - [03/Jan/2020:12:48:24 +0000] "GET /MyApplication-1.0.jar HTTP/1.1" 200 20308737 "-" "Java/1.8.0_222"
172.3.95.128 (85.58.55.24) - - [03/Jan/2020:12:48:30 +0000] "GET /MyApplication-1.0.jar HTTP/1.1" 200 20308737 "-" "Java/1.8.0_222"
172.3.95.128 (85.58.55.24) - - [03/Jan/2020:12:48:36 +0000] "GET /MyApplication-1.0.jar HTTP/1.1" 200 20308737 "-" "Java/1.8.0_222"
172.3.95.128 (85.58.55.24) - - [03/Jan/2020:12:48:43 +0000] "GET /MyApplication-1.0.jar HTTP/1.1" 200 20308737 "-" "Java/1.8.0_222"
172.3.95.128 (85.58.55.24) - - [03/Jan/2020:12:48:49 +0000] "GET /MyApplication-1.0.jar HTTP/1.1" 200 20308737 "-" "Java/1.8.0_222"
172.3.95.128 (85.58.55.24) - - [03/Jan/2020:12:48:55 +0000] "GET /MyApplication-1.0.jar HTTP/1.1" 200 20308737 "-" "Java/1.8.0_222"
172.3.95.128 (85.58.55.24) - - [03/Jan/2020:12:49:01 +0000] "GET /MyApplication-1.0.jar HTTP/1.1" 200 20308737 "-" "Java/1.8.0_222"
172.3.95.128 (85.58.55.24) - - [03/Jan/2020:12:49:07 +0000] "GET /MyApplication-1.0.jar HTTP/1.1" 200 20308737 "-" "Java/1.8.0_222"
172.3.95.128 (85.58.55.24) - - [03/Jan/2020:12:49:13 +0000] "GET /MyApplication-1.0.jar HTTP/1.1" 200 20308737 "-" "Java/1.8.0_222"
172.3.95.128 (85.58.55.24) - - [03/Jan/2020:12:49:20 +0000] "GET /MyApplication-1.0.jar HTTP/1.1" 200 20308737 "-" "Java/1.8.0_222"
172.3.95.128 (85.58.55.24) - - [03/Jan/2020:12:49:26 +0000] "GET /MyApplication-1.0.jar HTTP/1.1" 200 20308737 "-" "Java/1.8.0_222"
172.3.95.128 (85.58.55.24) - - [03/Jan/2020:12:49:33 +0000] "GET /MyApplication-1.0.jar HTTP/1.1" 200 20308737 "-" "Java/1.8.0_222"
172.3.95.128 (85.58.55.24) - - [03/Jan/2020:12:49:39 +0000] "GET /MyApplication-1.0.jar HTTP/1.1" 200 20308737 "-" "Java/1.8.0_222"
172.3.95.128 (85.58.55.24) - - [03/Jan/2020:12:49:45 +0000] "GET /MyApplication-1.0.jar HTTP/1.1" 200 20308737 "-" "Java/1.8.0_222"
172.3.95.128 (85.58.55.24) - - [03/Jan/2020:12:49:51 +0000] "GET /MyApplication-1.0.jar HTTP/1.1" 200 20308737 "-" "Java/1.8.0_222"
172.3.95.128 (85.58.55.24) - - [03/Jan/2020:12:49:57 +0000] "GET /MyApplication-1.0.jar HTTP/1.1" 200 20308737 "-" "Java/1.8.0_222"
172.3.95.128 (85.58.55.24) - - [03/Jan/2020:12:50:03 +0000] "GET /MyApplication-1.0.jar HTTP/1.1" 200 20308737 "-" "Java/1.8.0_222"
172.3.95.128 (85.58.55.24) - - [03/Jan/2020:12:50:10 +0000] "GET /MyApplication-1.0.jar HTTP/1.1" 200 20308737 "-" "Java/1.8.0_222"
172.3.95.128 (85.58.55.24) - - [03/Jan/2020:12:50:16 +0000] "GET /MyApplication-1.0.jar HTTP/1.1" 200 20308737 "-" "Java/1.8.0_222"
172.3.95.128 (85.58.55.24) - - [03/Jan/2020:12:50:22 +0000] "GET /MyApplication-1.0.jar HTTP/1.1" 200 20308737 "-" "Java/1.8.0_222"
172.3.95.128 (85.58.55.24) - - [03/Jan/2020:12:50:28 +0000] "GET /MyApplication-1.0.jar HTTP/1.1" 200 20308737 "-" "Java/1.8.0_222"
172.3.95.128 (85.58.55.24) - - [03/Jan/2020:12:50:34 +0000] "GET /MyApplication-1.0.jar HTTP/1.1" 200 20308737 "-" "Java/1.8.0_222"
172.3.95.128 (85.58.55.24) - - [03/Jan/2020:12:50:42 +0000] "GET /MyApplication-1.0.jar HTTP/1.1" 200 20308737 "-" "Java/1.8.0_222"
172.3.95.128 (85.58.55.24) - - [03/Jan/2020:12:50:46 +0000] "GET /MyApplication-1.0.jar HTTP/1.1" 200 20308737 "-" "Java/1.8.0_222"
What can be causing this behaviour?
Can you try with OpenWebStart to see if the same behavior can be observed?
Can you try with OpenWebStart to see if the same behavior can be observed?
Is not something that I can reproduce. I have this app runnig in around 300 devices and sometimes some of these devices start acting like this. It may be after 4 or 5 days since the application was launched. As soon as I kill the javaws process and restart it again it goes back to normal.
Why would javaws check for app updates after the app has been launched sucessfully?
There is no code which checks for updates after the main method of the application is called. There is a API which can be used by the application to trigger downloads. Maybe this is something which is worth checking if the application is calling WebStart APIs
My application is not making use of that API.
Is there a way to enable logging to show why this is happening?
I have deployment.log.file=true in my deployment.properties but I cannot see any messages regarding resource downloading while this situation is happening in my devices.
Also, can you point me to the files responsible for handling resources checking/downloading?
It is the BaseResourceDownloader and its subclasses: https://github.com/AdoptOpenJDK/IcedTea-Web/blob/master/core/src/main/java/net/adoptopenjdk/icedteaweb/resources/downloader/BaseResourceDownloader.java
Not seeing any entries in the log is yet another indication that the downloads are not coming from the OWS code.
Any update on this? This is still happening for me. When this happens It is triggered when the app has been running for 5, 6 days straight.
Sorry no progress. We cannot reproduce the behavior and you told us that the logs do not show lines about the downloading.
There is nothing we can currently do.
The problem is still happening: I have additional information that may help finding the problem. My java application is packaged into a uber-jar (MyApplication-1.0.jar in the jnlp file) that includes my code and all the dependencies.
It is a headless java application that makes API requests using jax-rs and jersey libraries.
I've run this test where I remove the jnlp and the jar file from the webserver and found that the devices where the application was already running and were requesting the .jar file over and over started producing this exception:
org.glassfish.jersey.internal.inject.InjectionManagerFactory: : java.io.FileNotFoundException: https://dev.myapplication.com/MyApplication-1.0.jar
every time a new Rest API request to the server was being done.
What can be happening here? How is the jersey client messed up when running inside java web start for it to start producing all this requests?
this is the full stacktrace
org.glassfish.jersey.internal.ServiceConfigurationError: org.glassfish.jersey.internal.inject.InjectionManagerFactory: : java.io.FileNotFoundException: https://dev.myapplication.com/MyApplication-1.0.jar at org.glassfish.jersey.internal.ServiceFinder.fail(ServiceFinder.java:410) at org.glassfish.jersey.internal.ServiceFinder.parse(ServiceFinder.java:489) at org.glassfish.jersey.internal.ServiceFinder.access$400(ServiceFinder.java:132) at org.glassfish.jersey.internal.ServiceFinder$LazyObjectIterator.hasNext(ServiceFinder.java:686) at org.glassfish.jersey.internal.inject.Injections.lookupService(Injections.java:88) at org.glassfish.jersey.internal.inject.Injections.lookupInjectionManagerFactory(Injections.java:73) at org.glassfish.jersey.internal.inject.Injections.createInjectionManager(Injections.java:44) at org.glassfish.jersey.client.ClientConfig$State.initRuntime(ClientConfig.java:413) at org.glassfish.jersey.internal.util.collection.Values$LazyValueImpl.get(Values.java:317) at org.glassfish.jersey.client.ClientConfig.getRuntime(ClientConfig.java:819) at org.glassfish.jersey.client.ClientRequest.getClientRuntime(ClientRequest.java:176) at org.glassfish.jersey.client.ClientRequest.getInjectionManager(ClientRequest.java:567) at org.glassfish.jersey.client.JerseyWebTarget.onBuilder(JerseyWebTarget.java:371) at org.glassfish.jersey.client.JerseyWebTarget.request(JerseyWebTarget.java:206) at org.glassfish.jersey.client.JerseyWebTarget.request(JerseyWebTarget.java:38) at com.mycompany.myapp.restclient.MyAppJerseyClient.updateUserData(MyAppJerseyClient.java:164)