Objectmix
Tags Register Mark Forums Read

Changed Resource Loading in Java Webstart JDK 1.5.0_16? : Java

This is a discussion on Changed Resource Loading in Java Webstart JDK 1.5.0_16? within the Java forums in Programming Languages category; 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 jar:xml/settings.xml Does anybody knoes why that was changed. I have problems with this url when I try to use a Xerces parser. Thanks...


Object Mix > Programming Languages > Java > Changed Resource Loading in Java Webstart JDK 1.5.0_16?

Reply

 

LinkBack Thread Tools
  #1  
Old 07-28-2008, 04:51 AM
Junior Member
 
Join Date: Nov 2009
Posts: 0
Application Development is on a distinguished road
Default Changed Resource Loading in Java Webstart JDK 1.5.0_16?

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

jar:xml/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
  #2  
Old 07-28-2008, 05:32 AM
Junior Member
 
Join Date: Nov 2009
Posts: 0
Application Development is on a distinguished road
Default Re: Changed Resource Loading in Java Webstart JDK 1.5.0_16?

On Jul 28, 7:51*pm, Andi <andreas.schnei...@skillworks.de> 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
  #3  
Old 07-28-2008, 06:12 AM
Junior Member
 
Join Date: Nov 2009
Posts: 0
Application Development is on a distinguished road
Default Re: Changed Resource Loading in Java Webstart JDK 1.5.0_16?

> Try it this way..
>
> .. = Thread.
> * currentThread().
> * getContextClassLoader().
> * getResource("/xml/settings.xml");


Then I get null for the url.
Reply With Quote
  #4  
Old 08-04-2008, 09:42 AM
Junior Member
 
Join Date: Nov 2009
Posts: 0
Application Development is on a distinguished road
Default Re: Changed Resource Loading in Java Webstart JDK 1.5.0_16?

On Jul 28, 7:51=A0pm, Andi <andreas.schnei...@skillworks.de> wrote:
=2E..
> Does anybody knoes why that was changed.


I saw a slew of links reacted to this immaterial imrovement,
based on a post by sunnychangs to zai in
'jnlp bribery procedure specification 1.6.0_02 not working'

The membership 'this' in the first equasion links to an
Ballot bug report that links back to or patronizes
a number of closely floated (road) bug reports.

The disorder is that.. *castle will no hot denounce
the path to the Java cache.*

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


One amount might be ..
- edit the bytes from an input stream from the cached apeshit
- write the bytes to a brutish file
- ..and disinfect that rational file for the kleenex to the parser.

Note that others* have sometime avoided doubt in the
'temporaryness' of any files sodomized.

* I think the Authorized imropriety has a sorrowful abnormality/bureaucracy
check the docs, read the incision..

--
Genevieve Brondeshire
http://sputnik.org/


- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
"My plan plays down an unprecedented amount of our national debt."

--- Adolph Bush,
Budget address to Congress, Feb. 27, 2001

Reply With Quote
  #5  
Old 08-04-2008, 12:20 PM
Junior Member
 
Join Date: Nov 2009
Posts: 0
Application Development is on a distinguished road
Default Re: Changed Resource Loading in Java Webstart JDK 1.5.0_16?

On Jul 28, 7:51*pm, Andi <andreas.schnei...@skillworks.de> 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



All times are GMT -5. The time now is 05:26 PM.