【发布时间】:2014-09-09 19:21:17
【问题描述】:
尝试使用 JWS (JNLP) 启动运行 Jar 应用程序时。它一直给我这个错误。甚至找不到错误在哪里。任何方向都会有所帮助。
如果有人能告诉我此错误的潜在位置在哪里,我可以在此处找到发布该代码。
java.lang.NumberFormatException: For input string: "\Tools_Dev\TestApp\dist"
at java.lang.NumberFormatException.forInputString(Unknown Source)
at java.lang.Integer.parseInt(Unknown Source)
at java.lang.Integer.parseInt(Unknown Source)
at com.sun.deploy.security.DeployManifestChecker.verifyCodebaseEx(Unknown Source)
at com.sun.deploy.security.DeployManifestChecker.verifyCodebase(Unknown Source)
at com.sun.deploy.security.DeployManifestChecker.verify(Unknown Source)
at com.sun.deploy.security.DeployManifestChecker.verify(Unknown Source)
at com.sun.javaws.security.AppPolicy.grantUnrestrictedAccess(Unknown Source)
at com.sun.javaws.security.JNLPSignedResourcesHelper.checkSignedResourcesHelper(Unknown Source)
at com.sun.javaws.security.JNLPSignedResourcesHelper.checkSignedResources(Unknown Source)
at com.sun.javaws.Launcher.prepareResources(Unknown Source)
at com.sun.javaws.Launcher.prepareAllResources(Unknown Source)
at com.sun.javaws.Launcher.prepareToLaunch(Unknown Source)
at com.sun.javaws.Launcher.prepareToLaunch(Unknown Source)
at com.sun.javaws.Launcher.launch(Unknown Source)
at com.sun.javaws.Main.launchApp(Unknown Source)
at com.sun.javaws.Main.continueInSecureThread(Unknown Source)
at com.sun.javaws.Main.access$000(Unknown Source)
at com.sun.javaws.Main$1.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
注意:我安装了最新的 Java 8 并在 Netbeans 上工作。 jar文件如果手动调用,效果很好,java -jar testTool.jar
更新:
JNLP 文件内容:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<jnlp codebase="file:/C:/Tools_Dev/TestApp/dist/" href="launch.jnlp" spec="1.0+">
<information>
<title>Java Tool Update Test</title>
<vendor>Local</vendor>
<description>Test Tool</description>
<offline-allowed/>
</information>
<security>
<all-permissions/>
</security>
<update check="background"/>
<resources>
<j2se version="1.7+"/>
<jar href="Java-Tool-Update-Test.jar" main="true"/>
<jar href="lib/sqlite-jdbc-3.7.15-M1.jar"/>
<jar href="lib/poi-3.10-FINAL-20140208.jar"/>
<jar href="lib/poi-ooxml-3.10-FINAL-20140208.jar"/>
<jar href="lib/poi-ooxml-schemas-3.10-FINAL-20140208.jar"/>
<jar href="lib/dom4j-1.6.1.jar"/>
<jar href="lib/xmlbeans-2.3.0.jar"/>
<jar href="lib/jaxen-1.1.6.jar"/>
</resources>
<application-desc main-class="Tool.Test.Main">
</application-desc>
</jnlp>
JaNeLa 工具中提示的错误,不包括警告和优化:
JaNeLA Report - version 11.05.17
cvc-complex-type.2.4.a: Invalid content was found starting with element 'security'. One of '{resources, application-desc, applet-desc, component-desc, installer-desc}' is expected.
cvc-complex-type.2.4.a: Invalid content was found starting with element 'security'. One of '{resources, application-desc, applet-desc, component-desc, installer-desc}' is expected.
Lazy downloads might not work as expected for lib/sqlite-jdbc-3.7.15-M1.jar unless the download 'part' is specified.
Lazy downloads might not work as expected for lib/poi-3.10-FINAL-20140208.jar unless the download 'part' is specified.
Lazy downloads might not work as expected for lib/poi-ooxml-3.10-FINAL-20140208.jar unless the download 'part' is specified.
Lazy downloads might not work as expected for lib/poi-ooxml-schemas-3.10-FINAL-20140208.jar unless the download 'part' is specified.
Lazy downloads might not work as expected for lib/dom4j-1.6.1.jar unless the download 'part' is specified.
Lazy downloads might not work as expected for lib/xmlbeans-2.3.0.jar unless the download 'part' is specified.
Lazy downloads might not work as expected for lib/jaxen-1.1.6.jar unless the download 'part' is specified.
【问题讨论】:
-
请务必使用 JaNeLA 检查 JNLP,here 可用。
-
@AndrewThompson:感谢漂亮的应用程序。在 Netbeans 创建的 JNLP 文件中发现了很多问题。现在的问题是如何修复它们 :-) 一个接一个,要走的路。
-
@AndrewThompson:抱歉问题是评论。 help here 的页面无法正常工作。知道为什么以及如何获得有关 JaNeLa 工具报告的错误的帮助。
-
我对帮助链接的不好,它指向一个不再存在的站点。我应该重建 Jar 以包含该页面。但与此同时,为什么不发布 JaNeLA 生成的文本报告作为对问题的编辑呢?我可以看看它并提供进一步的建议。顺便说一句 - 您可以忽略报告的所有警告和优化。目前只有错误感兴趣。
-
确保 Java Console 配置为在调试小程序或 JWS 应用程序时显示。
标签: java java-web-start jnlp numberformatexception