2014-04-01 108 views
2

嗨,我有一個java swing應用程序,我想通過jnlp啓動它,我配置了我的項目web啓動配置,但是當我推動啓動按鈕不起作用。你知道爲什麼嗎?無法啓動應用程序

以下是錯誤

Java.lang.NumberFormatException: For input string: "\Users\Administrator\Documents\NetBeansProjects\LoginPage\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.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) 
+0

我們無法用提供的信息來回答這個問題。給我們一些代碼和上下文。 –

+0

我沒有任何parseInt或字符串,我只是有一個NetBeans自動創建的形式,我只是測試如何開始我的swing本地jnlp,我設置了我的web開始,我有launch.jnlp和launch.html在dist文件夾,我不能運行它爲什麼? – mtrsykl

+0

很久以前,你能記住你最終做了什麼嗎? – Houtman

回答

1

只需這個錯誤,我們只能告訴你,你的問題是因爲parseInt的上String這不是一個int發生。 要糾正這一點,你有兩種可能性:

  1. 添加try{}catch(NumberFormatException e){//show error}
  2. 斷言,你有正確的東西變成parseInt
0

我有同樣的問題。啓用

  • '運行爲在webstart':
    Netbeans的8.01,JDK 1.8u20,JRE項目,

    運行選項。

應用/ Webstart的選項:

  • 創建的證書密鑰庫(提示:我用 'portecle')
  • 代碼庫:本地執行(通過該預覽顯示:「文件:/ C :/..../')

該項目創建的JNLP說;

<?xml version="1.0" encoding="UTF-8" standalone="no"?> 
<jnlp codebase="file:/C:/<snip>/dist/" href="launch.jnlp" spec="1.0+"> 
    <information> 
     <title>netbeans_prj</title> 
     <vendor>bla</vendor> 
     <homepage href=""/> 
     <description>netbeans_prj</description> 
     <description kind="short">netbeans_prj</description> 
    <offline-allowed/> 
</information> 
    <update check="background"/> 
    <security> 
<all-permissions/> 
</security> 
    <resources> 
     <j2se java-vm-args="-Xmx512m -Xverify:none" version="1.7+"/> 
     <jar href="netbeans_prj.jar" main="true"/> 
    <jar href="lib/all_ext.jar"/> 
</resources> 
    <application-desc main-class="<snip>"> 
    <argument>-h</argument> 
<argument>127.0.0.1</argument> 
</application-desc> 
</jnlp>