dreedyman / Rio

Rio is an open source technology that provides a dynamic architecture for developing, deploying and managing distributed systems composed of services.
Apache License 2.0
21 stars 17 forks source link

setting log level of org.rioproject.start to trace causes Webster fail to start #40

Closed rafalkrupinski closed 10 years ago

rafalkrupinski commented 10 years ago

I thing this problem is caused by both Rio and River: setting log level of org.rioproject.start causes RioServiceDescriptor to call ClassLoaderUtil.displayClassLoaderTree(serviceCL) which calls ClassLoader.getUrls() on a Rio's ServiceClassLoader. That method returns empty array (despite having webster.jar) and ClassLoaderUtil does this

URL[] urls = ((URLClassLoader)(curClassLoader)).getURLs();
if(urls != null) {
    System.out.print(urls[0]);

resulting with ArrayIndexOutOfBounds. Of course not checking urls.length>0 is a bug, but I don't think ServiceClassLoader.getUrls() should return an empty array

dreedyman commented 10 years ago

getURLs() is only ever called to get the codebase (not the classpath) of a class. Webster has no codebase. This is not a bug in Rio

rafalkrupinski commented 10 years ago

http://docs.oracle.com/javase/7/docs/api/java/net/URLClassLoader.html#getURLs%28%29

dreedyman commented 10 years ago

Not for RMI based systems, the on.y time this is called is to get the codebase. As for the aforementioned method, the semantics are clearly document:

Get the URLs to be used for class annotations as determined by the {@link org.rioproject.loader.ClassAnnotator}