Hi ,
Somebody please help.Please go through the email threads above and this is the error I see
Error creating bean with name 'scopedTarget.sftpSessionFactory': Scope 'request' is not active for the current thread; consider defining a scoped proxy for this bean if you intend to refer to it from a singleton; nested exception is java.lang.IllegalStateException: No thread-bound request found: Are you referring to request attributes outside of an actual web request, or processing a request outside of the originally receiving thread? If you are actually operating within a web request and still receive this message, your code is probably running outside of DispatcherServlet/DispatcherPortlet: In this case, use RequestContextListener or RequestContextFilter to expose the current request.
I'm not using any HttpRequest.
HTML Code:
<bean id="sftpSessionFactory"
class="org.springframework.integration.sftp.session.DefaultSftpSessionFactory" scope="request">
<aop:scoped-proxy/>
</bean>
<sftp:outbound-channel-adapter channel="sendChannel"
session-factory="sftpSessionFactory" id="sftpInboundAdapter"
auto-create-directory="true"
temporary-file-suffix = "temp"
remote-directory-expression="headers['remote-directory']" />
Code:
@Inject
private DefaultSftpSessionFactory sftpSessionFactory;
@Inject
@Named("sendChannel")
private MessageChannel sftpChannel;
hostname = serverProp.getHostname();
password = serverProp.getPassword();
username = serverProp.getUsername();
remoteDir = serverProp.getRemoteDir();
sftpSessionFactory.setHost(hostname);
sftpSessionFactory.setUser(username);
sftpSessionFactory.setPassword(password);
Message<File[]> message = MessageBuilder
.withPayload(zippedFilesList)
.setHeader("remote-directory",remoteDir).build();
if(sftpChannel != null && message != null)
sftpChannel.send(message);
The above error shown is thrown at the code which is underlined.
Thanks