I deployed the swing GUI via webstart-maven-plugin and JnlpDownloadServlet to my webapp in the servlet container (Glassfish 3.0). My classes and GUI resources are in the mygui-4.8.jar file, which is in the webstart directory of my webapp along with the launch.jnlp file.
An application may start working normally when accessed at the launch.jnlp URL in a web browser:
http: // localhost: 8080 / myserver / webstart / launch.jnlp
However, when the code in my webapp tries to access the image resource inside the mygui-4.8.jar file, it cannot get it.
The code I use in the GUI to get the icon:
URL iconURL = getClass (). getClassLoader (). getResource ("/icons/Find.png");
Using the debugger, I see that iconURL.toString () returns the following URL:
jar: HTTP: // local: 8080 / MyServer / WebStart / mygui.jar / icons / Find.png
I noticed that the version is missing from the jar file name (this is mygui.jar instead of mygui-4.8.jar).
This seems to be due to version processing in the jnlp protocol.
Can someone tell me how can I rewrite my client code to get these resources inside the jar file? Thank you for your help.
source share