[jboss-jira] [JBoss JIRA] Commented: (JBAS-7224) Main.ServerConfigUtil.fixRemoteAddressProperty() ignores defaultValue
Dimitris Andreadis (JIRA)
jira-events at lists.jboss.org
Wed Sep 2 13:33:23 EDT 2009
[ https://jira.jboss.org/jira/browse/JBAS-7224?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12484230#action_12484230 ]
Dimitris Andreadis commented on JBAS-7224:
------------------------------------------
Brian changed org.jboss.Main from:
// Fix up other bind addresses
String bindAddress = System.getProperty(JBossASServerConfig.PROP_KEY_JBOSSAS_BIND_ADDRESS);
if (System.getProperty("java.rmi.server.hostname") == null)
System.setProperty("java.rmi.server.hostname", bindAddress);
To:
// Make sure some address properties are set and/or don't specify
// a "any local address" value that's useless for their intended usage
String defaultAddress = System.getProperty(JBossASServerConfig.PROP_KEY_JBOSSAS_BIND_ADDRESS);
ServerConfigUtil.fixRemoteAddressProperty("java.rmi.server.hostname", defaultAddr)
So essentially if 'java.rmi.server.hostname' is not specified (which is not for most cases) the 'fixed jboss.bind.address should be used instead.
The problem was that Main.ServerConfigUtil.fixRemoteAddressProperty() ignores defaultValue and just puts InetAddress.getLocalHost().getHostName() in the specified property.
And that caused the RMI server codebase to point to a non-local address, even though the server binds by default to 128.0.0.1
20:24:04,828 INFO [WebService] Using RMI server codebase: http://poseidon:1083/
> Main.ServerConfigUtil.fixRemoteAddressProperty() ignores defaultValue
> ---------------------------------------------------------------------
>
> Key: JBAS-7224
> URL: https://jira.jboss.org/jira/browse/JBAS-7224
> Project: JBoss Application Server
> Issue Type: Sub-task
> Security Level: Public(Everyone can see)
> Components: System service
> Reporter: Dimitris Andreadis
> Assignee: Dimitris Andreadis
> Fix For: JBossAS-5.2.0.Beta1
>
>
> I was looking why the server didn't not boot cleanly after the change in the parent issue and it turns out it triggers a bug in Main.ServerConfigUtil.fixRemoteAddressProperty.
> public static void fixRemoteAddressProperty(String systemPropertyName,
> String defaultValue)
> {
> String old = System.getProperty(systemPropertyName);
> if (old == null)
> {
> if (defaultValue != null)
> {
> String fixed = fixRemoteAddress(old); <<< HERE should be 'defaultValue' instead
> System.setProperty(systemPropertyName, fixed);
> }
> }
> else
> {
> String fixed = fixRemoteAddress(old);
> System.setProperty(systemPropertyName, fixed);
> }
> }
--
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