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 136348 - Redefinition of class failing with error 64
Summary: Redefinition of class failing with error 64
Status: RESOLVED WORKSFORME
Alias: None
Product: profiler
Classification: Unclassified
Component: Base (show other bugs)
Version: 6.x
Hardware: PC Windows XP
: P2 blocker (vote)
Assignee: Tomas Hurka
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-06-03 09:28 UTC by kek
Modified: 2008-06-17 14:13 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
There was generated 319 classes, but I can not send the internal company code here. So I zip only the thirdparty code. (48.32 KB, application/x-compressed)
2008-06-03 09:40 UTC, kek
Details

Note You need to log in before you can comment on or make changes to this bug.
Description kek 2008-06-03 09:28:04 UTC
I try to profile CPU on my external web application. 
INFO: Server startup in 3922 ms
Profiler Agent: JNI On Load Initializing...
Profiler Agent: JNI OnLoad Initialized succesfully
Profiler Agent: Waiting for connection on port 5140 (Protocol version: 8)
Profiler Agent: Established local connection with the tool
Profiler Agent: Redefining 100 classes at idx 0, out of total 316
Profiler Agent: Redefining 100 classes at idx 100, out of total 316
Profiler Agent: Redefining 100 classes at idx 200, out of total 316
Profiler Agent: Redefining 16 classes at idx 300, out of total 316
Profiler Agent Error: Redefinition failed for classes:
...
INFO: Server startup in 3922 ms
Profiler Agent: JNI On Load Initializing...
Profiler Agent: JNI OnLoad Initialized succesfully
Profiler Agent: Waiting for connection on port 5140 (Protocol version: 8)
Profiler Agent: Established local connection with the tool
Profiler Agent: Redefining 100 classes at idx 0, out of total 316
Profiler Agent: Redefining 100 classes at idx 100, out of total 316
Profiler Agent: Redefining 100 classes at idx 200, out of total 316
Profiler Agent: Redefining 16 classes at idx 300, out of total 316
Profiler Agent Error: Redefinition failed for classes:
...
Profiler Agent Error: with message: Redefinition failed with error 64
Check JVMTI documentation for this error code.
....


I use:

Product Version: NetBeans IDE 6.1 (Build 200804211638)
Java: 1.6.0_05; Java HotSpot(TM) Client VM 10.0-b19
System: Windows XP version 5.1 running on x86; Cp1250; cs_CZ (nb)
Userdir: C:\Documents and Settings\uni162\.netbeans\6.1

and I attach to local running Tomcat 5.5 on same Java: 1.6.0_05; Java HotSpot(TM) - server.

I will add attachment with debug-generated classes by profiler.
Comment 1 kek 2008-06-03 09:40:58 UTC
Created attachment 62304 [details]
There was generated 319 classes, but I can not send the internal company code here. So I zip only the thirdparty code.
Comment 2 Tomas Hurka 2008-06-16 14:35:18 UTC
Can you provide us with the steps how to reproduce this problem? I am afraid that without it, I will not be able to find out what is wrong.
Comment 3 kek 2008-06-16 19:13:57 UTC
Sorry, I can not simulate the problem again. I have the same JVM, same version of Netbeans, but the application was 
changed and I can not get the same Error, but now I have some other problems like:

Profiler Agent: JNI On Load Initializing...
Profiler Agent: JNI OnLoad Initialized succesfully
Profiler Agent: 250 classes cached.
Profiler Agent: Redefining 100 classes at idx 0, out of total 514 
Profiler Agent: Redefining 100 classes at idx 100, out of total 514 
Profiler Agent: Redefining 100 classes at idx 200, out of total 514 
Profiler Agent: Redefining 100 classes at idx 300, out of total 514 
Profiler Agent: Redefining 100 classes at idx 400, out of total 514 
Profiler Agent: Redefining 14 classes at idx 500, out of total 514 
Profiler Agent Warning: JVMTI classLoadHook: class name is null.
Profiler Agent Warning: JVMTI classLoadHook: class name is null.
Profiler Agent Warning: JVMTI classLoadHook: class name is null.
Profiler Agent Warning: JVMTI classLoadHook: class name is null.

and

Profiler Agent Warning: Failed to lookup cached class GregorSamsa
Profiler Agent Warning: Failed to lookup cached class GregorSamsa$23
Profiler Agent Warning: Failed to lookup cached class GregorSamsa$62
Profiler Agent Warning: Failed to lookup cached class GregorSamsa$63


GregorSamsa = it is some class generated by Xalan XSLC.

And much bigger problem is your manipulation with some threads, we got many messages on stdout with exceptions like:

Exception in thread "afu_v1.af_v1.util_v1.xml_v1.DOMParserPool:PoolCleaner" java.lang.NullPointerException
	at org.netbeans.lib.profiler.server.ProfilerRuntimeCPU.writeTimeStampedEvent(ProfilerRuntimeCPU.java:557)
	at org.netbeans.lib.profiler.server.ProfilerRuntimeCPUSampledInstr.rootMethodEntry
(ProfilerRuntimeCPUSampledInstr.java:430)
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run
(ScheduledThreadPoolExecutor.java:204)
	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
	at java.lang.Thread.run(Thread.java:619)


The usage scenario was very simple:

1) I start standalone Tomcat5.5 with  Java 1.6.0_05 in server mode.
2) I run Netbeans 6.1, Build 200804211638
3) I run menu:  Profile->AttachProfiller->CPU
4) I choose the propeties: profile "Entire application", Filter: "Exclude Java core classes", Advance settings: 
ExactCallTree:10ms, Exclude time spent by Thread.sleep(), Limit number of profiled threds:32, instrument Method.invoke
()   - other checkboxes are off
5) AttachMode: WebAppServer, Tomcat5.5, Method:local, Attach: dynamic(JDK1.6), manual integration

6) click on Attach>
7) I choose the running Tomcat process
8) I try to click to web application
9) The Tomcat output log was full of messages about error 64 and Tomcat-Home dir was full of generated classes - I 
sent some as attachment.


I try to use google to find something about Error 64, but no suggestion.

I have some idea, I'm not sure: 
it may be some problem with usage of java.lang.reflect.Proxy or with XSLTc - Xalan. We use these features very 
intesively. And I have some signals, that the XSLTc may cause problems by dynamic generation and loading classes 
representing XSL templates into JVM.  We change the application - now we have cached all used templates, so the 
classes are not unloaded now and I can not simulate the Error 64 too and help with more details.

You can close the bug, because I can not help you more.

I try to implement some simple testcase, but it is not usable. And it is not always possible to send you whole 
application. But I think, you should add some tracing facility to profiler or JVMTI to help us provide more info next 
time. If I can switch some tracer to debug mode to generate logs, it may be more helpful.
Comment 4 Tomas Hurka 2008-06-17 14:13:21 UTC
FYI: The NPE is tracked as issue #134889. 
Closing as works-for-me. Please reopen if you can reproduce it. Thanks.