Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 255813

Summary: Probe Profiling fails in the External Java Application use case
Product: z_Archived Reporter: Raheel Ashraf <rashraf>
Component: TPTPAssignee: Raheel Ashraf <rashraf>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P1 CC: jgwest, jkubasta, paulslau
Version: unspecifiedFlags: paulslau: review+
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard: closed460
Bug Depends on:    
Bug Blocks: 228731    
Attachments:
Description Flags
patch
none
patch none

Description Raheel Ashraf CLA 2008-11-19 10:41:38 EST
Create a new probe file
Create a new java class. call it Foo
Now in your probe, create instance of Foo
Run the probe using the External Java Application launch type. You will get java.lang.NoClassDefFoundError
Comment 1 Raheel Ashraf CLA 2008-11-19 10:42:38 EST
Here are the details:

This is because the code in ProbekitLaunchUtil does add bootclasspath to the launch arguments but its only designed to work for the local launch scenario and it doesnt work for the remote case..
Comment 2 Raheel Ashraf CLA 2008-11-19 13:32:57 EST
Created attachment 118295 [details]
patch
Comment 3 Paul Slauenwhite CLA 2008-11-20 07:01:21 EST
Reviewed with comments:

-Ensure the copyright year is correct.
-Add //$NON-NLS-1$ at the end of each line that contains a untranslated string or <right click Java file in Package Explorer> >> Source >> Externalize Strings.
-Only have one conditional block with OS-specific code and check if there is a OS flag/constant somewhere else in the plug-in that you can use.
-Will this patch resolve the case where the Foo class is not on the AC's classpath?

Jonathan: Can you review the attached patch as well?
Comment 4 Raheel Ashraf CLA 2008-11-20 10:04:12 EST
Created attachment 118368 [details]
patch

Thanks Paul for the review. I have updated the patch.

>>Ensure the copyright year is correct.

it was already 2008

>>Add //$NON-NLS-1$ at the end of each line that contains a untranslated string
or <right click Java file in Package Explorer> >> Source >> Externalize
Strings.

done

>>Only have one conditional block with OS-specific code and check if there is a
OS flag/constant somewhere else in the plug-in that you can use.

used only one conditional block. No constant found elsewhere. In other places, this is done in similar fashion

>>Will this patch resolve the case where the Foo class is not on the AC's
classpath?

Not sure what is meant but this patch will solve the stated problem in the bug desc.
Comment 5 Paul Slauenwhite CLA 2008-11-20 12:42:04 EST
(In reply to comment #4)

Looks great, thanks.

> >>Will this patch resolve the case where the Foo class is not on the AC's
> classpath?
> 
> Not sure what is meant but this patch will solve the stated problem in the bug
> desc.

I was thinking that the value for the boot classpath was coming from the AC's classpath (that is, the JVMTI application configured in the AC) but it is in fact coming from the classpath for the profile launch configuration.  My mistake.

Comment 6 jkubasta CLA 2008-11-20 12:59:24 EST
Is Jonathan's review still required?
Comment 7 Paul Slauenwhite CLA 2008-11-20 13:19:32 EST
(In reply to comment #6)
> Is Jonathan's review still required?
> 

No, given comment #5.
Comment 8 jkubasta CLA 2008-11-21 10:23:45 EST
patch committed to head
Comment 9 Paul Slauenwhite CLA 2009-06-30 10:22:09 EDT
As of TPTP 4.6.0, TPTP is in maintenance mode and focusing on improving quality by resolving relevant enhancements/defects and increasing test coverage through test creation, automation, Build Verification Tests (BVTs), and expanded run-time execution. As part of the TPTP Bugzilla housecleaning process (see http://wiki.eclipse.org/Bugzilla_Housecleaning_Processes), this enhancement/defect is verified/closed by the Project Lead since the originator of this enhancement/defect has an inactive Bugzilla account and considered to be fixed. If this enhancement/defect is still unresolved and reproducible in the latest TPTP release (http://www.eclipse.org/tptp/home/downloads/), please re-open.