Hello,

How can I add custom beans that I can reference from user-manager or any other element?

Current error I am getting is:

Caused by: org.xml.sax.SAXParseException: cvc-complex-type.2.4.a: Invalid content was found starting with element 'bean'. One of '{"http://mina.apache.org/ftpserver/spring/v1":ftplets, "http://mina.apache.org/ftpserver/spring/v1":file-user-manager, "http://mina.apache.org/ftpserver/spring/v1":db-user-manager, "http://mina.apache.org/ftpserver/spring/v1":user-manager, "http://mina.apache.org/ftpserver/spring/v1":native-filesystem, "http://mina.apache.org/ftpserver/spring/v1":filesystem, "http://mina.apache.org/ftpserver/spring/v1":commands, "http://mina.apache.org/ftpserver/spring/v1":messages}' is expected.

which I can understand that according to the namespace and xml-schema, SAXParser is not allowing me to have the <beans:bean> tag directly under <Server> but I do include xmlns:beans if you see before.

So, the above error is thrown if I have something like:

<server
    xmlns="http://mina.apache.org/ftpserver/spring/v1";
    xmlns:beans="http://www.springframework.org/schema/beans";
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
    xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd http://mina.apache.org/ftpserver/spring/v1 http://mina.apache.org/ftpserver/ftpserver-1.0.xsd
       "
    id="myServer"
    max-logins="200"
    anon-enabled="false"
    max-anon-logins="0"
    max-login-failures="3"
    login-failure-delay="500"
>

<beans:bean class="mypackage.MyClass" id="myClass1">
</beans:bean>

<user-manager>
<beans:bean class="mypackage.MyUserManager">
<beans:property name="maxLogin" value="20" />
<beans:property name="maxLoginPerIp" value="15" />
<beans:property name="directoryService" ref="myClass1" />
</beans:bean>
</user-manager>

</Server>

Reply via email to