JBoss Community

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

created by kewen zhu in JBoss AS 7 Development - View the full discussion

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.

Reply to this message by going to Community

Start a new discussion in JBoss AS 7 Development at Community