【发布时间】:2016-03-01 07:20:14
【问题描述】:
我在使用 Glassfish 3.3.1 运行 jnlp (webstart) 时遇到问题。控制台说:
java.io.FileNotFoundException: http://localhost:8080/myapp/server
jnlp代码库设置如下:
<?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>
jar 被下载并抛出异常。我无法使用调试器,因为启动失败并在控制台中显示上述错误消息。
到目前为止,它一直运行良好。如果发生任何变化,我无法指出发生了什么变化。我使用 ant 来构建各种工件,并且 build.xml 中没有任何更改(如果需要,可以发布)。另外,我在 bin 下的已编译类文件夹中看到一个大的砖色 X(不是经常谈论的简单红色图标)。我在 Eclipse 站点上找不到该图标的含义。
我也尝试在命令行上运行 MyApplet,但得到了这个堆栈跟踪:
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)
还有一件事。在部署 EAR 文件之前,我删除了 glassfish3/glassfish/domains/domain1/applications/ 目录下的所有内容。这很糟糕吗?
这里有人建议使用 glassfish 的独立实例。也试过了。
最后一件事:在浏览器中,以下 2 个 URL 给出 http-404(未找到)
http://localhost:8080/myapp/server
如果我给 http://localhost:8080/myapp/proweb.jar
jar 已下载。
有什么帮助吗? 谢谢你
【问题讨论】:
标签: java eclipse glassfish jnlp