views:

444

answers:

2

Our application uses the MapMaker class from Google collections, and we're getting the exception below, but only on OS X 10.4 using webstart. It works fine when launched from an app bundle, and on OS X 10.5 and Windows.

This has started happening since our upgrade from RC2 to RC5 (we skipped all the intervening versions). We've since upgraded to 1.0 final and still see the issue.

I suspect some interaction with Sun's fix for this security issue (which changed the way that URL.toString() works in webstart), but don't have any proof yet. Has anyone seen this problem before? Any help is greatly appreciated!

java.lang.NoClassDefFoundError: com/google/common/base/internal/Finalizer$ShutDown (wrong name: com/google/common/base/internal/Finalizer)
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
at java.net.URLClassLoader.access$100(URLClassLoader.java:56)
at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Class.java:2395)
at java.lang.Class.getMethod0(Class.java:2642)
at java.lang.Class.getMethod(Class.java:1579)
at com.google.common.base.FinalizableReferenceQueue.getStartFinalizer(FinalizableReferenceQueue.java:308)
at com.google.common.base.FinalizableReferenceQueue.<clinit>(FinalizableReferenceQueue.java:102)
at com.google.common.collect.MapMaker$QueueHolder.<clinit>(MapMaker.java:836)
at com.google.common.collect.MapMaker$SoftValueReference.<init>(MapMaker.java:1078)
at com.google.common.collect.MapMaker$Strength$2.referenceValue(MapMaker.java:379)
at com.google.common.collect.MapMaker$StrategyImpl.setValue(MapMaker.java:488)
at com.google.common.collect.MapMaker$StrategyImpl.setValue(MapMaker.java:462)
at com.google.common.collect.CustomConcurrentHashMap$Impl$Segment.put(CustomConcurrentHashMap.java:960)
at com.google.common.collect.CustomConcurrentHashMap$Impl.put(CustomConcurrentHashMap.java:1438)`

There doesn't appear to be anything interesting in the manifest:

$ unzip -p google-collect.jar META-INF/MANIFEST.MF
Manifest-Version: 1.0
Ant-Version: Apache Ant 1.7.0
Created-By: 10.0-b19 (Sun Microsystems Inc.)
A: 

I suggest that you check the manifest.mf file of your jar. Presumably webstart uses a URLClassLoader, so it follows the explanation here to locate other jars.

It sounds like webstart can't find the google library that you are using. This could be related to the fix that you mentioned.

Edit: adding the correct link here -> http://java.sun.com/developer/Books/javaprogramming/JAR/basics/manifest.html#download

Yoni
Your link doesn't work.
Matt McHenry
+1  A: 

In a case like this, it seems much more appropriate to file a bug with the Guava project, rather than ask for help on SO, but I'm struggling to explain why exactly I think so.

I guess this stack trace just seems much more likely to be a bug or a deeper issue in the platform, than something you're doing wrong in the way you're using the library.

Kevin Bourrillion
Done: http://code.google.com/p/guava-libraries/issues/detail?id=312
Matt McHenry