3 Replies Latest reply: Jul 6, 2012 12:02 AM by Stuart Douglas RSS

org.jboss.modules.ModuleClassLoader cannot be cast to java.net.URLClassLoader

kewen zhu Newbie

hello,

 

some of my code depends on java.net.URLClassLoader, so when i upgrade from jboss4 to as 7, org.jboss.modules.ModuleClassLoader cannot be cast to java.net.URLClassLoader exception happened. what i wonder is if we can choose a classloader instead of ModuleClassLoader?

 

Here is my code

URLClassLoader classLoader = (URLClassLoader) DispatcherConfigurationParser.class.getClassLoader();

URL[] urls = classLoader.getURLs();

 

or are there other ways to resolve this issue? i don't want to depend on ModuleClassLoader in my code, because it means i have to run my application in jboss 7.