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 141254 - Support for debugging Rails applications when running on GlassFish V3
Summary: Support for debugging Rails applications when running on GlassFish V3
Status: RESOLVED FIXED
Alias: None
Product: serverplugins
Classification: Unclassified
Component: GlassFish (show other bugs)
Version: 6.x
Hardware: Sun All
: P2 blocker (vote)
Assignee: _ pcw
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-07-23 03:05 UTC by _ pcw
Modified: 2008-07-24 04:02 UTC (History)
1 user (show)

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments
Patch providing a new entry point for starting ruby debug tasks (4.17 KB, text/plain)
2008-07-23 03:16 UTC, _ pcw
Details
Patch enabling rdebug in V3 inside the grizzly-jruby adapter (7.29 KB, text/plain)
2008-07-24 03:07 UTC, _ pcw
Details

Note You need to log in before you can comment on or make changes to this bug.
Description _ pcw 2008-07-23 03:05:46 UTC
This enhancement is to support for debugging Rails applications when running on GlassFish V3.
Comment 1 _ pcw 2008-07-23 03:15:24 UTC
There are (at least) 3 ways the V3 server can be run right now

1. Installed and managed by the serverplugin, then launched by either the serverplugin or asadmin at a command prompt.
2. Install the GEM and the RailsProject code that manages server gems will handle it
3. Install the server as in (1) and then launch a simple Grizzly + JRuby process using com.sun.grizzly.standalone.JRuby
as the entry point.

Debug-commons, the library used by the NetBeans ruby debugger for starting and communicating with the
rdebug-ide/ruby-debug script does not allow attachment or delegation of launching debug tasks, so supporting Rails
debugging in (1) is not possible right now.

The Glassfish GEM works by running a startup script that launches the server via the launcher code, so debugging isn't
supported there for reasons similar to (1), although you can debug the startup script (weird fact for the day).  If the
GlassFish GEM used the standard server entry point (script/server) for launching rails, it might work.  Unclear if this
could be supported due to how Grizzly works though and that startup mode is not supported right now.

That leaves option (3) as the only viable short term alternative.

Debug-commons startDebugger api is currently too restrictive to allow launching of a java process, so first, we need a
patch to allow a more flexible debuggee launching procedure.
Comment 2 _ pcw 2008-07-23 03:16:58 UTC
Created attachment 65301 [details]
Patch providing a new entry point for starting ruby debug tasks
Comment 3 _ pcw 2008-07-24 03:07:50 UTC
Created attachment 65469 [details]
Patch enabling rdebug in V3 inside the grizzly-jruby adapter
Comment 4 _ pcw 2008-07-24 03:13:44 UTC
Attached is the patch for V3's grizzly-jruby adapter that, if the follow properties are set, activates rdebug on the
JRuby runtime managed by this adapter

    glassfish.rdebug=<absolute path of rdebug script>
    glassfish.rdebug.port=<port used by rdebug> (mandatory)
    glassfish.rdebug.version=<version of rdebug> (optional)
    glassfish.rdebug.iosynch=<absolute path to io synchronization script> (optional)
    glassfish.rdebug.verbose=true enables rdebug diagnostics
Comment 5 _ pcw 2008-07-24 03:52:40 UTC
Changesets for V3/JRuby debugging in NetBeans:

http://hg.netbeans.org/main/rev/faf78f72d6e7
http://hg.netbeans.org/main/rev/790535b65ef2
Comment 6 _ pcw 2008-07-24 04:02:26 UTC
This feature is now implemented.  In order to test it, you need a V3 server build containing the attached RubyObjectPool
patch.  Such a build is available here for now: http://javaweb.sfbay/~peterw99/glassfish/web_jrubydebug_patch.zip

There is also a P2 bug that you'll hit immediately if you try to use breakpoints and step through user code -- see
http://www.netbeans.org/issues/show_bug.cgi?id=141462

You can step through the rails startup code though (start in config/environment.rb).

Marking fixed.