When I try to include Guice jars (otherwise working in eclipse exported jar) into one-jar jar, I get the following error when executing the jar:
04.Feb.2010 11:18:29 com.google.inject.internal.FinalizableReferenceQueue$DecoupledLoader loadFinalizer
WARNING: Could not load Finalizer in its own class loader. Loading Finalizer in the current class loader instead. As a result, you will not be able to garbage collect this class loader. To support reclaiming this class loader, either resolve the underlying issue, or move Google Collections to your system class path.
java.io.IOException: Unsupported path style: onejar:com.google.inject.internal.Finalizer.class
please can you provide more detailed instructions on how to recreate this problem, and I'll take a look at it. Ideally a simple main program plus instructions on how to build it (which Guice jars are required, etc). More ideally, source-code, jars, and a build.xml file to create the one-jar.
First of all, it is not an error, but a nasty warning with full stacktrace at the start of the program. Actual program works, but guice did not like the classloader I guess.
You can download sample project at http://bit.ly/c7eP8g. You have to download guice to build, i tried to include instructions. There is also eclipse's jar-in-jar loader included, for which guice doesn't give any warning.
This is affecting us too.
The exception is thrown in this method in Guice:
…it looks like Guice expects the resource URL of a class to be separated by slashes instead of the dots as used by one-jar.
The error goes away if we set system property "guice.custom.loader" to "false", per this page:
Setting this false would cause memory leaks when guice-proxied classes are reloaded in an application. However in our app we do not reload classes on-the-fly so we are happy with this as a workaround.
A "proper" solution might be to fix this in guice, so that guice handles onejar-style resource urls. Or should one-jar be updated instead to use slashes instead of dots as separators?
Hi: thanks for tracking down the cause of this: I haven't had a chance to look into it yet. The translation of "/" to "." in one-jar was done to mirror the translation of the same in Java, from package-name to directory and back-again. I may have to revisit this, it should be possible to find something that works without proviking Guice.
Log in to post a comment.