Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Web Tools Project (WTP) » Can standalone js files be debugged in Rhino in eclipse?
Can standalone js files be debugged in Rhino in eclipse? [message #669656] Wed, 11 May 2011 04:09 Go to next message
dave is currently offline daveFriend
Messages: 8
Registered: July 2009
Junior Member
So I followed this wiki article to set up the Rhino Debugger:

http://wiki.eclipse.org/JSDT/Debug/Rhino/Using_Rhino_Console

I also created a Javascript project (called Test) and a Javascript file (called Test.js)

I started my Rhino Debugger as per the article. I think right click the Test.js file and do "Debug as->Debug Javascript"

If I go to the Debug Perspective I see two entries:

DebugShell[Java Application]
/opt/ibm/java/bin/javaw
Test.js[JavaScript]

I also set 2 breakpoints in my js file. It is not debugging as I'd expect the way it does in JDT and CDT.

I am using Helios (3.6.2) and I updated my WTP last night.

Any suggestions on what I'm doing wrong?

Thanks,

index.php/fa/2719/0/
Re: Can standalone js files be debugged in Rhino in eclipse? [message #669758 is a reply to message #669656] Wed, 11 May 2011 12:24 Go to previous messageGo to next message
dave is currently offline daveFriend
Messages: 8
Registered: July 2009
Junior Member
Made some progress on this one. Apparently port 9000 was not friendly (maybe i have another debugger like PHP running on it). After changing both the DebugShell and my JavaScript Debug runtime to use port 5000 instead, my Javascript when being debug tries to talk with the DebugShell. I am now getting a java.lang.NullPointerException when trying to debug my Javascript.

The Rhino Debugger says this:

Rhino debugger
Start at time: May 11, 2011 7:18:17 AM CDT
Listening to socket onport: 5000
Started suspended - waiting for client resume...
EventPacket: {"body":{"threadId":0,"type":"enter"},"event":"thread ","type":"event"}
EventPacket: {"body":{"threadId":0,"type":"exit"},"event":"thread ","type":"event"}
EventPacket: {"body":{"threadId":1,"type":"enter"},"event":"thread ","type":"event"}
Rhino 1.7 release 2 2009 03 22
js>

at that point it pops a window with java.lang.NullPointer Exception. I check the Error logs and see this:


An internal error occurred during: "Launching Test.js".

java.lang.NullPointerException
at org.eclipse.wst.jsdt.debug.internal.rhino.transport.Packet.<init >(Packet.java:50)
at org.eclipse.wst.jsdt.debug.internal.rhino.transport.Response . <init>(Response.java:50)
at org.eclipse.wst.jsdt.debug.internal.rhino.transport.SocketCo nnection.readPacket(SocketConnection.java:118)
at org.eclipse.wst.jsdt.debug.internal.rhino.transport.SocketTr ansportService.attach(SocketTransportService.java:138)
at org.eclipse.wst.jsdt.debug.internal.rhino.jsdi.connect.Rhino AttachingConnector.attach(RhinoAttachingConnector.java:44)
at org.eclipse.wst.jsdt.debug.internal.core.launching.RemoteJav aScriptLaunchDelegate.launch(RemoteJavaScriptLaunchDelegate. java:60)
at org.eclipse.debug.internal.core.LaunchConfiguration.launch(L aunchConfiguration.java:853)
at org.eclipse.debug.internal.core.LaunchConfiguration.launch(L aunchConfiguration.java:702)
at org.eclipse.debug.internal.ui.DebugUIPlugin.buildAndLaunch(D ebugUIPlugin.java:923)
at org.eclipse.debug.internal.ui.DebugUIPlugin$8.run(DebugUIPlu gin.java:1126)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)

and if the session data might help:

eclipse.buildId=M20100909-0800
java.version=1.6.0_20
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=linux, ARCH=x86, WS=gtk, NL=en_US
Framework arguments: -product org.eclipse.epp.package.jee.product
Command-line arguments: -os linux -ws gtk -arch x86 -product org.eclipse.epp.package.jee.product

thanks,
Re: Can standalone js files be debugged in Rhino in eclipse? [message #669852 is a reply to message #669758] Wed, 11 May 2011 19:41 Go to previous message
dave is currently offline daveFriend
Messages: 8
Registered: July 2009
Junior Member
So after going to the dev team, it appears that the 3.6 version wasn't really ready. I tested it on 3.7M7 with JSDT and it worked as expected.
Previous Topic:JSDT calling Java from Javascript - How to set Java Classpath for Rhino?
Next Topic:Trouble with inline schema in WSDL
Goto Forum:
  


Current Time: Mon Dec 22 22:56:25 GMT 2014

Powered by FUDForum. Page generated in 0.12296 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software