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.

Bug 251259 - Redefinition failed with error 64
Summary: Redefinition failed with error 64
Status: RESOLVED FIXED
Alias: None
Product: profiler
Classification: Unclassified
Component: Engine (show other bugs)
Version: 8.1
Hardware: All All
: P3 normal (vote)
Assignee: Tomas Hurka
URL:
Keywords: VISUALVM
Depends on:
Blocks:
 
Reported: 2015-03-18 12:42 UTC by Jiri Sedlacek
Modified: 2015-04-20 11:58 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jiri Sedlacek 2015-03-18 12:42:56 UTC
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.
Comment 1 Tomas Hurka 2015-04-17 11:45:19 UTC
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.
Comment 2 Tomas Hurka 2015-04-17 11:53:44 UTC
Correction, javax.lang.model.SourceVersion is part of rt.jar not tools.jar.
Comment 3 Tomas Hurka 2015-04-18 15:23:42 UTC
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
Comment 4 Quality Engineering 2015-04-20 11:58:25 UTC
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