]
Dimitris Andreadis updated JBAS-3325:
-------------------------------------
Fix Version/s: JBossAS-4.0.5.GA
(was: JBossAS-4.0.5.CR1)
Remove old code
---------------
Key: JBAS-3325
URL:
http://jira.jboss.com/jira/browse/JBAS-3325
Project: JBoss Application Server
Issue Type: Bug
Security Level: Public(Everyone can see)
Components: Other
Affects Versions: JBossAS-4.0.4.GA
Environment: JBoss 4.0.3.SP1
$ java -version
java version "1.4.2_12"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_12-b03)
Java HotSpot(TM) Client VM (build 1.4.2_12-b03, mixed mode)
$ java -version
java version "1.5.0_07"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_07-b03)
Java HotSpot(TM) Client VM (build 1.5.0_07-b03, mixed mode, sharing)
Reporter: Robert Schroeder
Assigned To: Dimitris Andreadis
Fix For: JBossAS-4.0.5.GA
http://wiki.jboss.org/wiki/Wiki.jsp?page=UsingJBossBehindAFirewall mentions the parameter
"java.rmi.server.hostname" to set if the external host name differs from the
local host (e.g. server machine is behind a firewall)
But org.jboss.web.WebService doesn'r recognize this parameter:
String hostname = server.getBindAddress(); // this always returns something, at
least "0.0.0.0"!
// If not user specified hostname given, then try to determine what it should be
if (hostname == null) //this branch is never executed!
{
// First look for the rmi server name
try
{
hostname = System.getProperty("java.rmi.server.hostname"); // this
parameter is not recognized as this branch is never executed
}
catch (SecurityException e)
{
// ignore, but don't be silent
ThrowableHandler.addWarning(e);
}
// else use the localhost name
if (hostname == null)
{
try
{
hostname = InetAddress.getLocalHost().getHostName();
}
catch (IOException e)
{
log.error("Failed to get localhost name; ignoring", e);
}
}
if (hostname != null)
{
setHost(hostname);
}
}
// Host must be set to continue (either by user or detection)
String address = getHost();
if (address == null)
throw new MissingAttributeException("Host");
// Set the rmi codebase if it is not already set
String codebase = System.getProperty("java.rmi.server.codebase");
if (codebase == null)
{
address = ServerConfigUtil.fixRemoteAddress(address);
codebase = "http://" + address + ":" + getPort() +
"/";
System.setProperty("java.rmi.server.codebase", codebase);
}
log.info("Using RMI server codebase: " + codebase);
So the resulting problem is that codebase contains an address which is not reachable from
the other side of firewall because "java.rmi.server.hostname" is not recognized
(same for "-Djava.rmi.server.useLocalHostname=false" )
Example:
JBoss started with parameter set
"-Djava.rmi.server.hostname=as2.subdomain1.subdomain2.test.com"
but (thanks to rmi logging) the proxy objects on client side have codebase set to
"http://as2:<port>" and not to
"http://as2.subdomain1.subdomain2.test.com:<port>" as expected.
JBoss 4 runs on a linux machine
hostname --> "as2"
hostname -f --> "as2.subdomain1.subdomain2.test.com"
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: