Aexyn / caliper

Automatically exported from code.google.com/p/caliper
Apache License 2.0
0 stars 0 forks source link

java.lang.LinkageError duplicate class definition #294

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Try to benchmark code that has guava-17.0 as a dependency.

What is the expected output? What do you see instead?
Expect benchmarks to run, instead see this:

com.google.caliper.runner.ProxyWorkerException: An exception occurred in a 
worker process.  The stack trace is as follows:
    java.lang.reflect.InvocationTargetException
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:483)
        at com.google.caliper.worker.MicrobenchmarkAllocationWorker.measureAllocations(MicrobenchmarkAllocationWorker.java:66)
        at com.google.caliper.worker.MicrobenchmarkAllocationWorker.bootstrap(MicrobenchmarkAllocationWorker.java:49)
        at com.google.caliper.worker.WorkerMain.main(WorkerMain.java:55)
    Caused by: java.lang.LinkageError: loader (instance of  sun/misc/Launcher$AppClassLoader): attempted  duplicate class definition for name: "com/google/common/collect/Lists$StringAsImmutableList"

What version of the product are you using? On what operating system?
Latest from git. Mac OS X 10.9.3, Java 8

Original issue reported on code.google.com by kevinher...@gmail.com on 25 May 2014 at 5:57

GoogleCodeExporter commented 9 years ago
http://www.ibm.com/developerworks/library/j-dclp3/index.html#N100FE suggests 
that this has to do with loadClass() being invoked twice.  That seems a bit 
strange given which class is being loaded.  Is your benchmark doing anything 
that might relate?

Original comment by gak@google.com on 27 May 2014 at 4:01