Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Changed Resource Loading in Java Webstart JDK 1.5.0_16?

Reply
Thread Tools

Changed Resource Loading in Java Webstart JDK 1.5.0_16?

 
 
Andi
Guest
Posts: n/a
 
      07-28-2008
Hi,

I have a small webstart application. I am loading a xml file from a
jar file.

URL url = Program.class.getResource("/xml/settings.xml");

In Java Webstart of JDK 1.5.0_15 and JDK 1.6.0_7 I got following URL:

jar:file:[Path to jar file]!/xml/settings.xml

In JDK 1.5.0_16 I got

jarml/settings.xml

Does anybody knoes why that was changed. I have problems with this url
when I try to use a Xerces parser.

Thanks
 
Reply With Quote
 
 
 
 
Andrew Thompson
Guest
Posts: n/a
 
      07-28-2008
On Jul 28, 7:51*pm, Andi <(E-Mail Removed)> wrote:
> Hi,
>
> I have a small webstart application. I am loading a xml file from a
> jar file.
>
> URL url = Program.class.getResource("/xml/settings.xml");


Try it this way..

.. = Thread.
currentThread().
getContextClassLoader().
getResource("/xml/settings.xml");

--
Andrew Thompson
http://pscode.org/
 
Reply With Quote
 
 
 
 
Andi
Guest
Posts: n/a
 
      07-28-2008
> Try it this way..
>
> .. = Thread.
> * currentThread().
> * getContextClassLoader().
> * getResource("/xml/settings.xml");


Then I get null for the url.
 
Reply With Quote
 
Andrew Thompson
Guest
Posts: n/a
 
      08-04-2008
On Jul 28, 7:51*pm, Andi <(E-Mail Removed)> wrote:
...
> Does anybody knoes why that was changed.


I saw a slew of links related to this general problem,
based on a post by sunnychangs to zai in
'jnlp java version specification 1.6.0_02 not working'
<http://forums.sun.com/thread.jspa?threadID=5318200>.

The word 'this' in the first sentence links to an
Eclipse bug report that links back to or mentions
a number of closely related (Sun) bug reports.

The upshot is that.. *Sun will no longer provide
the path to the Java cache.*

> ..I have problems with this url when I try to use a Xerces parser.


One suggestion might be ..
- obtain the bytes from an input stream from the cached jar
- write the bytes to a temporary file
- ..and use that temporary file for the URL to the parser.

Note that others* have already expressed doubt in the
'temporaryness' of any files created.

* I think the Eclipse thread has a similar problem/solution
check the docs, read the thread..

--
Andrew Thompson
http://pscode.org/
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Sun/Java would win BIG if they included xml based RIA in Java WebStart (think Adobe Flex) kwiatekfamily@gmail.com Java 2 03-08-2008 06:47 AM
loading native libraries with java webstart weiss.matt@gmail.com Java 0 05-10-2006 02:40 AM
Webstart / Muffin / bug found in dissassembled Sun code JDK 1.4.2_05 Stig Java 1 07-27-2004 02:21 AM
Help with converting IDS from JDK 1.1 to JDK 1.4 Babar Java 1 05-20-2004 09:11 PM
Re: Webstart & Loading ImageIcons? Andrew Thompson Java 0 07-07-2003 05:03 PM



Advertisments