XML config local-address element does not set server address correctly
----------------------------------------------------------------------

                 Key: FTPSERVER-153
                 URL: https://issues.apache.org/jira/browse/FTPSERVER-153
             Project: FtpServer
          Issue Type: Bug
    Affects Versions: 1.0-M2
            Reporter: Niklas Gustavsson
            Assignee: Niklas Gustavsson
             Fix For: 1.0-M3


The documentation example on the page 
http://mina.apache.org/ftpserver/listeners.html

shows the "local-address" attribute for the <nio-listener> element. But this 
results in an exception:

org.springframework.beans.InvalidPropertyException: Invalid property 
'localAddress' of bean class [org.apache.ftpserver.listener.nio.NioListener]: 
No property 'localAddress' found

I checked the code of the NioListener and AbstractListener class and there is a 
setServerAddress() method. So I tried <nio-listener server-address="..."> 
instead, but now the XML file doesn't validate against ftpserver-1.0.xsd. I 
have also tried to change the "local-address" to "server-address" in 
ftpserver-1.0.xsd. Now, I don't get any exceptions but the server address is 
still not set. This, I think, is because the ListenerBeanDefinitionParser class 
is looking for local-address attribute. Am I correct about this and may the 
following change to the ListenerBeanDefinitionParser class fix this problem?

InetAddress serverAddress = SpringUtil.parseInetAddress(element, 
"server-address");
       if(serverAddress != null) {
           builder.addPropertyValue("serverAddress", serverAddress);
       }

If so, I may try to provide a patch, but it will not be until next week.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to