我有一个使用webstart的EJB 3.0项目,试图将它作为WAR部署到JBoss AS 7.1.1。我可以很好地进入html页面,但是当我单击webstart链接时,它尝试从http://java.sun.com下载JRE 1.7并弹出此错误:

"AutoDL?BundleId=68742" on java.sun.com is not a Java installer.


这是我战争的目录结构:

root of war(dir)
-->GrahamsProjClient-webstart.jnlp
-->GrahamsProjStartAppPage.html
-->app(dir)
    -->GrahamsProjClient.jar(The actual client project)
-->META-INF(dir)
    -->context.xml(blank file)
    -->MANIFEST.MF
-->WEB-INF(dir)
    -->web.xml
    -->classes(dir) contains my compiled servlet
    -->lib(dir)
        -->jboss-servlet-api_3.0_spec-1.0.0.Final.jar
        -->jnlp-servlet.jar


以下是战争重要文件的链接:

GrahamsProjClient-webstart.jnlp-> http://pastebin.com/zwkm1zz3



<?xml version="1.0" encoding="UTF-8"?>
<jnlp codebase="$$codebase">
 <information>
     <title>Grahams Project</title>
     <vendor>Graham</vendor>
     <description>desc</description>
 </information>
 <resources>
   <j2se version="1.6"/>
   <jar href="GrahamsProjClient.jar"/>
 </resources>
 <application-desc/>
</jnlp>


GrahamsProjStartAppPage.html-> http://pastebin.com/EXu8Z5dZ

web.xml-> http://pastebin.com/KK3fPPY9

GrahamsProjServlet.java-> http://pastebin.com/iC9JDiTL

是什么原因造成的?

最佳答案

摆弄了一段时间后,我遇到了解决方案。在GrahamsProjStartAppPage.html中,deployJava.createWebStartLaunchButton()命令需要具有1.6.0+而不是1.6.0。因此,html文件现在看起来像这样:

<body>
<!-- ... -->
<script src=
  "http://www.java.com/js/deployJava.js"></script>
<script>
    // using JavaScript to get location of JNLP
    // file relative to HTML page
    var dir = location.href.substring(0,
        location.href.lastIndexOf('/')+1);
    //var url = dir + "GrahamsProjClient-webstart.jnlp";
    var url = "http://127.0.0.1:8080/GrahamsProjClient/GrahamsProjClient-webstart.jnlp"
    deployJava.createWebStartLaunchButton(url, '1.6.0+'); //changed from 1.6.0 to 1.6.0+
</script>
<!-- ... -->
</body>

10-08 13:26