Unable to load resources using JNLP

I was browsing through the tech-tip dated May 30th 2001 dealing with JNLP. After building the jar file I deployed it on BEA weblogic server 6.0 making

sure I followed all the instructions listed on pg 3. I get the following error while downloading the resources and would appreciate if you could let me know where the problem lies:

An error occurred while launching/running the application.

Title: Hello

Vendor: Tech Tips Sample May 2001

Category: Download Error

Unable to load resource: http://pkrishna:7001/webstart/Hello.jnlp

Here is the launch file:

<?xml version="1.0" encoding="UTF-8"?>

<!-- file Hello.jnlp --> <jnlp

codebase="http://pkrishna:7001/webstart"

href="http://pkrishna:7001/webstart/Hello.jnlp"> <information>

<title>Hello</title>

<vendor>Tech Tips Sample May 2001</vendor>

<icon href="HelloJNLP.jpg" />

</information>

<resources>

<j2seversion="1.2+"/>

<jar href="webstart.jar" />

</resources>

<application-desc main-class="HelloJNLP"/>

</jnlp>

Detailed Exception:

NLPException[category: Download Error : Exception: java.io.IOException: HTTP

response 404 : LaunchDesc: null ] at

com.sun.javaws.cache.DownloadProtocol.doDownload(Unknown Source) at

com.sun.javaws.cache.DownloadProtocol.isLaunchFileUpdateAvailable(Unknown

Source) at com.sun.javaws.LaunchDownload.getUpdatedLaunchDesc(Unknown

Source) at com.sun.javaws.Launcher.downloadResources(Unknown Source) at

com.sun.javaws.Launcher.handleApplicationDesc(Unknown Source) at

com.sun.javaws.Launcher.handleLaunchFile(Unknown Source) at

com.sun.javaws.Launcher.run(Unknown Source) at

java.lang.Thread.run(Thread.java:484)

[1920 byte] By [prabhakark] at [2007-9-26 4:21:54]
# 1
Change your href attribute value from " http://pkrishna:7001/webstart/Hello.jnlp" to "Hello.jnlp"
jext at 2007-6-29 17:26:27 > top of Java-index,Desktop,Deploying...
# 2

Hello:

I changed the href to Hello.jnlp as you suggested. Now, when I browse to hello.jnlp, I get a dialog box saying that I am trying to download a file of type JNLP. After I save it in the directory, nothing really happens. I looked at the directory where the files were saved and what was saved was only the JNLP file and nothing else. I expected both the webstart.jar and image file to be downloaded too. I am trying this on Windows 2000 using IE 5.5. Is there a patch for webstart which is supposed to fix this?

I appreciate if someone could clarify this for me.

Thanks

Prabhakar

prabhakark at 2007-6-29 17:26:27 > top of Java-index,Desktop,Deploying...
# 3

> I changed the href to Hello.jnlp as you suggested.

> Now, when I browse to hello.jnlp, I get a dialog box

> saying that I am trying to download a file of type

> JNLP. After I save it in the directory, nothing really

> happens. I looked at the directory where the files

> were saved and what was saved was only the JNLP file

> and nothing else.

Which is exactly what you told the dialog box to do - dump the .jnlp.

What you really want is that that "javaws.exe" is run with the URL of the .jnlp file as argument by your browser.

In case of Netscape browser you can add that association between the jnlp mime type and the javaws application to launch from the preferences dialog, for Internet Explorer I believe it is more complicated, this association seems to be encoded in the Windows registry.

Have you tried reinstalling Web Start (which should do the mime type association for your standard browser)?

Regards,

Marc

van.woerkom at 2007-6-29 17:26:27 > top of Java-index,Desktop,Deploying...
# 4

Check in your windows regisitry:

HKEY_CLASSES_ROOT\MIME\Database\Content Type\

for the key "application/x-java-jnlp-file".

It should have a string value called "Extension" with the value ".jnlp".

Installing jws should put that in your windows registry for you. If not, you'll have to manually add it.

David

weird at 2007-6-29 17:26:27 > top of Java-index,Desktop,Deploying...
# 5

Marc:

I finally reinstalled webstart and as you said an association was created between .jnlp and javaws.exe. I was finally able to point to the .jnlp file in the browser(IE and Netscape), got the resources to download automatically I believe to a directory where webstart was installed and then finally load the application successfully.

Thanks for your help

Prabhakar

prabhakark at 2007-6-29 17:26:27 > top of Java-index,Desktop,Deploying...
# 6

I was trying to duplicate the example given in the 2nd part of the techtips dt 05/30/01 on JNLP.The JNLP application does not create a muffin directory and I repeatedly get an exception while retrying the application. Below is the exception I get on readEditorContents method:

java.io.FileNotFoundException: D:\Java Web Start\Java Web Start 1.0.1_01\.javaws\muffins\http\Dpkrishna\P7001\\DMwebstart\PMEditor (The system cannot find the path specified)

at java.io.FileInputStream.open(Native Method)

at java.io.FileInputStream.<init>(FileInputStream.java:64)

at com.sun.jnlp.FileContentsImpl$2.run(Unknown Source)

at java.security.AccessController.doPrivileged(Native Method)

at com.sun.jnlp.FileContentsImpl.getInputStream(Unknown Source)

at HelloJNLP.readEditorContents(HelloJNLP.java:92)

at HelloJNLP.<init>(HelloJNLP.java:19)

at HelloJNLP.main(HelloJNLP.java:109)

at java.lang.reflect.Method.invoke(Native Method)

at com.sun.javaws.Launcher.executeApplication(Unknown Source)

at com.sun.javaws.Launcher.executeMainClass(Unknown Source)

at com.sun.javaws.Launcher.continueLaunch(Unknown Source)

at com.sun.javaws.Launcher.handleApplicationDesc(Unknown Source)

at com.sun.javaws.Launcher.handleLaunchFile(Unknown Source)

at com.sun.javaws.Launcher.run(Unknown Source)

at java.lang.Thread.run(Thread.java:484)

I believe the above exception is thrown because muffin directory does not exist on my hard drive. I also get the following exception in the writeEditorConents method:

javax.jnlp.UnavailableServiceException: javax.jnlp.PersistentService

at com.sun.jnlp.JnlpLookupStub.lookup(Unknown Source)

at javax.jnlp.ServiceManager.lookup(Unknown Source)

at HelloJNLP.writeEditorContents(HelloJNLP.java:51)

at HelloJNLP.access$0(HelloJNLP.java:48)

at HelloJNLP$1.windowClosed(HelloJNLP.java:32)

at java.awt.AWTEventMulticaster.windowClosed(AWTEventMulticaster.java:300)

at java.awt.Window.processWindowEvent(Window.java:801)

at javax.swing.JFrame.processWindowEvent(JFrame.java:241)

at java.awt.Window.processEvent(Window.java:774)

at java.awt.Component.dispatchEventImpl(Component.java:2595)

at java.awt.Container.dispatchEventImpl(Container.java:1213)

at java.awt.Window.dispatchEventImpl(Window.java:912)

at java.awt.Component.dispatchEvent(Component.java:2499)

at java.awt.EventQueue.dispatchEvent(EventQueue.java:319)

at java.awt.EventDispatchThread.pumpOneEvent(EventDispatchThread.java:103)

at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)

at java.awt.EventDispatchThread.run(EventDispatchThread.java:84)

Is there something I am missing here?

prabhakark at 2007-6-29 17:26:27 > top of Java-index,Desktop,Deploying...