What does JVM flag CMSClassUnloadingEnabled actually do?

I cannot for the life of me find a definition of what the Java VM flag CMSClassUnloadingEnabled actually does, other than some very fuzzy high-level definitions such as “gets rid of your PermGen problems” (which it doesn’t, btw). I have looked on Sun’s/Oracle’s site, and even the options list doesn’t actually say what it does. … Read more

URL to load resources from the classpath in Java

In Java, you can load all kinds of resources using the same API but with different URL protocols: file:///tmp.txt http://127.0.0.1:8080/a.properties jar:http://www.foo.com/bar/baz.jar!/COM/foo/Quux.class This nicely decouples the actual loading of the resource from the application that needs the resource, and since a URL is just a String, resource loading is also very easily configurable. Is there a … Read more

What is the difference between Class.getResource() and ClassLoader.getResource()?

I wonder what the difference is between Class.getResource() and ClassLoader.getResource()? edit: I especially want to know if any caching is involved on file/directory level. As in “are directory listings cached in the Class version?” AFAIK the following should essentially do the same, but they are not: getClass().getResource() getClass().getClassLoader().getResource() I discovered this when fiddling with some … Read more

Dealing with “Xerces hell” in Java/Maven?

In my office, the mere mention of the word Xerces is enough to incite murderous rage from developers. A cursory glance at the other Xerces questions on SO seem to indicate that almost all Maven users are “touched” by this problem at some point. Unfortunately, understanding the problem requires a bit of knowledge about the … Read more