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 97590

Summary: RoR Needs Improved Mongrel Server Integration
Product: ruby Reporter: William Leonard <bleonard>
Component: CodeAssignee: Torbjorn Norbye <tor>
Status: RESOLVED FIXED    
Severity: blocker    
Priority: P3    
Version: 6.x   
Hardware: PC   
OS: Windows XP   
Issue Type: DEFECT Exception Reporter:
Attachments: File to add to userdir until autoupdate provides it

Description William Leonard 2007-03-09 20:32:42 UTC
I have the mongrel web server installed with Rails, which Rails then uses as its
default web server - no configuration necessary. When creating a project,
NetBeans starts mongrel and everything works, however, like WEBrick, there's no
way to manage the server. To stop it, you must kill ruby.exe.
Comment 1 Torbjorn Norbye 2007-03-12 22:00:22 UTC
There are stop/restart buttons in the server window now. Also, I believe killing
webrick should be fixed (at least it is on OSX). Can you see whether this works
better with a current build? (e.g. Ruby Feature level 0.35 or later).
Comment 2 William Leonard 2007-03-14 18:58:14 UTC
Tor, I just installed Ruby from the update center and it appears to be Feature
level 0.29. From where can I get 0.35?

/Brian
Comment 3 Torbjorn Norbye 2007-03-14 19:16:32 UTC
This is driving me crazy. The "Daily" update center seems to be way way slower than Daily.

Try http://wiki.netbeans.org/wiki/view/RubyInstallation/.
Comment 4 William Leonard 2007-03-19 19:00:17 UTC
Tor,

How do I check the Ruby Feature level? After installing your latest from
http://wiki.netbeans.org/wiki/view/RubyInstallation and then going to the module
manager the Ruby IDE Support module is version 0.31.0. Should I be looking at
something else.?

Using the latest version from
http://wiki.netbeans.org/wiki/view/RubyInstallation, I'm able to start and stop
Mongrel - but just once. Trying to stop a 2nd time caused the following exception:

java.util.ConcurrentModificationException
	at java.util.AbstractList$Itr.checkForComodification(AbstractList.java:372)
	at java.util.AbstractList$Itr.next(AbstractList.java:343)
	at
org.netbeans.modules.ruby.rubyproject.execution.StopAction.actionPerformed(StopAction.java:81)
	at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995)
	at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2318)
	at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387)
	at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242)
	at
javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:236)
	at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:272)
	at java.awt.Component.processMouseEvent(Component.java:6038)
	at javax.swing.JComponent.processMouseEvent(JComponent.java:3260)
	at java.awt.Component.processEvent(Component.java:5803)
	at java.awt.Container.processEvent(Container.java:2058)
	at java.awt.Component.dispatchEventImpl(Component.java:4410)
	at java.awt.Container.dispatchEventImpl(Container.java:2116)
	at java.awt.Component.dispatchEvent(Component.java:4240)
	at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4322)
	at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3986)
	at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3916)
	at java.awt.Container.dispatchEventImpl(Container.java:2102)
	at java.awt.Window.dispatchEventImpl(Window.java:2429)
	at java.awt.Component.dispatchEvent(Component.java:4240)
[catch] at java.awt.EventQueue.dispatchEvent(EventQueue.java:599)
	at
java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:273)
	at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:183)
	at
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:173)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:168)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:160)
	at java.awt.EventDispatchThread.run(EventDispatchThread.java:121)
Comment 5 Torbjorn Norbye 2007-03-19 21:12:42 UTC
The easiest way to check the Ruby Feature level is when you're in the Update Center - in the Features 
category, select the Ruby entry, and look at the "Available Version" text field below. Right now it says 
0.38.

However, I just today checked in some vital fixes which should make process execution work better. 
(However, I don't have Windows, and there is a lot of platform specific code here, so I would love to get 
feedback from anyone on Windows to see if the new code works or breaks everything). This will be in 
feature level 0.39, which probably won't hit the daily update center for a couple of days.

You might want to try this using the ruby ide itself or get a new kit from deadlock; this is all 
documented here:

http://wiki.netbeans.org/wiki/view/RubyInstallation

and bits are already available. This is faster than the daily update center.

The new code basically bypasses the JRuby launcher scripts completely (launching the VM directly) 
which I'm hoping will avoid the issues which has plagued process termination, especially on Windows.

(By the way, in the same version I have also fixed execution of native ruby, so your blog tutorial which 
described that the next entry would be on using native ruby should now be possible. Mongrel is known 
to have some native code (there is a jruby-extras project to replace those parts with java) so its 
possible Mongrel might have other issues for you as well if you're using JRuby without the native code 
replacement.)

Comment 6 William Leonard 2007-03-21 18:55:36 UTC
I just installed feature level 0.39 on Windows which I've configured to point to
native Ruby. It now fails with:

D:\Software\Ruby\InstantRails-1.6-win\InstantRails\ruby\bin\ruby.exe: no such
file to load -- D:\UserDirs\Ruby\sync-stdio.rb (LoadError)

Trying to start Mongrel (which is true, sync-stdio.rb doesn't exist.

The work around is to start Mongrel from the command line.
Comment 7 Torbjorn Norbye 2007-03-21 21:17:33 UTC
The problem you are seeing (missing sync-stdio.rb) is because of bug #98478 -- the file is missing from 
the Auto Update NBM file.  I'll attach it to this issue - copy it to your userdir (as shown in the path below) 
and you should be up and running. This was fixed in 0.42 but unfortunately it will probably take a couple 
of days to hit the update center.
Comment 8 Torbjorn Norbye 2007-03-21 21:18:34 UTC
Created attachment 39783 [details]
File to add to userdir until autoupdate provides it
Comment 9 Torbjorn Norbye 2007-03-28 18:28:48 UTC
As of 0.50, Mongrel is supported. Just install it via the Gem Manager and everything else should be 
automagic.  (Tested with native ruby)
Comment 10 Jiri Kovalsky 2007-07-03 14:14:00 UTC
Reassigning this issue to newly created 'ruby' component.
Comment 11 Jiri Kovalsky 2007-07-03 14:44:27 UTC
Changing target milestone of all resolved Ruby issues from TBD to 6.0 Beta 1 build.