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 114559 - ClassCastException on Remote Attach
Summary: ClassCastException on Remote Attach
Status: RESOLVED WORKSFORME
Alias: None
Product: profiler
Classification: Unclassified
Component: Base (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker (vote)
Assignee: J Bachorik
URL:
Keywords: RANDOM
Depends on:
Blocks:
 
Reported: 2007-09-03 21:34 UTC by Alexander Kouznetsov
Modified: 2008-07-17 08:43 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Exception (740 bytes, text/plain)
2007-09-03 21:35 UTC, Alexander Kouznetsov
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Alexander Kouznetsov 2007-09-03 21:34:05 UTC
Remote attach for AnagramGame application (Memory Liveness, Record Stack Traces, each 20 object allocations) from

Product Version: NetBeans IDE Dev (Build 200709030000) 
Java: 1.6.0_02; Java HotSpot(TM) 
Client VM 1.6.0_02-b05 System: SunOS version 5.10 running on x86; ISO646-US; en (nb)

to

Java: 1.6.0_02; Java HotSpot(TM) Client VM 1.6.0_02-b06 
System: Windows XP version 5.1 running on x86; Cp1251; ru_RU (nb)

using

C:\Work\Temp\RemotePack\bin>profile-16.bat -jar C:\Work\Temp\RemotePack\bin\anagrams.jar

sometimes produces the following ClassCastException on Profiler side:

java.lang.ClassCastException: com.sun.tools.profiler.wireprotocol.Response cannot be cast to
com.sun.tools.profiler.wireprotocol.VMPropertiesResponse
        at com.sun.tools.profiler.ProfilerClient.connectToServer(ProfilerClient.java:1445)
        ...

This issue is random (~15% reproducible)
Comment 1 Alexander Kouznetsov 2007-09-03 21:35:59 UTC
Created attachment 48003 [details]
Exception
Comment 2 J Bachorik 2007-09-24 13:17:41 UTC
as this issue is very difficult to reproduce i added an error reporting code that identifies the request/response
mismatch and will print additional details about the response, essential to pinpointing the erroneous code.
Comment 3 J Bachorik 2007-09-26 06:57:53 UTC
i'm marking this incomplete till we can get logging data showing what exactly is causing the request/response mix-up
Comment 4 Tomas Hurka 2007-09-26 09:23:31 UTC
Please also use 
-Dcom.sun.tools.profiler.wireprotocol.WireIO=true 
for both profiled application and netbeans.
Comment 5 _ hair 2007-10-15 10:48:59 UTC
Using direct connect i got:

SEVERE: Received org.netbeans.lib.profiler.wireprotocol.Response(NO TYPEOk, yes) instead of VMPropertiesResponse
java.lang.ClassCastException: org.netbeans.lib.profiler.wireprotocol.Response cannot be cast to
org.netbeans.lib.profiler.wireprotocol.VMPropertiesResponse
        at org.netbeans.lib.profiler.ProfilerClient.connectToServer(ProfilerClient.java:1651)
        at org.netbeans.lib.profiler.ProfilerClient.establishConnectionWithServer(ProfilerClient.java:780)
        at org.netbeans.lib.profiler.TargetAppRunner.initiateSession(TargetAppRunner.java:340)
        at org.netbeans.modules.profiler.NetBeansProfiler$2.doInBackground(NetBeansProfiler.java:882)
        at org.netbeans.lib.profiler.ui.SwingWorker$2.run(SwingWorker.java:113)
        at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:561)
        at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:986)
Comment 6 _ hair 2007-10-15 10:52:50 UTC
sorry. (direct connect & beta2)
Comment 7 Alexander Kouznetsov 2007-12-04 17:55:56 UTC
Removing incomplete flag due to user comment.
Comment 8 Alexander Kouznetsov 2007-12-04 18:57:20 UTC
However I was not able to reproduce it profiling from

Product Version: NetBeans IDE 6.0 (Build 200711261600)
Java: 1.6.0_03; Java HotSpot(TM) Client VM 1.6.0_03-b05
System: SunOS version 5.10 running on x86; ISO646-US; en (nb)

to

Java: 1.6.0_03; Java HotSpot(TM) Client VM 1.6.0_03-b05
System: Windows XP

Probably due to low reproducibility
Comment 9 J Bachorik 2008-07-17 08:43:29 UTC
I still can not get the error state. Closing this issue as "works for me". If you will experience this problem again,
please reopen the issue.