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 104622 - Installer does not register App Server in Servers node
Summary: Installer does not register App Server in Servers node
Status: RESOLVED FIXED
Alias: None
Product: ide
Classification: Unclassified
Component: Code (show other bugs)
Version: 6.x
Hardware: Sun Solaris
: P2 blocker (vote)
Assignee: Jesse Glick
URL:
Keywords: SPACE_IN_PATH
: 105053 (view as bug list)
Depends on:
Blocks: 105470
  Show dependency tree
 
Reported: 2007-05-23 14:55 UTC by Mikhail Vaysman
Modified: 2007-06-04 15:45 UTC (History)
4 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
NBI log (1.36 MB, text/plain)
2007-05-29 14:32 UTC, Mikhail Vaysman
Details
Netbeans log (46.73 KB, text/plain)
2007-05-29 14:34 UTC, Mikhail Vaysman
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Mikhail Vaysman 2007-05-23 14:55:33 UTC
SunOS solaris-devx 5.11 snv_64a i86pc i386 i86pc
Java 1.6.0-b105
Build netbeans-6.0-nightly-200705230000-full-solaris-x86.sh

After successful installation Servers node in Runtime tab is empty.
Comment 1 dlipin 2007-05-29 14:24:35 UTC
please attach installation log (~/.nbi/log/<timestamp>.log) and netbeans log 
file (~/.netbeans/dev/var/log/messages.log).
Comment 2 Mikhail Vaysman 2007-05-29 14:32:30 UTC
Created attachment 42895 [details]
NBI log
Comment 3 Mikhail Vaysman 2007-05-29 14:34:01 UTC
Created attachment 42896 [details]
Netbeans log
Comment 4 Mikhail Vaysman 2007-05-29 14:35:56 UTC
Logs attached. INCOMPLETE keyword removed.
Comment 5 dlipin 2007-05-29 14:48:16 UTC
Due to the investigations I can say that the issue is in the netbeans.conf 
file. 
Now we set the following strings to add appserver instance (on unix):
netbeans_default_options="-J-Dcom.sun.aas.installRoot=\"/home/username/
SUNWappserver\" ..."

If I change it to the following string then everything works fine:
netbeans_default_options="-J-Dcom.sun.aas.installRoot=/home/username/
SUNWappserver ..."
Comment 6 dlipin 2007-05-30 10:02:47 UTC
*** Issue 105053 has been marked as a duplicate of this issue. ***
Comment 7 dlipin 2007-05-30 10:21:56 UTC
According to the SystemProperties module the same property 
com.sun.aas.installRoot in M9 is set to /home/username/
SUNWappserver and in nightly builds to "/home/username/
SUNWappserver" (with quotes) using the netbeans_default_options string in 
netbeans.conf
Comment 8 dlipin 2007-05-30 10:31:53 UTC
I do think that the following changes in nbexec have broken the working in m9 
functionality of AS/AM integration:

http://nbi.netbeans.org/source/browse/core/launcher/unix/nbexec?r1=1.46&r2=1.47

Commit info:
2007-05-15 19:50:27+0000 (2 weeks ago) by jglick
Commit message :
Stronger quoting of -J* options, meaning you can now pass e.g.
-J-Dorg.netbeans.something.Outer$Inner.level=0
(quoted appropriately for your invoking shell) and expect it to work.
Comment 9 dlipin 2007-05-30 10:46:00 UTC
I`ve written the following class:
class Test {
    public Test() {
    }
    public static void main(String[] arguments) {
	System.out.println("" + System.getProperty("property"));
    }
}

> java -Dproperty=VALUE Test
VALUE
> java -Dproperty="VALUE" Test
VALUE
> java -Dproperty=\"VALUE\" Test
"VALUE"

Using the second variant in netbeans.conf is equal to 
netbeans_default_options="-J-Dproperty=\"VALUE\""

Earlier the value of property was correct (VALUE)
In the current implementation it is incorrect ("VALUE").
Since the latest changes in nbexec do not process correctly the quoted values I 
reassing the issue the launcher and to Jesse specifically.
Comment 10 tonybeckham 2007-05-30 22:44:41 UTC
Removing quotes in netbeans.conf for AM_CONFIG_FILE and com.sun.aas.installRoot
does not work for me on any *nix.  Also removing the "\" before does not help
either on Mac, Linux, Solaris.
Comment 11 tonybeckham 2007-05-31 18:39:59 UTC
work around works for me now, also must delete user dir after editing
netbeans.conf for it to work.
Comment 12 Jesse Glick 2007-06-01 01:01:47 UTC
It is true that adding e.g.

  -J-Duser.dir=\"/tmp/foo bar\"

into netbeans_default_options in etc/netbeans.conf does not work. However it
does not work for me with nbexec 1.47 reverted, either (in fact it is worse).

Note that you can pass

  -J-Duser.dir='/tmp/foo bar'

on the command line and it works; the problem is with nb_d_o.

Frankly I do not see any way to fix, other than never adding quotes to values in
nb_d_o, and rejecting any appserver installation dir using spaces. More clever
patches from someone with Bourne shell experience are welcome. I tried various
combinations of quotes and backslashes without success.

I'm not sure what the significance of the attached test class is. The problem is
not in Java code, it is in shell scripts, which cannot very reliably handle
spaces or quotes.
Comment 13 Kirill Sorokin 2007-06-01 08:34:05 UTC
Well, I assume it would be easier to fix on our side. We wil switch to single
quotes (') for wrapping parameter values. And will not use them is there are not
spaces in the path. 

This will give us a reasonable success percentage, I guess.
Comment 14 Jesse Glick 2007-06-01 15:08:39 UTC
I could not get single quotes to work either.
Comment 15 Kirill Sorokin 2007-06-01 15:19:33 UTC
Jesse, I don't know what has happened. Nothing changed on our side and it DID
work for M9 and before. I don't know which build was the first with this
functionality broken. I will look into it a bit further.

Spaces might be not that common, but they are valid and nbexec should be
supporting them IMO.
Comment 16 Jesse Glick 2007-06-01 16:02:45 UTC
So to clarify: my most recent patch just fixed handling of -J* parameters which
included substitutable metachars such as $, by single-quoting them. (Obviously
params including ' itself would be broken by this change, but I consider that
less likely than $.) Parameters just including spaces worked with or without the
patch, if you passed them directly on the command line, e.g.

.../bin/netbeans -J-Dkey='some value'

My patch just made this work too:

.../bin/netbeans -J-Dkey='some$value'

whereas previously 'key' would be incorrectly set to 'some'.

As far as I can tell, parameters with embedded spaces did not work in
netbeans_default_options to begin with, i.e. not a regression.

I *think* I know how to fix this now, using eval. It's always scary to make any
metachar-handling changes in the launcher scripts, since some kind of regression
is quite likely, but let's try.
Comment 17 Jesse Glick 2007-06-01 21:05:35 UTC
Please verify, and I'll see if complaints start coming in.

Checking in apisupport/harness/release/launchers/app.sh;
/shared/data/ccvs/repository/apisupport/harness/release/launchers/app.sh,v  <--
 app.sh
new revision: 1.12; previous revision: 1.11
done
Checking in ide/launcher/unix/netbeans;
/shared/data/ccvs/repository/ide/launcher/unix/netbeans,v  <--  netbeans
new revision: 1.46; previous revision: 1.45
done