0
votes

I am having trouble running a jnlp (webstart) with Glassfish 3.3.1. The console says:

java.io.FileNotFoundException: http://localhost:8080/myapp/server

The jnlp code base is set as follows:

<?xml version="1.0" encoding="UTF-8"?>
<jnlp codebase="http://localhost:8080/myapp">
<information>
    <title>My App </title>
    <vendor>IT Solutions</vendor>
    <icon href="address.gif"/>
    <description>My App</description>
</information>
<security>
    <all-permissions/>
</security>
<resources>
    <j2se version="1.6+"/>
    <jar href="proweb.jar"/>
    <jar href="commons-logging-1.0.jar"/>
    <jar href="commons-discovery.jar"/> 
    <jar href="axis.jar"/>
    <jar href="jaxrpc-api-osgi.jar"/>
    <jar href="javax.servlet.jar"/>
    <jar href="swingx-all-1.6.3.jar"/>
    <jar href="my_app.jar"/>
</resources>
<application-desc
    name="MatrixApplet"
    main-class="com.myapp.client.MyApplet"
    width="800"
    height="600">
    <argument>http://localhost:8080</argument>
    <argument>/myapp/server</argument>
    <argument>http://localhost:8080/myreport/jsp/Launch.jsp</argument>
</application-desc>
</jnlp>

The jars are downloaded and the exception is thrown. I can't use debugger because the launch fails with the aforementioned error message in the console.

This used to run fine until now. I can't pin point what changes if any happened. I use ant to build the various artifacts and there has been no changes in the build.xml (can post if you want). Also, I see a big ol brick-color X (not the simple red icon that is frequently talked about) one of the compiled classes folder under bin. I couldn't find what that icon means at the Eclipse site.

I also tried to run the MyApplet on the command line but got this stack trace:

Error: A JNI error has occurred, please check your installation and try again
Exception in thread "main" java.lang.NoClassDefFoundError:    javax/jnlp/UnavailableServiceException
    at java.lang.Class.getDeclaredMethods0(Native Method)
    at java.lang.Class.privateGetDeclaredMethods(Class.java:2701)
    at java.lang.Class.privateGetMethodRecursive(Class.java:3048)
    at java.lang.Class.getMethod0(Class.java:3018)
    at java.lang.Class.getMethod(Class.java:1784)
    at sun.launcher.LauncherHelper.validateMainClass(LauncherHelper.java:544)
    at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:526)
Caused by: java.lang.ClassNotFoundException: javax.jnlp.UnavailableServiceException
    at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:357)

One more thing. I removed everything under the glassfish3/glassfish/domains/domain1/applications/ dir before deploying the EAR file. Is that bad?

Someone here is suggesting using a standalone instance of glassfish. Tried that too.

One final thing: in the browser the following 2 URL's give http-404 (not found)

http://localhost:8080/myapp

http://localhost:8080/myapp/server

Whereas if I give http://localhost:8080/myapp/proweb.jar

the jar is downloaded.

Any help? Thanking you

1

1 Answers

0
votes

There was a problem with jar signing. Using jws, the error message in the console was totally misleading. When the jnlp file (Windows 7) was double-clicked, the real error was revealed.