Atrus
Atrus

Reputation: 798

jars not signed when lauched in browser, but not in javaws

I have a small webstart application on a local webserver, accesable at localhost:5000/games/game.jnlp accessing that through Firefox and Chromium leads to the following error:

net.sourceforge.jnlp.LaunchException: Fatal: Initialization Error: Could not initialize application. 
    at net.sourceforge.jnlp.Launcher.createApplication(Launcher.java:778)
    at net.sourceforge.jnlp.Launcher.launchApplication(Launcher.java:552)
    at net.sourceforge.jnlp.Launcher$TgThread.run(Launcher.java:889)
Caused by: net.sourceforge.jnlp.LaunchException: Fatal: Application Error: Cannot grant permissions to unsigned jars. Application requested security permissions, but jars are not signed.
    at net.sourceforge.jnlp.runtime.JNLPClassLoader.setSecurity(JNLPClassLoader.java:312)
    at net.sourceforge.jnlp.runtime.JNLPClassLoader.<init>(JNLPClassLoader.java:232)
    at net.sourceforge.jnlp.runtime.JNLPClassLoader.getInstance(JNLPClassLoader.java:357)
    at net.sourceforge.jnlp.runtime.JNLPClassLoader.getInstance(JNLPClassLoader.java:330)
    at net.sourceforge.jnlp.Launcher.createApplication(Launcher.java:770)
    ... 2 more

which pops up in the Swing style error message.

My JNLP file:

<?xml version="1.0" encoding="utf-8"?>
  <jnlp
    spec="1.0+"
    href="game.jnlp"
    >

  <information>
    <title>Space Shapes</title>
    <vendor>WorldsProject</vendor>
    <homepage href="http://www.worldsproject.org"/>
    <description>A game where you must shoot shapes in space.</description>
    <description kind="short">A game where you must shoot shapes in space.</description>
  </information> 
  <security>
    <all-permissions/>
  </security>   
  <resources>
    <j2se href="http://java.sun.com/products/autodl/j2se" version="1.4+" max-heap-size="512m"/>
    <jar href="game.jar"/>  
    <jar href="resources.jar"/>
    <jar href="slick.jar"/>
    <jar href="jogg-0.0.7.jar"/>    
    <jar href="jorbis-0.0.15.jar"/>
    <jar href="lwjgl.jar"/>
    <nativelib href="lwjgl-libs.jar"/>
  </resources>

  <application-desc main-class="org.worldsproject.fluxware.spaceshapes.SpaceShapesGame"/>

</jnlp>

I've confirmed everything is signed correctly with

jarsigner -verify -certs -verbose

I've look at the jnlp with JaNeLA, all green and yellow messages, no errors at all. I've tested other webstarts, all of which work, except mine.

EDIT, a link to all my jars and jnlp file: https://www.dropbox.com/sh/hzagv1e4t4jr43t/WA-LVXp5tc

Upvotes: 0

Views: 5813

Answers (1)

holmes840
holmes840

Reputation: 1073

If your jnlp is initializing using command line then you need to set that location of javaws (Sun JDK) in your browser too i.e when your browser aks to open your javaws application give path to your sun java location.

And also if the href denotes a relative URL, it must reference a location that is a subdirectory of the codebase. Specify URL in your codebase.

Upvotes: 1

Related Questions