2014-07-09 4 views
0

Spring과 함께 파일을 업로드하려고하는데 이해가 안되는 문제에 직면 해 있습니다. 내가 얻을 오류가있어 여기Spring 프레임 워크를 사용한 Ftp 파일 전송

<bean id="ftpClientFactory" 
     class="org.springframework.integration.ftp.session.DefaultFtpSessionFactory"> 
    <property name="host" value="127.0.0.1"/> 
    <property name="port" value="21"/> 
    <property name="username" value="test"/> 
    <property name="password" value="test"/> 
    <property name="clientMode" value="0"/> 
</bean> 

<si:channel id="ftpChannel"/> 

<int-ftp:outbound-channel-adapter id="ftpOutbound" 
            channel="ftpChannel" 
            remote-directory="/Users/testUser" 
            session-factory="ftpClientFactory"/> 

과 :

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'ftpOutbound': Cannot resolve reference to bean 'org.springframework.integration.file.remote.handler.FileTransferringMessageHandler#0' while setting bean property 'handler'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.integration.file.remote.handler.FileTransferringMessageHandler#0': Cannot create inner bean '(inner bean)' of type [org.springframework.integration.file.remote.session.SessionFactoryFactoryBean] while setting constructor argument; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name '(inner bean)': Unsatisfied dependency expressed through constructor argument with index 1 of type [boolean]: Could not convert constructor argument value of type [java.lang.String] to required type [boolean]: Failed to convert value of type 'java.lang.String' to required type 'boolean'; nested exception is java.lang.IllegalArgumentException: Invalid boolean value [] 

어떤 생각이 내가 무슨 잘못을하고있는 중이 야 여기

는 어댑터와 세션 팩토리의 나의 정의는? 충고에 감사하다.

답변

1

<int-ftp:outbound-channel-adapter> 구성에 cache-sessions="true"을 추가해야합니다.

하지만 Spring Integration 2.1은 매우 오래된 버전이며 이미 EOL입니다. 최신 버전으로 전환하면 더 좋을 것입니다. http://projects.spring.io/spring-integration

+0

cache-sessions를 추가하고 최신 버전의 스프링 통합으로 전환 했으므로 이제이 오류가 발생합니다 : org.springframework.beans.factory.xml. XmlBeanDefinitionStoreException : 클래스 경로 리소스 [citrus-context.xml]의 XML 문서에있는 553 번째 줄이 잘못되었습니다. 상자의 예외는 org.xml.sax.SAXParseException입니다. systemId : http://www.springframework.org/schema/integration/ftp/spring-integration-ftp.xsd; lineNumber : 553; columnNumber : 71; src-resolve : 'integration : smartLifeCycleAttributeGroup'을 (n) '속성 그룹'구성 요소로 해석 할 수 없습니다. – mlethys

+0

인터넷이 아닌 CLASSPATH에서 XSD를 확인하려면 모든 Spring Integration jar를 업그레이드하고 Spring Nature에 맞게 IDE를 구성해야합니다. 그리고'cache-sessions'는 2.2 이후 삭제되었습니다. 최신 버전을 사용하면 캐싱 기능을 얻기 위해 대상'sesssionFactory' 주위에'CachingSessionFactory'를 설정해야합니다. –

관련 문제