2014-07-18 99 views
4

嘗試使用JWS(JNLP)啓動運行Jar應用程序。它一直給我這個錯誤。甚至找不到錯誤。任何方向都會有幫助。運行Jar應用程序時出現Java Web Start NumberFormatException

如果有人能告訴我這個錯誤的潛在位置在哪裏,我可以在這裏找到這個代碼。

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的罐子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. 
+2

請務必使用JaNeLA檢查JNLP,可在[此處](https://drive.google.com/?tab=co&authuser=0#folders/0B5B9wDXIGw9lUnJaUjA2cmlVRE0)查看。 –

+0

@AndrewThompson:感謝很不錯的應用程序。在由Netbeans創建的JNLP文件中發現了很多問題。現在的問題是如何解決它們:-) 一個接一個,要走的路。 – Indigo

+0

@AndrewThompson:對不起,問題是評論。 [help here](http://pscode.org/janela/help.html)的頁面不起作用。任何想法爲什麼以及如何得到JaNeLa工具報告的錯誤的幫助。 – Indigo

回答

2

看起來像已知問題...請參閱Bug #236765

升級您的Java版本,如錯誤中指定的那樣。

不是NB問題,javaws問題。我已測試 https://netbeans.org/kb/73/java/javase-jws.html與JDK 1.7.0_45和 工作正常。請更新JDK JRE。

+2

我有最新的Java 8 Update 5 猜猜這不是問題,但是這是使用Netbeans在我的情況。 – Indigo

2

張貼這在這裏萬一有人有同樣的錯誤,甚至與Java 8更新101:

在我們的具體情況下,挖了幾個小時之後,這個問題最終被認爲的NetBeans 7.4版在罐子的MANIFEST.MFCodebase屬性上放了一些無​​用的垃圾;通過進入項目屬性Application -> Web Start,然後將Codebase更改爲User definedCodebase Preview*,應用程序開始正常工作。

請記住,我們使用的是一個applet而不是一個JNLP應用程序,因此您的里程可能會有所不同。

+1

我使用「http:// localhost:1234 /」而不是「*」,因爲這會填充文件中的JNLP位置。爲小費歡呼。 – timB33

相關問題