Skip to Main Content

Java SE (Java Platform, Standard Edition)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

JNLPException[category: Security Error : Exception: null : LaunchDesc:

843802Apr 11 2010 — edited Apr 11 2010
Hi ,

I am launching a JNLP app. through the tomcat server, this is the Exception stacktrace i am getting:-

JNLPException[category: Security Error : Exception: null : LaunchDesc:
<jnlp spec="1.0" codebase="http://localhost:8080/JNLP_Test_Web1/" href="http://localhost:8080/JNLP_Test_Web1/jnlptest.jnlp">
<information>
<title>JNLP Spreadsheet Demo</title>
<vendor>MadhuR</vendor>
<homepage href="null"/>
<description kind="one-line">
Test of the JNLP file API - 'always allow'
</description>
<shortcut online="false">
<desktop/>
</shortcut>
<association extensions="zzz" mime-type="text/sleepytime"/>
</information>
<security>
<all-permissions/>
</security>
<update check="timeout" policy="always"/>
<resources>
<property name="jnlp.file.extension" value="zzz"/>
<java version="1.5+"/>
<jar href="http://localhost:8080/JNLP_Test_Web1/filetest.jar" download="eager" main="true"/>
<jar href="http://localhost:8080/JNLP_Test_Web1/essd10.jar" download="eager" main="false"/>
</resources>
<application-desc main-class="test.TestJBookApp"/>
</jnlp> ]
at com.sun.javaws.LaunchDownload.checkSignedResourcesHelper(Unknown Source)
at com.sun.javaws.LaunchDownload.checkSignedResources(Unknown Source)
at com.sun.javaws.Launcher.prepareLaunchFile(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$1.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)


Here is my JNLP file:-


<?xml version='1.0' encoding='UTF-8' ?>
<jnlp spec='1.0'
codebase='http://localhost:8080/JNLP_Test_Web1'
href='jnlptest.jnlp'>
<information>
<title>JNLP Spreadsheet Demo</title>
<vendor>MadhuR</vendor>
<description kind='one-line'>
Test of the JNLP file API - 'always allow'
</description>
<!-- Web-start will attempt* to associate this
file extension/type with our application.
* it will ask the user, in any case -->
<association
extensions="zzz"
mime-type="text/sleepytime" />
<shortcut online='false'>
<desktop/>
</shortcut>
</information>
<!-- This example also works with no permissions at all,
though the behaviour (in regards to prompts) is slightly
different. To observe the behaviour of the sandboxed
example, simply delete the entire <security /> element. -->
<security>
<all-permissions/>
</security>
<resources>
<property
name='jnlp.file.extension'
value="zzz"/>
<j2se version='1.5+' />
<jar href='filetest.jar' main='true' />
<jar href="http://localhost:8080/JNLP_Test_Web1/essd10.jar"/>
</resources>
<application-desc main-class='test.TestJBookApp' />
</jnlp>

It is throwing "unsigned application requesting unrestrcied access to the system", it seems that signed cerficate is not available for the JAR (essd10.jar)? Whether it is be re-assigned? If so how to do it. This is my build.xml:-

<project basedir="." default="launch" name="JNLP_Test_Web1">

<target name="properties">
<property name="build" value="build" />
<property name="dist" value="dist" />
<property name="src" value="src" />
<property name="WebRoot" value="WebRoot" />
<property name="lib" value="${WebRoot}/WEB-INF/lib"/>
<property name="main-class" value="test.TestJBookApp"/>

<!-- Pot luck guess at location of
suitable 'web-start' jar. -->
<!--property
name="classpath"
value="${java.home}/lib/javaws.jar" /-->

<path id="compile.classpath">
<fileset dir="${lib}" includes="*.jar"/>
</path>

<!--property
name="classpath"
value="${lib}/*.jar" /-->



<!-- Web-start will prompt the user to associate this
file type with the application. Change if it clashes
with an existing file type. -->
<property
name="file.extension"
value="zzz" />
<property
name="file.content-type"
value="text/sleepytime" />
</target>




<target
name="compile"
depends="properties"
description="Compile the project" >
<mkdir dir="${build}/share" />
<javac
debug="on"
destdir="${build}/share"
srcdir="${src}/test"
source="1.2"
>
<classpath>
<pathelement path="${classpath}"/>
<fileset dir="${lib}">
<include name="**/*.jar"/>
</fileset>
</classpath>
</javac>


<copy todir="${build}/share">
<fileset dir="${src}/test">
<exclude name="**/CVS" />
<exclude name="**/*.java" />
</fileset>
</copy>
</target>

<target
name="dist"
depends="compile"
description="Create project distribution" >
<mkdir dir="${build}/jar" />
<manifestclasspath property="jar.classpath" jarfile="${WebRoot}/filetest.jar">
<classpath refid="compile.classpath"/>
</manifestclasspath>

<jar destfile="${WebRoot}/filetest.jar">
<fileset dir="${build}/share">
<include name="**/*.class" />
</fileset>
<manifest>
<attribute name="Main-Class" value="${main-class}"/>
<attribute name="Class-Path" value="${jar.classpath}"/>
</manifest>
</jar>
<!-- Generate the keystore -->
<delete file="filetest.keystore" />
<genkey alias="filetest"
storepass="secret"
keystore="filetest.keystore"
verbose="true">
<dname>
<param name="CN" value="MadhuR"/>
<param name="OU" value="JNLP Test"/>
<param name="O" value="http://localhost:8080"/>
<param name="C" value="CI"/>
</dname>
</genkey>
<!-- Sign the jar (required only for trusted launch) -->
<signjar
jar="${WebRoot}/filetest.jar"
alias="filetest"
storepass="secret"
keystore="filetest.keystore" />
</target>

<target
name="make-launch-file"
depends="properties"
description="Copies and configures the launch file" >
<copy todir="${build}/jar" >
<fileset dir="${src}/conf" >
<include name="**/*.jnlp" />
</fileset>
</copy>

<replace dir="${build}/jar/">
<include name="**/*.jnlp" />
<replacefilter
token="%file.extension%"
value="${file.extension}" />
<replacefilter
token="%file.content-type%"
value="${file.content-type}" />
</replace>
</target>

<target
name="launch"
depends="dist, make-launch-file"
description="Launch the project using webstart">
<exec executable="javaws"
dir="${WebRoot}">
<arg line="http://localhost:8080/JNLP_Test_Web1/jnlptest.jnlp" />
<!-- arg line="http://localhost:8080/JNLP_Test_Web1/filechooserdemo.jnlp" /-->
</exec>
</target>

</project>

I am using jdk 1.6 and tomcat 6.0 . Please do correct me where i have gone wrong, I am stuck with this. Please do respond.

Thanks,
Rithu

Comments

Processing
Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on May 9 2010
Added on Apr 11 2010
1 comment
5,017 views