[jboss-jira] [JBoss JIRA] Updated: (JBAS-3325) Remove old code

Dimitris Andreadis (JIRA) jira-events at jboss.com
Mon Jul 24 13:45:11 EDT 2006


     [ http://jira.jboss.com/jira/browse/JBAS-3325?page=all ]

Dimitris Andreadis updated JBAS-3325:
-------------------------------------

    Issue Type: Bug  (was: Task)
      Assignee: Dimitris Andreadis
      Priority: Major  (was: Optional)

>From a quick look, the code might seems obsolete but  "java.rmi.server.hostname" is not used at all, so I changed this to a bug and assigned to myself, in case I find the time to look at it for 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.CR1
>
>
> 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: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the jboss-jira mailing list