启动时出现Java Webstart错误

时间:2012-10-08 22:22:30

标签: java jboss ejb-3.0 jboss7.x java-web-start

我有一个使用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 - &gt; http://pastebin.com/EXu8Z5dZ

web.xml - &gt; http://pastebin.com/KK3fPPY9

GrahamsProjServlet.java - &gt; http://pastebin.com/iC9JDiTL

导致这种情况的原因是什么?

1 个答案:

答案 0 :(得分:0)

在摆弄它一段时间后,我遇到了解决方案。在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>