This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
JDK 1.7.0_76. Attach to a running NetBeans instance. Defined 'org.netbeans.modules.refactoring.java.plugins.FindUsagesVisitor.visitMemberSelect(MemberSelectTree, Object)' as a profiling root, 10 outgoing calls, do not filter out Java classes. Invoked Find usages on a field in Java source (Java2Demo.java, constructor Java2Demo(), field performancemonitor). At some point when displaying results the error dialog appears and some debug messages are printed to the console: Profiler Agent Error: Redefinition failed for classes: javax.lang.model.SourceVersion com.sun.tools.javac.model.JavacElements Profiler Agent Error: with message: Redefinition failed with error 64 Check JVMTI documentation for this error code. Profiler Agent Error: Redefinition failed for classes: javax.lang.model.SourceVersion org.openide.loaders.DataLoaderPool$EmptyDataLoaderRecognized java.util.TreeSet org.netbeans.api.java.source.CompilationInfo java.util.concurrent.CopyOnWriteArraySet java.util.JumboEnumSet org.netbeans.lib.lexer.token.DefaultToken org.netbeans.core.windows.RegistryImpl$SyncSet org.netbeans.lib.lexer.token.TextToken org.netbeans.modules.java.hints.introduce.Flow$ReluctantSet org.netbeans.api.java.source.TreeUtilities org.netbeans.api.lexer.TokenHierarchy org.netbeans.lib.lexer.token.AbstractToken org.openide.loaders.DataNode$LazyFilesSet org.netbeans.api.java.lexer.JavaTokenId org.openide.loaders.FilesSet java.util.RegularEnumSet java.util.EnumSet org.netbeans.api.lexer.TokenSequence java.util.Arrays Profiler Agent Error: with message: Redefinition failed with error 64 Check JVMTI documentation for this error code.
Problem is caused by javax.lang.model.SourceVersion class. It is loaded by two different classloaders from different jars. The first one is from tools.jar and second one from java/modules/ext/nb-javac-api.jar. The classes must be different, so NetBeans must be running on JDK 7 because javax.lang.model.SourceVersion from nb-javac-api.jar is from JDK 8.
Correction, javax.lang.model.SourceVersion is part of rt.jar not tools.jar.
Fixed in profiler-main changeset: 286246:091ff6bde62e user: Tomas Hurka <thurka@netbeans.org> date: Sat Apr 18 17:21:45 2015 +0200 summary: bugfix #251259, switch classloaders in isParentLoaderTo() only if clazz is really placeholder
Integrated into 'main-silver', will be available in build *201504201004* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-silver/rev/091ff6bde62e User: Tomas Hurka <thurka@netbeans.org> Log: bugfix #251259, switch classloaders in isParentLoaderTo() only if clazz is really placeholder