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 62005 - Attach to integrated application/server fails with NoClassDefFoundError
Summary: Attach to integrated application/server fails with NoClassDefFoundError
Status: CLOSED FIXED
Alias: None
Product: profiler
Classification: Unclassified
Component: Base (show other bugs)
Version: 4.x
Hardware: PC Windows XP
: P2 blocker (vote)
Assignee: Jiri Sedlacek
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-08-09 21:49 UTC by _ gsporar
Modified: 2007-02-12 22:01 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 _ gsporar 2005-08-09 21:49:34 UTC
My JBoss 4.0.2 installation works fine on Windows XP when I use the default
run.bat to start it.  I am using JDK 1.5.0 Update 4 and NB 4.1 with version M7
(downloaded on 2005-08-09, so I assume that means I got M7v2) of the Profiler. I
also added the hotfix for J2EE profiling that was on Auto Update (as of
2005-08-09) and that did not fix the problem described below.

When I created a modified version of run.bat to use with the Profiler, I added
these two lines to the top of the run.bat file:

SET JAVA_HOME=C:\Program Files\Java\jdk1.5.0_04
SET
JAVA_OPTS=-agentpath:"C:\netbeans-4.1\profiler1\modules\profiler-ea-libs\deployed\jdk15\windows\profilerinterface.dll"="\"C:\netbeans-4.1\profiler1\modules\profiler-ea-libs\"",5140
%JAVA_OPTS%.

When I then execute run.bat I see the expected output:

C:\netbeans-4.1\jboss-4.0.2\bin>run_withNBprofiler.bat
===============================================================================
.
  JBoss Bootstrap Environment
.
  JBOSS_HOME: C:\netbeans-4.1\jboss-4.0.2\bin\\..
.
  JAVA: C:\Program Files\Java\jdk1.5.0_04\bin\java
.
  JAVA_OPTS: -agentpath:"C:\netbeans-4.1\profiler1\modules\profiler-ea-libs\depl
oyed\jdk15\windows\profilerinterface.dll"=C:\netbeans-4.1\profiler1\modules\prof
iler-ea-libs,5140 . -Dprogram.name=run_withNBprofiler.bat -Xms128m -Xmx512m
.
  CLASSPATH: C:\Program Files\Java\jdk1.5.0_04\lib\tools.jar;C:\netbeans-4.1\jbo
ss-4.0.2\bin\\run.jar
.
===============================================================================
.
Agent_OnLoad called...
Agent_OnLoad completed successfully.
JFluid: waiting for connection on port 5140

I then go over to NB and attach with the Profiler.  The session that is running
JBoss then displays:

JFluid: local connection with the tool
Exception in thread "main" java.lang.NoClassDefFoundError: /

The Profiler's Threads window starts up and displays a few threads, but JBoss
itself does not actually start.  There are no messages written to the JBoss log
files, and nothing is written to the NB log file.  If I use Cntrl-C in the
session that was running the shell script then the NB Profiler's Threads window
stops displaying (which is what it should do, since the JVM to which it attached
has exited).

So the bottom line is that the JVM starts and the NB Profiler attaches to it,
but the class not found error is preventing JBoss from doing anything.
Comment 1 Jiri Sedlacek 2005-08-09 22:01:21 UTC
The hotfix on AutoUpdate allows the Profiler to work with updated Tomcat 
libraries. It has no positive/negative impact on profiling JBoss.

These double slashes occurences seem strange for me:

JBOSS_HOME: C:\netbeans-4.1\jboss-4.0.2\bin\\..
CLASSPATH: C:\Program Files\Java\jdk1.5.0_04\lib\tools.jar;C:\netbeans-4.1
\jboss-4.0.2\bin\\run.jar

Could you please modify your startup script to generate correct paths and then 
try to profile JBoss again?
Comment 2 iformanek 2005-08-10 10:57:19 UTC
This is most likely a configuration error. Please reopen if you feel otherwise.
Comment 3 _ gsporar 2005-08-10 11:17:45 UTC
Ian -

Is there any place I can look to help find out what's wrong with my
configuration?  I'm getting no stack trace, no log info....
Comment 4 _ gsporar 2005-08-10 15:21:59 UTC
I'm re-opening this because I've seen something odd that I want you guys to try
to reproduce.

The problem was not with the JBOSS_HOME or CLASSPATH env. variables.  It looks
like maybe it was a problem with JAVA_OPTS.  If you look closely at this line
(from the original bug description), you'll see a period at the end:

JAVA_OPTS=-agentpath:"C:\netbeans-4.1\profiler1\modules\profiler-ea-libs\deployed\jdk15\windows\profilerinterface.dll"="\"C:\netbeans-4.1\profiler1\modules\profiler-ea-libs\"",5140
%JAVA_OPTS%.

When I removed that period from my .bat file, the problem went away.  I've
encountered some other problems :-( so I'm not 100% certain that I have isolated
this issue.  But with the period following %JAVA_OPTS% in my .bat file, I've
*never* been able to successfully attach the profiler.

Please note that the period is there because the Profiler's Attach Wizard told
me to put it there.  :-)  I literally copied and pasted from the Attach Wizard
text field to my .bat file.  I suspect the intent was that the period was just
to punctuate the sentence.  If so, please take it out.
Comment 5 Jiri Sedlacek 2005-08-10 17:53:02 UTC
OK, now I'm able to reproduce the problem. The reason is really the period. It 
should end the sentence but can be incorrectly taken as a part of the line to 
be inserted into startup script. I'll check all integration instructions to 
avoid this in future.

Thanks for reporting the issue and helping with reproducing it.
Comment 6 Jiri Sedlacek 2005-08-10 19:21:55 UTC
All potentially "dangerous" periods are removed from integration instructions 
and other AttachWizard messages.

Fixed for M8.
Comment 7 ehucka 2006-10-09 12:08:56 UTC
Verification of old issues.
Comment 8 Alexander Kouznetsov 2007-02-12 22:01:41 UTC
Closing old issues.