Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: resource URLs broken in JWS




On Sep 30, 2008, at 6:08 PM, Nick Howes wrote:

Doug Zwick wrote:

There is a subtlety about this when using WebStart. JWS uses its own ClassLoader instance to load classes from the resource JARs, and the default loader to load the Toolbox (and other classes from the BOOTCLASSPATH). This may account for the problem. When the resource bundle is in a JNLP resource JARs, you should use the JWS ClassLoader to fetch them. To do this, use one of your own classes instead of Toolbox, obtain its class loader, and use that to fetch the resource:

The 'Toolbox' class I use is my own class (com.bardac.dw1.tools.Toolbox), not a system class (in fact, I'm not aware of any system class called 'Toolbox').

To see if it makes any difference what does

ClassLoader mine = this.getClass().getClassLoader();
ClassLoader clazz = Toolbox.class.getClassLoader();
ClassLoader tb = new Toolbox().getClassLoader();

System.out.println("mine=" + mine + " class " + clazz + " Toolbox " + tb);

show. If 'this' is a Toolbox instance you could skip that. I'm assuming a no args constructor for that, but however you really get a instance.

Mike Hall        hallmike at att dot net
http://www.geocities.com/mik3hall
http://sourceforge.net/projects/macnative



_______________________________________________
Do not post admin requests to the list. They will be ignored.
Java-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/java-dev/email@hidden

This email sent to email@hidden
References: 
 >Re: resource URLs broken in JWS (From: Nick Howes <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.