After finally solving the jar signing problem (thank you everyone for your help!), a new one has now come up.
When trying to launch the web start app from the launch.jnlp file I get the following error :
java.lang.NullPointerException
at com.sun.javaws.Launcher.executeApplication(Unknown Source)
at com.sun.javaws.Launcher.executeMainClass(Unknown Source)
at com.sun.javaws.Launcher.doLaunchApp(Unknown Source)
at com.sun.javaws.Launcher.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
If I use the jnlp file that points to the jar file on my computer, the app runs fine, but if I try to use the jar file in the website - I get the above error.
What exactly is the problem?
The jnlp file has the right format, otherwise why would it work on my local jar file?
Here is the jnlp:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<jnlp spec="1.0+">
<information>
<title>ExcelReader</title>
<vendor>Adam</vendor>
<homepage href="http://www.appquad.com"/>
<description>ExcelReader</description>
<description kind="short">ExcelReader</description>
<offline-allowed/>
</information>
<update check="background"/>
<security>
<all-permissions/>
</security>
<resources>
<j2se version="1.7+"/>
<jar href="http://www.appquad.com/ExcelCopyApp/sExcelReader.jar" main="true"/>
<jar href="http://www.appquad.com/ExcelCopyApp/lib/jxl.jar"/>
</resources>
<application-desc main-class="excelreader.ExcelCopyApp">
</application-desc>
</jnlp>
Be sure that your JNLP file has the right format: http://download.oracle.com/javase/6/docs/technotes/guides/javaws/developersguide/syntax.html
I had faced similar issue. I was getting below exception while trying to launch
app through jnlp:
java.lang.NullPointerException
at com.sun.javaws.JnlpxArgs.execProgram(Unknown Source)
at com.sun.javaws.Launcher.relaunch(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).
I have jdk 1.7 on my machine and any how some jar in JRE lib was missing or corrupted. I have resinstalled the JRE and it worked for me. I would suggest to figure out jar that is not getting picked up from jnlp file and relplace them and see if it works.
Related
I Have an Applet application and I am migrating this to JWS. When I Run it in a browser (Applet), it's fine and I made the JNLP file to download the application to the local machine. When I put the jnlp file in some folder that doesn't contain the 'international.properties' files it doens't work, but if I put this in the same folder it works, we have other application that does the same thing and it works. I can't really find the error. Is there anything related to cache? Is there a way to put international.properties in cache?
The error is:
java.util.MissingResourceException: Can't find bundle for base name international, locale pt_BR
at java.util.ResourceBundle.throwMissingResourceException(Unknown Source)
at java.util.ResourceBundle.getBundleImpl(Unknown Source)
at java.util.ResourceBundle.getBundle(Unknown Source)
at teste.applet.testeMainPanel.initComponents(testeMainPanel.java:687)
at teste.applet.testeMainPanel.<init>(testeMainPanel.java:62)
at teste.applet.testeApplication.initMainPanel(testeApplication.java:183)
at teste.applet.testeLoginPanel.jButton1ActionPerformed(testeLoginPanel.java:104)
at teste.applet.testeLoginPanel.access$000(testeLoginPanel.java:12)
at teste.applet.testeLoginPanel$1.actionPerformed(testeLoginPanel.java:81)
at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)
at java.awt.AWTEventMulticaster.mouseReleased(Unknown Source)
at java.awt.Component.processMouseEvent(Unknown Source)
at javax.swing.JComponent.processMouseEvent(Unknown Source)
java.lang.NullPointerException
at java.awt.Container.addImpl(Unknown Source)
at java.awt.Container.add(Unknown Source)
at teste.applet.testeMainFrame.<init>(testeMainFrame.java:21)
at teste.applet.testeApplication.initMainFrame(testeApplication.java:167)
at teste.applet.testeLoginPanel.jButton1ActionPerformed(testeLoginPanel.java:105)
at teste.applet.testeLoginPanel.access$000(testeLoginPanel.java:12)
Exception in thread "AWT-EventQueue-2" java.lang.NullPointerException
at teste.applet.testeApplication.initMainFrame(testeApplication.java:177)
at teste.applet.testeLoginPanel.jButton1ActionPerformed(testeLoginPanel.java:105)
at teste.applet.testeLoginPanel.access$000(testeLoginPanel.java:12)
at teste.applet.testeLoginPanel$1.actionPerformed(testeLoginPanel.java:81)
The JNLP file is:
<?xml version="1.0" encoding="utf-8"?>
<jnlp spec="1.0+" codebase="http://path/teste/" href="teste.jnlp">
<information>
<title>TesteDesktop</title>
<vendor>FACTORY</vendor>
<homepage href="www.factory.com.br"/>
<description>TESTE WebStart</description>
<icon kind="shortcut" href="imagens/teste.ico"/>
<icon href="imagens/splash_screen_teste.png" kind="splash"/>
<shortcut online="true">
<desktop/>
<menu submenu="TESTE"/>
</shortcut>
</information>
<security>
<all-permissions />
</security>
<application-desc main-class="teste.applet.testeApplication">
<argument>http://path/teste/</argument>
<argument>PORTUGUESE</argument>
<argument>F</argument>
</application-desc>
<resources>
<j2se version="1.6+"/>
<jar eager="true" href="teste.jar" main="true"/>
</resources>
</jnlp>
I am trying to make a Java Web Start application using the Web Start tool in NetBeans 8.0. I followed the directions from NetBeans, but I get the following exception:
java.lang.NumberFormatException: For input string: "\Users\maxerdwien\Desktop\ConverterPrj\ConverterPrj\dist"
at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
at java.lang.Integer.parseInt(Integer.java:492)
at java.lang.Integer.parseInt(Integer.java:527)
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(Thread.java:745)
This problem is a closed bug of NetBeans and has been discussed on Stack Overflow, but I am using Java 7 update 65. I suspect that the reason it worked for Tomas Zezula (who closed the bug) is that he did not set the project configuration to 'Web Start'. This step is not stated in the NetBeans tutorial, but without it NetBeans will bypass the jnlp entirely and just run the jar.
The program works when run from the jar directly.
I have determined that the 'input string' is not coming from the codebase property in the jnlp; I suspect it is coming from the manifest.
Any advice on how to fix this within NetBeans or outside it would be very appreciated.
Edit: Here is the generated jnlp:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<jnlp codebase="file:/C:/Users/maxerdwien/Desktop/ConverterPrj/ConverterPrj/dist/" href="launch.jnlp" spec="1.0+">
<information>
<title>ConverterPrj</title>
<vendor>maxerdwien</vendor>
<homepage href=""/>
<description>ConverterPrj</description>
<description kind="short">ConverterPrj</description>
<offline-allowed/>
</information>
<update check="background"/>
<security>
<all-permissions/>
</security>
<resources>
<j2se version="1.7+"/>
<jar href="ConverterPrj.jar" main="true"/>
</resources>
<application-desc main-class="Converter">
</application-desc>
Edit: And here is the report from JaNeLA:
JaNeLA Report - version 11.05.17
Report for file:/C:/Users/maxerdwien/Desktop/ConverterPrj/ConverterPrj/dist/launch.jnlp
Content type application/xml does not equal expected type of application/x-java-jnlp-file
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.
XML encoding not known, but declared as UTF-8
Downloads can be optimized by specifying a resource size for 'ConverterPrj.jar'.
The resource download at ConverterPrj.jar can be optimized by removing the (default) value of download='eager'.
Lazy downloads might not work as expected for ConverterPrj.jar unless the download 'part' is specified.
Hi, I have a java swing application, I want to start it via jnlp, I configured my project web start configuration but when I push the launch button doesn't work. Do you know why?
Here is the error
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)
With just this error we can only tell you that your problem is happening because of a parseInt on a String that is not an int.
To correct this you have two possibilities :
add try{}catch(NumberFormatException e){//show error}
Assert that you have the proper things into parseInt ;)
I have the same issue.
Netbeans 8.01, JDK 1.8u20, JRE project,
Run option:
'run as webstart' enabled.
Application/Webstart options:
Created Certificates Keystore (Tip: i used 'portecle' )
Codebase: Local execution (by which the preview shows: 'file:/C:/..../')
The JNLP which is created by the project says;
<?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>
When I try to start my java web start app i got this error:
com.sun.deploy.net.FailedDownloadException: Unable to load resource: http://localhost:8080/blog/WebStartApp.jar
at com.sun.deploy.net.DownloadEngine.actionDownload(Unknown Source)
at com.sun.deploy.net.DownloadEngine.downloadResource(Unknown Source)
at com.sun.deploy.cache.ResourceProviderImpl.getResource(Unknown Source)
at com.sun.deploy.cache.ResourceProviderImpl.getResource(Unknown Source)
at com.sun.javaws.LaunchDownload$DownloadTask.call(Unknown Source)
at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
sample.jnlp
<?xml version="1.0" encoding="utf-8"?>
<jnlp spec="1.0+"
codebase="http://localhost:8080/blog/"
href="sample.jnlp">
<information>
<title>Sample JWS application</title>
<vendor>JBoss tutorials</vendor>
<description>JWS on JBoss Demo</description>
</information>
<secruity>
<all-permissions/>
</secruity>
<resources>
<jar href="WebStartApp.jar"/>
<j2se version="1.6.10+"
href="http://java.sun.com/products/autodl/j2se" java-vm-args="-Djava.net.preferIPv4Stack=true"/>
</resources>
<application-desc main-class="webStartClasses.App"/>
</jnlp>
Jnlp and jar files are placed in .war file which is deployed on JBoss server
How fix this ?
You spelled security wrong, you said secruity.
I new to web-start and We are using exe4j to create executable from One-jar. In-order to make a "web start version" of our application I am trying to lunch One-JAR using web start with the specified Main-Class but I am getting the following error -
java.security.AccessControlException: access denied (java.util.PropertyPermission one-jar.main-class read)
at java.security.AccessControlContext.checkPermission(Unknown Source)
at java.security.AccessController.checkPermission(Unknown Source)
at java.lang.SecurityManager.checkPermission(Unknown Source)
at java.lang.SecurityManager.checkPropertyAccess(Unknown Source)
at java.lang.System.getProperty(Unknown Source)
at com.simontuffs.onejar.Boot.run(Boot.java:186)
at com.simontuffs.onejar.Boot.main(Boot.java:137)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.sun.javaws.Launcher.executeApplication(Unknown Source)
at com.sun.javaws.Launcher.executeMainClass(Unknown Source)
at com.sun.javaws.Launcher.doLaunchApp(Unknown Source)
at com.sun.javaws.Launcher.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
JNLP contains --
<?xml version="1.0" encoding="UTF-8"?>
<jnlp spec="1.0+" codebase="" href="">
<information>
<title>Applet Takes Params</title>
<vendor>Protype example</vendor>
</information>
<resources>
<!-- Application Resources -->
<j2se version="1.5+"
href="http://java.sun.com/products/autodl/j2se"/>
<jar href="Application.jar" main="true" />
</resources>
<application-desc main-class="com.simontuffs.onejar.Boot">
</application-desc>
<update check="background"/>
</jnlp>
I am trying to launch a Application.jar directly and com.simontuffs.onejar.Boot is the main class specify for JAR. I am also found this link that says we can not launch One-Jar with web-start. please help.
access denied (java.util.PropertyPermission one-jar.main-class read)
A web start app. can access any property if it declares all-permissions. If it is sand-boxed, it can only access properties prefixed with jnlp & some other JRE properties that are considered 'safe'.