2014-04-01 70 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>