[jboss-user] [Installation, Configuration & DEPLOYMENT] - Classloading issue confirmation needed

lucdew do-not-reply at jboss.com
Thu Feb 21 17:15:10 EST 2008


in a library within a JBoss ESB archive or SAR archive, the following code is performed to find annotated classes:

  | ClassLoader cl = Thread.currentThread().getContextClassLoader();
  | URL[] urls = cl.getURLs();

The problem is that the urls array returned is always empty. I was expecting to have URLs of libraries packages in my ESB archive. (The code is executed within a library in the archive).

The same code executed within a Web application does not return an empty array.

Trying to find out what the problem was, i had a look the RepositoryClassLoader class that overrides the URLClassLoader getURLs method with:
  |    public URL[] getURLs()
  |    {
  |       return EMPTY_URL_ARRAY;
  |    }

I also noticed that JBoss has a WebClassLoader that overrides the getURLs() method with a totally different behaviour.

Would you know another way to find annotated classes in a ESB, SAR JBoss archive ?

Thanks in advance. 

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4131230#4131230

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4131230

More information about the jboss-user mailing list