Torquebox Debugging

Sorry if this is the wrong place. Anyway - my challenge is debugging a Ruby app running in torquebox, in Rubymine 6.3.  Is it possible at all?  TIA

10 comments
Comment actions Permalink

Thanks very much for the reply. It seems that in Run->Edit Configurations I can only specify a Torquebox server for either Rail or Rack configs. What if I have a Sinatra app, or just a plain Ruby app I want to run in Torquebox?  I have been trying a Bash-based launch approach to start torquebox that way, but the breakpoints don't hit (unsurprisingly).

0
Comment actions Permalink

Hi,

please show your run configuration.
Also make sure you have added required debugging gems to you Gmefile.

Regards, Oleg.

0
Comment actions Permalink

Well, for the bash-launch approach (very much clutching at straws here...) :


Script Name: /<path>/ruby_app/launch.sh
Bash Interpreter: /bin/bash
Environment Variables:
JBOSS_OPTS=-Djruby.home=<path>/torquebox-3.1.1/jruby --server-config=standalone-ha.xml --debug  


Gemfile:
  gem 'ruby-debug-base', '>= 0.10.5.rc3'
  gem 'ruby-debug-ide', '>= 0.4.17.beta14'


launch.sh
  export RACK_ROOT=`pwd`
  torquebox run

0
Comment actions Permalink

You need to create Ruby script run configuration instead of bash run configuration.
This way it should work.

Regards, Oleg.

0
Comment actions Permalink

Ok thanks. Tried it with system and spawn calls but it doesn't attach:

#!/usr/bin/env ruby
system('torquebox run')
#spawn('torquebox run')

/Users/user_dir/torquebox-3.1.1/jruby/bin/jruby --1.9 -X+O -J-Djruby.compile.mode=OFF -J-Djruby.debug.fullTrace=true -e at_exit{sleep(1)};$stdout.sync=true;$stderr.sync=true;load($0=ARGV.shift) /Users/user_dir/.gem/jruby/1.9/gems/ruby-debug-ide-0.4.23.beta1/bin/rdebug-ide --disable-int-handler --port 52757 --dispatcher-port 52758 -- /Users/user_dir/Documents/dev/testing/ruby_app/ruby_launch.rb

Fast Debugger (ruby-debug-ide 0.4.23.beta1, ruby-debug-base 0.10.5.rc9) listens on 127.0.0.1:52757

launching...

/Users/user_dir/.gem/jruby/1.9/gems/ruby-debug-base-0.10.5.rc9-java/lib/ruby-debug-base.rb:210 warning: tracing (e.g. set_trace_func) will not capture all events without --debug flag

Fast Debugger (ruby-debug-ide 0.4.23.beta1, ruby-debug-base 0.10.5.rc9) listens on 127.0.0.1:52764

Booting AS7 from configuration /Users/user_dir/torquebox-3.1.1/jboss/standalone/configuration/standalone.xml

/Users/user_dir/torquebox-3.1.1/jboss/bin/standalone.sh -Djruby.home=/Users/user_dir/torquebox-3.1.1/jruby --server-config=standalone-ha.xml --debug   --server-config=standalone.xml

JAVA_OPTS already set in environment; overriding default settings with values: -Xms64m -Xmx512m -XX:MaxPermSize=256m -Djava.net.preferIPv4Stack=true -Djboss.modules.system.pkgs=org.jboss.byteman -Djava.awt.headless=true

=========================================================================

  JBoss Bootstrap Environment

  JBOSS_HOME: /Users/user_dir/torquebox-3.1.1/jboss

  JAVA: java

  JAVA_OPTS: -d32 -client -Xms64m -Xmx512m -XX:MaxPermSize=256m -Djava.net.preferIPv4Stack=true -Djboss.modules.system.pkgs=org.jboss.byteman -Djava.awt.headless=true  -agentlib:jdwp=transport=dt_socket,address=8787,server=y,suspend=n

=========================================================================

Listening for transport dt_socket at address: 8787

11:37:02,452 INFO  [org.jboss.modules] (main) JBoss Modules version 1.2.0.CR1

