Q:

Applet loads jars from different domains; has problem loading resources (e.g. images) from jars

I have a sandboxed Applet, but that should not make a difference.
The Applet consists of 2 jars. If I host both files on the same domain1 all is fine. Due to certain special circumstances I need to host jar2 on a different domain2.
In the applet tag I list both files archive="jar1.jar, http://domain2.com/jar2.jar". 
First it seems to be working great. Both jars are loaded and everything works fine. Still, as soon as I try to access a resource (like an image) from INSIDE one of the jars there is a problem. 
How do I get resources from my jars?
I get resources by first getting an URL for the location of the resource:
public static URL getURL(String name)  {return ResUtils.class.getResource(path);}
If I host both jars on domain1 this method returns an URL. When hosted on two domains getURL(...) returns NULL which then results in an Exception when fetching the resource:
Caused by: java.lang.IllegalArgumentException: input == null!
    at javax.imageio.ImageIO.read(Unknown Source)

I guess ResUtils.class.getResource uses its Classloader to return an URL. For some reason when hosting both jars on two domains add calls to getRessource() return NULL.
So my question is:

Why does getURL return NULL?

Is the Java plugin designed to disallow hosting those jars on different domains? 
How do I have to load my resources when I host the jars on different domains?

A:

Try something like this:
      ClassLoader cl = Thread.currentThread().getContextClassLoader();
      URL url = cl.getResource("imagename.gif");
      System.out.println("URL is: " + url);
      ImageIcon icon = new ImageIcon(url);

Using the context classloader is generally the best way to load images from jar files.
Edit1:  BTW, I am surprised that the first suggestion did not work.  If memory serves me right, the Thread.currentThread().getContextClassLoader() suggestion should have given you a reference to a classloader that could have located resources from either jar file.
Edit2:  none of the above works in this case.  Curiosity got the best of me so I had to try it.  The plugin classloader just seems too confused to load resources from jar files hosted on another server, even though it has no problems loading classes.  What I found is that a manual method does work to load resources like this:
  String manualString = "jar:http://spider.grunt.webhop.net/clubjar.jar!/club.gif";
  URL manualURL = new URL(manualString);
  BufferedImage buf = ImageIO.read(manualURL);
  System.out.println("manual buf: " +buf);

To me, this looks like a bug with the plugin classloader.  We should be able to use the classloader getResource() or getResourceAsStream() methods to locate a valid resource.  Not so in this case.  The ImageIO class can read our manual URL, but the classloader cannot give us one.

