You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mina.apache.org by "Niklas Gustavsson (JIRA)" <ji...@apache.org> on 2008/08/13 13:30:45 UTC

[jira] Created: (FTPSERVER-153) XML config local-address element does not set server address correctly

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.


[jira] Closed: (FTPSERVER-153) XML config local-address element does not set server address correctly

Posted by "Niklas Gustavsson (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/FTPSERVER-153?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Niklas Gustavsson closed FTPSERVER-153.
---------------------------------------

    Resolution: Fixed

Fixed and test added. XML schema unchanged, setting local-address should now work.

svn commit "/media/big/home/svn/apache/ftpserver-trunk/core/src/main/java/org/apache/ftpserver/config/spring/ListenerBeanDefinitionParser.java" "/media/big/home/svn/apache/ftpserver-trunk/core/src/test/java/org/apache/ftpserver/config/spring/SpringConfigTest.java" "/media/big/home/svn/apache/ftpserver-trunk/core/src/test/resources/spring-config/config-spring-1.xml" -N -m "Setting the correct property on NioListener for local addressn (FTPSERVER-153)" --username "ngn"
	M /media/big/home/svn/apache/ftpserver-trunk/core/src/main/java/org/apache/ftpserver/config/spring/ListenerBeanDefinitionParser.java
	M /media/big/home/svn/apache/ftpserver-trunk/core/src/test/java/org/apache/ftpserver/config/spring/SpringConfigTest.java
	M /media/big/home/svn/apache/ftpserver-trunk/core/src/test/resources/spring-config/config-spring-1.xml
	  Transmitting file data: /media/big/home/svn/apache/ftpserver-trunk/core/src/main/java/org/apache/ftpserver/config/spring/ListenerBeanDefinitionParser.java
	  Transmitting file data: /media/big/home/svn/apache/ftpserver-trunk/core/src/test/java/org/apache/ftpserver/config/spring/SpringConfigTest.java
	  Transmitting file data: /media/big/home/svn/apache/ftpserver-trunk/core/src/test/resources/spring-config/config-spring-1.xml
Committed revision 685522

> 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.