11:37:02,653 INFO  [org.jboss.msc] (main) JBoss MSC version 1.0.4.GA

11:37:03,098 INFO  [org.torquebox.bootstrap] (ServerService Thread Pool -- 4) Bootstrapping TorqueBox

11:37:03,099 INFO  [org.torquebox.bootstrap] (ServerService Thread Pool -- 4) Bootstrapping TorqueBox with a JRuby home of /Users/user_dir/torquebox-3.1.1/jruby

11:37:03,346 INFO  [org.torquebox.web.as] (ServerService Thread Pool -- 20) Initializing TorqueBox Web Subsystem

11:37:03,349 INFO  [org.torquebox.stomp.as] (ServerService Thread Pool -- 19) Initializing TorqueBox STOMP Subsystem

11:37:03,350 INFO  [org.torquebox.services.as] (ServerService Thread Pool -- 18) Initializing TorqueBox Services Subsystem

11:37:03,351 INFO  [org.torquebox.security.as] (ServerService Thread Pool -- 17) Initializing TorqueBox Auth Subsystem

11:37:03,353 INFO  [org.torquebox.jobs.as] (ServerService Thread Pool -- 15) Initializing TorqueBox Jobs Subsystem




0
Comment actions Permalink

Perhaps I'm missing somthing but why you can not use torquebox as a ruby script to debug?

Regards, Oleg.

0
Comment actions Permalink

Thanks good idea - I have done that but breakpoints still not being hit.

/Users/user/torquebox-3.1.1/jruby/bin/jruby --1.9 -X+O -J-Djruby.compile.mode=OFF -J-Djruby.debug.fullTrace=true -e at_exit{sleep(1)};$stdout.sync=true;$stderr.sync=true;load($0=ARGV.shift) --debug /Users/user/.gem/jruby/1.9/gems/ruby-debug-ide-0.4.23.beta1/bin/rdebug-ide --debug --disable-int-handler --port 49719 --dispatcher-port 49720 -- /Users/user/torquebox-3.1.1/jruby/bin/torquebox run

Fast Debugger (ruby-debug-ide 0.4.23.beta1, ruby-debug-base 0.10.5.rc9) listens on 127.0.0.1:49719

Connected from 127.0.0.1

550: Starting control thread

550: Processing in control: b /Users/user/Documents/dev/test_area/ruby_app/app/jobs/message_consumer1.rb:7

550: <breakpointAdded no="1" location="/Users/user/Documents/dev/test_area/ruby_app/app/jobs/message_consumer1.rb:7"/>

550: Processing in control: b /Users/user/Documents/dev/test_area/ruby_app/app/jobs/message_producer1.rb:13

550: <breakpointAdded no="2" location="/Users/user/Documents/dev/test_area/ruby_app/app/jobs/message_producer1.rb:13"/>

550: Processing in control: b /Users/user/Documents/dev/test_area/ruby_app/app/jobs/message_producer1.rb:20

550: <breakpointAdded no="3" location="/Users/user/Documents/dev/test_area/ruby_app/app/jobs/message_producer1.rb:20"/>

550: Processing in control: b /Users/user/Documents/dev/test_area/ruby_app/app/jobs/message_consumer2.rb:22

550: <breakpointAdded no="4" location="/Users/user/Documents/dev/test_area/ruby_app/app/jobs/message_consumer2.rb:22"/>

550: Processing in control: b /Users/user/Documents/dev/test_area/ruby_app/app/jobs/message_consumer1.rb:17

550: <breakpointAdded no="5" location="/Users/user/Documents/dev/test_area/ruby_app/app/jobs/message_consumer1.rb:17"/>

550: Processing in control: start

550: Starting: running program script

Booting AS7 from configuration /Users/user/torquebox-3.1.1/jboss/standalone/configuration/standalone.xml

/Users/user/torquebox-3.1.1/jboss/bin/standalone.sh -Djruby.home=/Users/user/torquebox-3.1.1/jruby --server-config=standalone-ha.xml  -Djboss.node.name=node20 -Djboss.server.data.dir=/tmp/node20 -Djboss.socket.binding.port-offset=200 --server-config=standalone.xml

