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



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').



Greg Guerin wrote:

In general, I'd use the following, unless there's a good reason not to and you're taking a null ClassLoader possibility into account.

rslt = this.getClass().getResource(name);

I vaguely remember that there was a reason to use the ClassLoader rather than the Class, but it's lost in the mists of my memory. I guess I can try changing the code and see if it makes a difference, even if the chances are small - having most of our Mac users dead in the water without a workaround isn't pleasant.



Thanks, Nick _______________________________________________ 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


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.