eclipse-ee4j / eclipse-ee4j/jersey

Jersey client running in a web start application makes unexpected requests

Open
#5,235 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
730
Forks
382
PR merge metrics
No merged PRs in 30d

Description

Hello. I'm using these jersey libraries:
```

org.glassfish.jersey.core
jersey-client
2.34
jar


org.glassfish.jersey.media
jersey-media-json-jackson
2.34


org.glassfish.jersey.media
jersey-media-sse
2.34
jar


org.glassfish.jersey.inject
jersey-hk2
2.34

```
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.
It runs on multiple devices using java web start ([https://github.com/AdoptOpenJDK /IcedTea-Web](https://github.com/AdoptOpenJDK/IcedTea-Web])

I have noticed that from time to time some devices start making requests for the MyApplication-1.0.jar file . I can see that on my webserver access log.

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) <------ my application api request

`

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.