Hello Niklas,

I'd like  the configurable part of my ftpserver (e.g., IP -since we have
several hosts) in a property file using PropertyPlaceholderCinfigurer
Its use is explained here:
http://static.springframework.org/spring/docs/2.5.x/reference/beans.html#beans-factory-placeholderconfigurer
This way IT people can modify a properties file which is simpler for them
than editing the full spring xml.

The thing is I'm not familiar with Spring so - can we use this approach
using the customized XML config ? For example, I've tried to define "port"
as ${port} but it is not working; furthermore I've tried to define one of
the "value" of one of the properties of a beans:bean element (the datasource
configuration) and it is still not working so I wonder if i made a mistake
somewhere.



So, can you give me a hand with this ? my file starts with:

* I've use classpath:com/.../  to check if it was a problem with
file:fullpath/minaftp.properties

<beans:beans 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
           ">

       <beans:bean id="properties"
class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"
>
        <beans:property name="locations">

<beans:value>classpath:com/mycompany/ftpserver/minaftp.properties</beans:value>
        </beans:property>
    </beans:bean>


    <server id="server">

My datasource config is :
               <data-source>
                        <beans:bean
class="org.springframework.jndi.JndiObjectFactoryBean">
                                <beans:property
name="jndiName"><beans:value>${config.name}</beans:value></beans:property>
                        </beans:bean>
                </data-source>

I'm stuck with a NameNotFoundException ${config.name} not found.


If anyone could point me on the right direction I'd most grateful.

Cheers,
  David Latorre

Reply via email to