Netbeans JNLP Webstart error

匿名 (未验证) 提交于 2019-12-03 08:54:24

问题:

I have been fighting with this all day and I simply cannot figure out what I am doing wrong. I have a project in netbeans that I created a web start page for, as per the method in the netbeans tutorial but every time I try to run either the tutorial project or my project as a web start I get the following error:

java.lang.NumberFormatException: For input string: "\Users\<snip>" 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) 

My jnlp file is:

 <?xml version="1.0" encoding="UTF-8" standalone="no"?> <jnlp codebase="file:/C:/Users/<snip>/dist/" href="launch.jnlp" spec="1.0+">     <information>         <title>...</title>         <vendor>me</vendor>         <homepage href=""/>         <description>...</description>         <description kind="short">...</description>     </information>     <update check="background"/>     <security> <all-permissions/> </security>     <resources>     <j2se version="1.8+"/>     <jar eagar="true" href="<snip>.jar" main="true"/>      </resources>     <application-desc main-class="<snip>">     </application-desc>     </jnlp> 

I would really appreciate help with this

回答1:

Just change your jnlp to this:

 <?xml version="1.0" encoding="UTF-8" standalone="no"?> <jnlp codebase="file:/C:/MyFolder/" href="launch.jnlp" spec="1.0+">     <information>         <title>...</title>         <vendor>me</vendor>         <homepage href=""/>         <description>...</description>         <description kind="short">...</description>     </information>     <update check="background"/>     <security> <all-permissions/> </security>     <resources>     <j2se version="1.8+"/>     <jar eagar="true" href="MyJarFile.jar" main="true"/>      </resources>     <application-desc main-class="com.MyCompany.MyMainClass">     </application-desc>     </jnlp> 

Edit: If this doesn't help or if you have a question about it add your comment below.



回答2:

Try

file:///C:/Users/snip/dist/

in your codebase of your JNLP-XML.
File Uri-Scheme needs 2x // (file://)

EDIT:
No comment on this?

So, if this doesn't work, you can try following:
https://stackoverflow.com/a/2417010/3887073

which tells:

<jnlp spec="1.0+" codebase="file://localhost/X:/path/to/jnlp/" href="software.jnlp"> 


回答3:

Make sure you are not using the path to your application as a value anywhere in your code. If the program accepts command-line arguments, try specifying the arguments as <argument></argument> sub-elements of <application-desc> in the JNLP file and running the Java Web Start program directly from the command line with

javaws path.to.ClassWithMainMethod 


回答4:

It seems that you are taking some kind of input from the user in your webstart application.

java.lang.NumberFormatException: For input string: "\Users\<snip>" at java.lang.NumberFormatException.forInputString(Unknown Source) 

Judging by this line, you requested the user to input an integer and they put in a string or something.

If you are not taking any user input, reinstalling NetBeans might help.

Cheers.



易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!