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 166025 - glassfish v3 create domain fails when gf installRoot contains whitespace
Summary: glassfish v3 create domain fails when gf installRoot contains whitespace
Status: RESOLVED FIXED
Alias: None
Product: serverplugins
Classification: Unclassified
Component: GlassFish (show other bugs)
Version: 6.x
Hardware: Macintosh All
: P2 blocker (vote)
Assignee: Vince Kraemer
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-05-26 12:44 UTC by charly4711
Modified: 2009-06-10 08:05 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
SSCCE (1.59 KB, text/plain)
2009-05-26 12:53 UTC, charly4711
Details
suggested fix (2.79 KB, text/plain)
2009-05-26 12:54 UTC, charly4711
Details

Note You need to log in before you can comment on or make changes to this bug.
Description charly4711 2009-05-26 12:44:51 UTC
On a fresh userdir when starting up NB with a com.glassfish.v3.installRoot pointing to a glassfish v3xxx installation
where the installRoot contains whitespace, creation of a domain will fail. If the user has write permission on the
installRoot, a pre-existing domain1 will be used, no new domains can be created, though. If the user does not have write
permission in installRoot, the glassfish.common module will try to create a personal domain and fail.

This happens even with proper quoting of the installRoot property.
Comment 1 charly4711 2009-05-26 12:49:49 UTC
The root-cause seems to be a limitation of Runtime.exec. That call properly quotes all arguments passed in an array of
Strings ... except for the first, i. e. the executable to run. And I cannot seem to be able to do that manually, either.

A workaround is to not call the asadmin script, but java, thus moving the whitespace in installRoot from the first to a
subsequent element of the array passed to Runtime.exec. This would still break on a --jdkhome with whitespace included,
but I think that would break other things, too.
Comment 2 charly4711 2009-05-26 12:53:28 UTC
Created attachment 82792 [details]
SSCCE
Comment 3 charly4711 2009-05-26 12:54:24 UTC
Created attachment 82793 [details]
suggested fix
Comment 4 Vince Kraemer 2009-05-27 23:34:19 UTC
Thanks for the patch.  I don't think this will be 'in' for 6.7, but we should be able to include it in 6.8 very soon.
Comment 5 Petr Jiricka 2009-05-28 09:04:47 UTC
Or we could put it into NetBeans 6.7 after RC1 before RC2, if this is seen as important.
Comment 6 Vince Kraemer 2009-05-28 15:23:10 UTC
true... I have been a little too focused on getting rc1 finished.  I had forgotten that we would have an rc2!
Comment 7 Quality Engineering 2009-06-04 08:59:23 UTC
Integrated into 'main-golden', will be available in build *200906040201* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/cf273d2366ed
User: Vince Kraemer <vkraemer@netbeans.org>
Log: #166025: asadmin has space in path issues when triggered via Runtime.exec(String[])
Comment 8 Vince Kraemer 2009-06-10 08:05:51 UTC
in main-golden