[jboss-jira] [JBoss JIRA] Commented: (JBAS-8455) HTTP InvokerLocators being formed incorrectly with IPv6 bind address

Richard Achmatowicz (JIRA) jira-events at lists.jboss.org
Fri Sep 24 10:11:28 EDT 2010


    [ https://jira.jboss.org/browse/JBAS-8455?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12553061#action_12553061 ] 

Richard Achmatowicz commented on JBAS-8455:
-------------------------------------------

I had an idea on how to solve this and ran it past Brian and he seems to think its OK.

When dealing with Strings and string replacement, the ServiceBindingManager uses a method called StringReplacementServiceBindingValueSourceImpl.replaceHostAndPort() to look through the input string passed as a parameter to getStringBinding(), and it looks for all instances of ${host} and ${port} in the string and simply replaces these tokens with the actual hostname and port which are in the ServiceBinding instance for that service name.  The change I propose is as follows:

- introduce a new substitution parameter ${hostforurl} which returns either:
* the hostname stored in the ServiceBinding.hostname field, if this is the case
* the IPv4 literal stored in the ServiceBinding.hostname field, if this is the case
* the IPv6 literal stored in the ServiceBinding.hostname field, if this is the case, but now enclosed in square brackets
- add a few lines of code to check if the hostname was an IPv6 literal, and if so, add the brackets

With this in place, the URL example above could be written as
 
 <value-factory bean="ServiceBindingManager" method="getStringBinding">
      <parameter>jboss.web:service=WebServer</parameter>
      <parameter>${hostforurl}:${port}/invoker/EJBInvokerServlet</parameter>
    </value-factory> 

and the URL would be well formed, even if the bind address was an IPv6 literal. Thus, by changing the URL templates in the bean config files, we could at least get all our services started with the correct attributes. If a service or code section dd not involve the service binding manager, then this would not help.






> HTTP InvokerLocators being formed incorrectly with IPv6 bind address
> --------------------------------------------------------------------
>
>                 Key: JBAS-8455
>                 URL: https://jira.jboss.org/browse/JBAS-8455
>             Project: JBoss Application Server
>          Issue Type: Bug
>      Security Level: Public(Everyone can see) 
>          Components: Integration
>    Affects Versions: 6.0.0.M4
>            Reporter: Richard Achmatowicz
>            Assignee: Shelly McGowan
>             Fix For: TBD-6.x
>
>
> When we boot the AS using an IPv6 bind address, many HTTP invoker locators are formed incorrectly as URLs.
> For example, for the MBean service=invoker,type=httpHA, its invoker locator is given as:
> http://3ffe:ffff:0100:f101::1:8080/invoker/EJBInvokerHAServlet
> instead of the correct:
> http://[3ffe:ffff:0100:f101::1]:8080/invoker/EJBInvokerHAServlet
> The source of the problem is in the Http Invoker Service Configuration, defined in deploy/httpha.invoker.sar/META-INF/jboss-service.xml, where the invoker locators are constructed. The URLs are constructed by taking the hostname and port, appending a fixed prefix and appending a fixed suffix, without taking the type of IP address into account.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the jboss-jira mailing list