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 97321 - cannot run multiple projects (multiple webrick instances?)
Summary: cannot run multiple projects (multiple webrick instances?)
Status: RESOLVED FIXED
Alias: None
Product: ruby
Classification: Unclassified
Component: Code (show other bugs)
Version: 6.x
Hardware: All Windows XP
: P2 blocker (vote)
Assignee: Pavel Buzek
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-03-06 22:07 UTC by Pavel Buzek
Modified: 2007-07-03 14:45 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
proposed fix (15.65 KB, patch)
2007-03-09 16:40 UTC, Pavel Buzek
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Pavel Buzek 2007-03-06 22:07:25 UTC
I did not find a way to run multiple projects from IDE. The first project asks
for an available port and starts webrick, if I create a second project it will
not do anything with webrick. I can see the pages of the first project but not
the pages of the second one, obviously. Do we need UI for multiple instances in
Runtime tab, start a new instance for every project with a new port, etc?
Comment 1 Pavel Buzek 2007-03-08 02:17:30 UTC
I'm looking at this.
Comment 2 Pavel Buzek 2007-03-09 16:40:57 UTC
Created attachment 39346 [details]
proposed fix
Comment 3 Pavel Buzek 2007-03-09 16:42:22 UTC
summary of changes in the proposed fix:
- WEBrick is not a singleton, an instance is stored in every rails project
- port conflict detection is based on pinging the port with an HTTP GET request
- copied from tomcat support
  (I still keep the detection of error in output as a fall back, but it should
not be used AFAICT)
- if there is a conflict it does not ask for port number, just attempts to use
port + 1 until it finds a free port
  (on the assumption that there will be port conflict more often then not in a
multi project scenario)
- name on output tab is WEBrick for {project name} on {3001}
- only relative URL is being passed to showUrl (server knows its url)
- I only tested with JRuby

remaining issues (not solved by the patch)
- keep track of ports used by open project
- start from 3000, remove the dialog that asks for the port to use(?)
- separate node for each WEBrick in Runtime tab
Comment 4 Pavel Buzek 2007-03-09 21:34:44 UTC
BTW, I found that there may still occasionally be a problem with the code that
detects availability of port. There is a timeout - cusrrently set to 3000ms -
and if the system is busy it will not detect the server running on the port and
will attempt to start WEBrick. This happened to me when creating a new project
right after startup. We may want to keep the code that parses the output as a
back for this case.
Comment 5 Pavel Buzek 2007-03-10 03:43:00 UTC
fixed by tor (tx)
Comment 6 Jiri Kovalsky 2007-07-03 14:03:55 UTC
Reassigning this issue to newly created 'ruby' component.
Comment 7 Jiri Kovalsky 2007-07-03 14:45:26 UTC
Changing target milestone of all resolved Ruby issues from TBD to 6.0 Beta 1 build.