Click here to Skip to main content
15,891,708 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi All, My requirement is to connect a FTP server using camel. i have coded using camel and the ftp also working fine for internal ftp sites (ie., withing organisation) but the problem is for External FTP via proxy it is not connecting , please suggest How to code for connecting External FTP via Proxy using camel

What I have tried:

Java
JndiContext jndiContext = new JndiContext();
                
FTPClient ftpClient = new FTPClient();


InetSocketAddress proxyAddress = new InetSocketAddress ( "xxx.xx" , yyyy);
Proxy proxy = new Proxy( Proxy.Type.HTTP , proxyAddress ); 
//ftpClient.setProxy(proxy);

this.setFtpClient(ftpClient);
// Will be used in ftp component

// FTPClient ftpClient = new FTPClient();
ftpClient.setProxy(proxy);
jndiContext.bind("ftpClient", this.ftpClient);
setCamelContext(new DefaultCamelContext(jndiContext));

ftp://{username}@{host}{path}?password=****&maximumReconnectAttempts=5&reconnectDelay=5000&binary=true&passiveMode=true&delete=true&include=XXX.*\.CSV&ftpClient=#ftpClient

Getting the below ERROR :-
Caused by: java.lang.InternalError: Should not reach here
      at java.net.HttpConnectSocketImpl.doTunneling(HttpConnectSocketImpl.java:181)
      at java.net.HttpConnectSocketImpl.doTunnel(HttpConnectSocketImpl.java:168)
Posted
Updated 27-Jul-17 19:58pm
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900