JAVA_OPTS already set in environment; overriding default settings with values: -Xms64m -Xmx512m -XX:MaxPermSize=256m -Djava.net.preferIPv4Stack=true -Djboss.modules.system.pkgs=org.jboss.byteman -Djava.awt.headless=true

=========================================================================

  JBoss Bootstrap Environment

  JBOSS_HOME: /Users/user/torquebox-3.1.1/jboss

  JAVA: java

  JAVA_OPTS: -d32 -client -Xms64m -Xmx512m -XX:MaxPermSize=256m -Djava.net.preferIPv4Stack=true -Djboss.modules.system.pkgs=org.jboss.byteman -Djava.awt.headless=true

=========================================================================

09:00:54,572 INFO  [org.jboss.modules] (main) JBoss Modules version 1.2.0.CR1

09:00:54,927 INFO  [org.jboss.msc] (main) JBoss MSC version 1.0.4.GA

09:00:55,446 INFO  [org.torquebox.bootstrap] (ServerService Thread Pool -- 10) Bootstrapping TorqueBox

09:00:55,449 INFO  [org.torquebox.bootstrap] (ServerService Thread Pool -- 10) Bootstrapping TorqueBox with a JRuby home of /Users/user/torquebox-3.1.1/jruby

09:00:55,801 INFO  [org.torquebox.core.as] (ServerService Thread Pool -- 6) Initializing TorqueBox Core Subsystem

09:00:55,808 INFO  [org.torquebox.security.as] (ServerService Thread Pool -- 11) Initializing TorqueBox Auth Subsystem

09:00:55,808 INFO  [org.torquebox.core.as] (ServerService Thread Pool -- 6) Welcome to TorqueBox AS - http://torquebox.org/



Guessing this is releated to my issue ...

09:51:20,459 ERROR [stderr] (pool-3-thread-2) /Users/user/.gem/jruby/1.9/gems/ruby-debug-base-0.10.5.rc9-java/lib/ruby-debug-base.rb:210 warning: tracing (e.g. set_trace_func) will not capture all events without --debug flag

09:51:20,467 ERROR [stderr] (Ruby-1-Thread-83: /Users/user/.gem/jruby/1.9/gems/ruby-debug-ide-0.4.23.beta1/lib/ruby-debug-ide.rb:103) Fast Debugger (ruby-debug-ide 0.4.23.beta1, ruby-debug-base 0.10.5.rc9) listens on 127.0.0.1:50753

09:51:20,476 ERROR [stderr] (Ruby-1-Thread-83: /Users/user/.gem/jruby/1.9/gems/ruby-debug-ide-0.4.23.beta1/lib/ruby-debug-ide.rb:103) 1477: Ide process dispatcher notified about sub-debugger which listens on 50753

09:51:20,476 ERROR [stderr] (Ruby-1-Thread-83: /Users/user/.gem/jruby/1.9/gems/ruby-debug-ide-0.4.23.beta1/lib/ruby-debug-ide.rb:103)

09:51:20,479 ERROR [stderr] (Ruby-1-Thread-83: /Users/user/.gem/jruby/1.9/gems/ruby-debug-ide-0.4.23.beta1/lib/ruby-debug-ide.rb:103) Connected from 127.0.0.1

09:51:20,481 ERROR [stderr] (Ruby-1-Thread-83: /Users/user/.gem/jruby/1.9/gems/ruby-debug-ide-0.4.23.beta1/lib/ruby-debug-ide.rb:103) 1477: Starting control thread

09:51:20,490 ERROR [stderr] (Ruby-1-Thread-83: /Users/user/.gem/jruby/1.9/gems/ruby-debug-ide-0.4.23.beta1/lib/ruby-debug-ide.rb:103) 1477: Processing in control: b /Users/user/Documents/dev/testing/ruby_app/app/jobs/message_consumer1.rb:7

