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
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.
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">
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
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.
来源:https://stackoverflow.com/questions/29201661/netbeans-jnlp-webstart-error