[jboss-jira] [JBoss JIRA] Commented: (JBAS-7705) Inconsistent handling of system properties in org.jboss.Main
Brian Stansberry (JIRA)
jira-events at lists.jboss.org
Sat Feb 6 21:08:19 EST 2010
[ https://jira.jboss.org/jira/browse/JBAS-7705?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12510832#action_12510832 ]
Brian Stansberry commented on JBAS-7705:
----------------------------------------
This is wrong too:
final String propKeyJBossasBindAddress = JBossASServerConfig.PROP_KEY_JBOSSAS_BIND_ADDRESS;
if (props.get(propKeyJBossasBindAddress) == null)
{
// JBossASServerConfig.PROP_KEY_JBOSSAS_BIND_ADDRESS could have been defined via
// run.conf and so we don't wanna override that.
final String defaultBindAddress = "127.0.0.1";
props.put(propKeyJBossasBindAddress, defaultBindAddress);
System.setProperty(propKeyJBossasBindAddress, defaultBindAddress);
}
When that is executed, 'props' is empty, so we'll always drop into the if block and set the system property. Effect is any jboss.bind.address value passed to java (i.e. not as an arg to main) will be lost.
> Inconsistent handling of system properties in org.jboss.Main
> ------------------------------------------------------------
>
> Key: JBAS-7705
> URL: https://jira.jboss.org/jira/browse/JBAS-7705
> Project: JBoss Application Server
> Issue Type: Bug
> Security Level: Public(Everyone can see)
> Affects Versions: JBossAS-6.0.0.M1
> Reporter: Brian Stansberry
> Assignee: Brian Stansberry
> Fix For: JBossAS-6.0.0.M2
>
>
> The handling of the org.jboss.Main props field is inconsistent with respect to how it interacts with system properties. In AS trunk 'props' is a Map<String, String> used to store "all of the required information to get the server up and running." There is some effort to keep the data in props consistent with system properties but it is incomplete.
> 1) System properties passed to java (i.e. not as args to main). Unlike in earlier releases, 'props' is no longer initialized with the current system properties values. So, any system properties passed to java that match what we want to store in 'props' won't end up in 'props'.
> 2) -D handling. We check for -Djboss.bind.address and ensure the value ends up in 'props', but we don't check for the other relevant system properties.
> 3) -P handling. After loading any specified properties file into System.properties, again there is no check for any system properties that match what we want to store in 'props'.
> Probably the simplest fix here is, after all the command line arguments are processed, System.properties should be checked for any interesting properties, with the values stored in 'props'.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the jboss-jira
mailing list