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

Bug 343142

Summary: Unable to debug javascript when custom classes are used
Product: [WebTools] JSDT Reporter: Syamkumar C <c.syamkumar>
Component: DebugAssignee: Project Inbox <jsdt.debug-inbox>
Status: NEW --- QA Contact: Michael Rennie <Michael_Rennie>
Severity: normal    
Priority: P3 CC: c.syamkumar, jgarrison, marcus.shaw.misc, michael.mishalov, sumitrockstar1234, sumitsingh_1234, thatnitind
Version: 3.3   
Target Milestone: ---   
Hardware: PC   
OS: Windows 7   
Whiteboard:
Attachments:
Description Flags
zip file contains the java class and javascript file none

Description Syamkumar C CLA 2011-04-18 08:28:05 EDT
Created attachment 193484 [details]
zip file contains the java class and javascript file

I am using Indigo eclipse 3.7 M6 version. When i try to debug javascript file which uses custom java classes using rhino debugger, it is not recognizing these java classes. I have included this project under Source tab of Rhino java script debug configuration. I am attaching the source files.

when i try to debug the java script it is throwing the below exception:

js: "C:\hiddenpath\math.js", line 1: uncaught JavaScript runtime exception: TypeError: [JavaPackage sample.MathUtility] is not a function, it is object.
	at C:\hiddenpath\math.js:1

The same sample I am able to debug from standalone Rhino Debugger (using the class org.mozilla.javascript.tools.debugger.Main).
Comment 1 Michael Rennie CLA 2011-05-10 18:55:36 EDT
*** Bug 345344 has been marked as a duplicate of this bug. ***
Comment 2 Michael Rennie CLA 2011-09-20 10:13:17 EDT
*** Bug 358238 has been marked as a duplicate of this bug. ***
Comment 3 Syamkumar C CLA 2011-11-14 00:33:26 EST
How do I submit patch to this bug. I have changed the source code for UI plug-in of JSDT plugins. How do i submit back to eclipse org?
Comment 4 Michael Rennie CLA 2011-11-14 09:50:26 EST
(In reply to comment #3)
> How do I submit patch to this bug. I have changed the source code for UI
> plug-in of JSDT plugins. How do i submit back to eclipse org?

Create a patch using your preferred method, and simply attach it this the bug report.
Comment 5 Michael Mishalov CLA 2012-06-17 06:20:55 EDT
(In reply to comment #3)
> How do I submit patch to this bug. I have changed the source code for UI
> plug-in of JSDT plugins. How do i submit back to eclipse org?

Hi Syam,

I have the similar issue.
Can you please share your fix?

Tnx in advance!
Comment 6 Marcus Shaw CLA 2013-10-10 11:39:05 EDT
Here is a workaround.  Put your jar into the JRE's 'ext' folder.  You can find it by running this in the JS debugger:

print(java.lang.System.getProperty('java.ext.dirs'));

Don't forget to prefix the path to your Java class with "Packages".  e.g.

var myObj = new Packages.my.package.MyObj();