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 31396 - Hard to run more than one copy of Open File Server on the same machine
Summary: Hard to run more than one copy of Open File Server on the same machine
Status: RESOLVED FIXED
Alias: None
Product: utilities
Classification: Unclassified
Component: Code (show other bugs)
Version: 3.x
Hardware: All All
: P4 blocker (vote)
Assignee: Jesse Glick
URL:
Keywords: ARCH, UI
Depends on: 32054 36046
Blocks: 2425 2428 31327
  Show dependency tree
 
Reported: 2003-02-24 12:27 UTC by Jaroslav Tulach
Modified: 2004-03-04 22:53 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jaroslav Tulach 2003-02-24 12:27:51 UTC
The NetBeans IDE uses dedicated ports to listen to
external actions (scripting server, HTTP server
and OpenFile server). This prevents seemless
cooexistence of multiple instances on the same
computer.

Should be at least documented if not fixed.
Comment 1 Jesse Glick 2003-04-24 15:13:32 UTC
Fixed how?
Comment 2 Jaroslav Tulach 2003-04-24 16:17:27 UTC
When an IDE is started, it writes a file into the userdirectory,
containing a secret key as well as a port number that the instance
will listen to. Then whenever one wants to connect to the IDE or start
it again, the newly running process can read the port number and
secret key and telnet to the port some command - for example "open
file" or "give me the port number telnet is listening to" or "give me
your http server port".

The lockfile and internal port + security would be implemented by the
infrastructure and there would be a "CLI API" that modules could
enhance and react to various command line options. So utilities module
would add "--open file" option and httpserver "--http status" option, etc.

This could in my opinion cleanup the runide.*
Comment 3 iformanek 2003-08-06 16:36:00 UTC
We should probably remove the openfile functionality 
anyway, since it does not seem to be very frequently used, 
is unreliable and causes a problems with multiple IDE 
instances.
Comment 4 Jaroslav Tulach 2003-08-06 16:39:18 UTC
I have written a proposal 
http://openide.netbeans.org/proposals/arch/cli.html
and prototype which solves problem with multiple instances and  with
unreliability very likely as well.
Comment 5 iformanek 2003-08-06 16:46:13 UTC
Reassigning to utilities module (the home of openfile)
Comment 6 Jesse Glick 2003-08-07 14:51:28 UTC
Not a docs issue, should be fixed.
Comment 7 Jesse Glick 2003-09-09 20:17:50 UTC
BTW one thing that should be fixed up when converting openfile along
these lines: the openfile API (and utilities.jar cmdline interface)
supports a -line option to specify a line number in the file. (This is
pretty much necessary for a *.xml file: if you don't specify it, the
file is opened for some reason in a web browser!) However the
runide.sh interface does not support this option. Would be easier to
fix (given the existence of both the cmdline interface and the
${netbeans.openfile} sysprop) using issue #32054's infrastructure.
Comment 8 Jesse Glick 2003-09-10 19:44:47 UTC
I am working on it, to test issue #32054.
Comment 9 Jesse Glick 2003-09-11 02:22:18 UTC
Have working patch based on #32054. (Patching utilities/projects too.)
Works nicely. Just use

-open FILE

or

-open FILE:LINE

on the NB command line and the file will be opened. If NB is not
already running, it is started, and when the GUI comes up, then the
request is processed. Entirely implemented in utilities module, no
special support in core other than the general CLIHandler hook.

Removing Open File Server, both in code and UI - it is no longer
necessary.
Comment 10 Jaroslav Tulach 2003-09-11 12:41:18 UTC
Do you plan to apply the change? I remember that when I worked on the
core part the CLIHandler seemed to me like a bad API, too general and
not suitable for cooperation between modules. Also I did not know
where to put it. The API should probably be in org.openide.modules,
but that JAR file cannot be referenced from boot.jar (where the core
impl is). So I stoped work on it and wanted to finish openide.jar
separation first and place openide-util.jar and openide-modules.jar on
the classpath as boot.jar is.
Comment 11 Jesse Glick 2003-09-11 18:48:11 UTC
Re. poor API - some improvements made since then, see issue #32054 for
details. Anyway, consider this a "friend" API for now, to improve on
the poor existing situation. A cleaner API for the future (e.g. using
getopt) is still a possibility.

committed 1.50  core/release/bin/runide.sh
committed 1.357 nbbuild/build.xml
committed 1.42  utilities/build.xml
committed 1.51  utilities/manifest.mf
added     1.1   utilities/clisrc/META-INF/services/org.netbeans.CLIHandler
added     1.1  
utilities/clisrc/org/netbeans/modules/openfile/cli/Callback.java
added     1.1  
utilities/clisrc/org/netbeans/modules/openfile/cli/Handler.java
committed 1.4   utilities/projects/build.xml
committed 1.3   utilities/projects/manifest.mf
committed 1.3  
utilities/projects/src/org/netbeans/modules/openfile/projects/OpenFileImpl.java
added     1.1  
utilities/src/META-INF/services/org.netbeans.modules.openfile.cli.Callback
committed 1.33 
utilities/src/org/netbeans/modules/openfile/Bundle.properties
added     1.1  
utilities/src/org/netbeans/modules/openfile/CallbackImpl.java
committed 1.2  
utilities/src/org/netbeans/modules/openfile/DefaultOpenFileImpl.java
removed   1.16  utilities/src/org/netbeans/modules/openfile/Main.java
committed 1.58  utilities/src/org/netbeans/modules/openfile/OpenFile.java
committed 1.30 
utilities/src/org/netbeans/modules/openfile/OpenFileAction.java
committed 1.4  
utilities/src/org/netbeans/modules/openfile/OpenFileImpl.java
removed   1.1  
utilities/src/org/netbeans/modules/openfile/Openfile.settings
committed 1.6  
utilities/src/org/netbeans/modules/openfile/PackagePanel.java
removed   1.25  utilities/src/org/netbeans/modules/openfile/Server.java
committed 1.32  utilities/src/org/netbeans/modules/openfile/Settings.java
removed   1.22 
utilities/src/org/netbeans/modules/openfile/SettingsBeanInfo.java
committed 1.27 
utilities/src/org/netbeans/modules/utilities/Installer.java
committed 1.51  utilities/src/org/netbeans/modules/utilities/Layer.xml
committed 1.6   utilities/www/plans/plan.xml
Comment 12 Patrick Keegan 2004-03-04 22:53:09 UTC
removing RELNOTE keyword