09:51:20,505 ERROR [stderr] (Ruby-1-Thread-83: /Users/user/.gem/jruby/1.9/gems/ruby-debug-ide-0.4.23.beta1/lib/ruby-debug-ide.rb:103) 1477: <breakpointAdded no="1" location="/Users/user/Documents/dev/testing/ruby_app/app/jobs/message_consumer1.rb:7"/>

09:51:20,508 ERROR [stderr] (Ruby-1-Thread-83: /Users/user/.gem/jruby/1.9/gems/ruby-debug-ide-0.4.23.beta1/lib/ruby-debug-ide.rb:103) 1477: Processing in control: b /Users/user/Documents/dev/testing/ruby_app/app/jobs/message_producer1.rb:15

09:51:20,508 ERROR [stderr] (Ruby-1-Thread-83: /Users/user/.gem/jruby/1.9/gems/ruby-debug-ide-0.4.23.beta1/lib/ruby-debug-ide.rb:103) 1477: <breakpointAdded no="2" location="/Users/user/Documents/dev/testing/ruby_app/app/jobs/message_producer1.rb:15"/>

09:51:20,509 ERROR [stderr] (Ruby-1-Thread-83: /Users/user/.gem/jruby/1.9/gems/ruby-debug-ide-0.4.23.beta1/lib/ruby-debug-ide.rb:103) 1477: Processing in control: b /Users/user/Documents/dev/testing/ruby_app/app/jobs/message_producer1.rb:22

09:51:20,510 ERROR [stderr] (Ruby-1-Thread-83: /Users/user/.gem/jruby/1.9/gems/ruby-debug-ide-0.4.23.beta1/lib/ruby-debug-ide.rb:103) 1477: <breakpointAdded no="3" location="/Users/user/Documents/dev/testing/ruby_app/app/jobs/message_producer1.rb:22"/>

09:51:20,512 ERROR [stderr] (Ruby-1-Thread-83: /Users/user/.gem/jruby/1.9/gems/ruby-debug-ide-0.4.23.beta1/lib/ruby-debug-ide.rb:103) 1477: Processing in control: b /Users/user/Documents/dev/testing/ruby_app/app/jobs/message_consumer2.rb:22

09:51:20,513 ERROR [stderr] (Ruby-1-Thread-83: /Users/user/.gem/jruby/1.9/gems/ruby-debug-ide-0.4.23.beta1/lib/ruby-debug-ide.rb:103) 1477: <breakpointAdded no="4" location="/Users/user/Documents/dev/testing/ruby_app/app/jobs/message_consumer2.rb:22"/>

09:51:20,515 ERROR [stderr] (Ruby-1-Thread-83: /Users/user/.gem/jruby/1.9/gems/ruby-debug-ide-0.4.23.beta1/lib/ruby-debug-ide.rb:103) 1477: Processing in control: b /Users/user/Documents/dev/testing/ruby_app/app/jobs/message_consumer1.rb:17

09:51:20,516 ERROR [stderr] (Ruby-1-Thread-83: /Users/user/.gem/jruby/1.9/gems/ruby-debug-ide-0.4.23.beta1/lib/ruby-debug-ide.rb:103) 1477: <breakpointAdded no="5" location="/Users/user/Documents/dev/testing/ruby_app/app/jobs/message_consumer1.rb:17"/>

09:51:20,519 ERROR [stderr] (Ruby-1-Thread-83: /Users/user/.gem/jruby/1.9/gems/ruby-debug-ide-0.4.23.beta1/lib/ruby-debug-ide.rb:103) 1477: Processing in control: start

09:51:20,519 ERROR [stderr] (Ruby-1-Thread-83: /Users/user/.gem/jruby/1.9/gems/ruby-debug-ide-0.4.23.beta1/lib/ruby-debug-ide.rb:103) 1477: Starting: running program script

0
Comment actions Permalink

Well, I'd try to pass --debug to torwuebox and if this will not help feel free to file a ticket in our tracker (https://youtrack.jetbrains.com/issues/RUBY)
but please provide a simple project to reproduce the problem.

Regards, Oleg.

0
Comment actions Permalink

Ok I will do thanks.

0

Please sign in to leave a comment.