You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by alexey-s <al...@mail.ru> on 2013/12/13 09:54:33 UTC

Camel FTP consumer + socketFactory not work correctly

Hi

Camel FTP consumer + socketFactory not work correctly

There is a real FTP server with authorization .
ftp://free:free @ ftp.zakupki.gov.ru: 21 /

The company stands proxy squid. Use HTTP Basic authentication.

Work with FTP being timer .
read.routePolicy.startTime = 0 2/ 5 *** ?
read.routePolicy.stopTime = 0 0 /5 ***?


The first time the process starts and runs properly authorized .
Time authorization 12:07:01,018

After a few minutes prosess stops. At this time, the file is not yet fully
loaded.
You receive an error NullPointerException.

The next cycle is run without using the parameter
   & ftpClient.socketFactory = # socketFactory
Connection time 12:12:11,038


Journal of applied camel-ftp.log
<http://camel.465427.n5.nabble.com/file/n5744716/camel-ftp.log>  


Aleksey



--
View this message in context: http://camel.465427.n5.nabble.com/Camel-FTP-consumer-socketFactory-not-work-correctly-tp5744716.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Camel FTP consumer + socketFactory not work correctly

Posted by Willem Jiang <wi...@gmail.com>.
Thanks for pointing that out. I just updated the code of FtpsEndpoint.

--  
Willem Jiang

Red Hat, Inc.
Web: http://www.redhat.com
Blog: http://willemjiang.blogspot.com(http://willemjiang.blogspot.com/) (English)
http://jnn.iteye.com(http://jnn.javaeye.com/) (Chinese)
Twitter: willemjiang  
Weibo: 姜宁willem



On December 19, 2013 at 1:46:53 AM, alexey-s (alexins@mail.ru) wrote:
>  
> Hi, Willem
>  
> Thanks for the correction of an error.
> Exactly the same error there FtpsEndpoint.
>  
>  
> Aleksey
>  
>  
>  
> --
> View this message in context: http://camel.465427.n5.nabble.com/Camel-FTP-consumer-socketFactory-not-work-correctly-tp5744716p5745005.html  
> Sent from the Camel - Users mailing list archive at Nabble.com.  
>  


Re: Camel FTP consumer + socketFactory not work correctly

Posted by alexey-s <al...@mail.ru>.
Hi, Willem

Thanks for the correction of an error.
Exactly the same error there FtpsEndpoint.


Aleksey



--
View this message in context: http://camel.465427.n5.nabble.com/Camel-FTP-consumer-socketFactory-not-work-correctly-tp5744716p5745005.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Camel FTP consumer + socketFactory not work correctly

Posted by Willem Jiang <wi...@gmail.com>.
I just filled a JIRA[1] for it and committed a quick fix for it.

[1] https://issues.apache.org/jira/browse/CAMEL-7077

--  
Willem Jiang

Red Hat, Inc.
Web: http://www.redhat.com
Blog: http://willemjiang.blogspot.com(http://willemjiang.blogspot.com/) (English)
http://jnn.iteye.com(http://jnn.javaeye.com/) (Chinese)
Twitter: willemjiang  
Weibo: 姜宁willem



On December 18, 2013 at 1:12:54 AM, alexey-s (alexins@mail.ru) wrote:
>  
> Hi
>  
> Add JUnit test for remove paramenters from FtpClient
>  
> FromFtpClientSoTimeout3Test.java
>  
>  
> Aleksey
>  
>  
>  
> --
> View this message in context: http://camel.465427.n5.nabble.com/Camel-FTP-consumer-socketFactory-not-work-correctly-tp5744716p5744955.html  
> Sent from the Camel - Users mailing list archive at Nabble.com.  
>  


Re: Camel FTP consumer + socketFactory not work correctly

Posted by alexey-s <al...@mail.ru>.
Hi

Add JUnit test for remove paramenters from FtpClient

FromFtpClientSoTimeout3Test.java
<http://camel.465427.n5.nabble.com/file/n5744955/FromFtpClientSoTimeout3Test.java>  

Aleksey



--
View this message in context: http://camel.465427.n5.nabble.com/Camel-FTP-consumer-socketFactory-not-work-correctly-tp5744716p5744955.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Camel FTP consumer + socketFactory not work correctly

Posted by Claus Ibsen <cl...@gmail.com>.
On Mon, Dec 16, 2013 at 10:00 AM, alexey-s <al...@mail.ru> wrote:
> Cause of the error.
> Method retrieves the value of the parameter and removes it from the list.
> The following method call will not find these parameters. Parameters were
> destroyed in the first call.
>
> Example FtpsEndpoint.java, line 163.
>              / / And we want to keep data timeout so we can log it later
>              timeout = ftpClientParameters.remove ("dataTimeout");
>
>
> FtpClient work through proxy server immediately identified the error.
>
> I think we should make a copy of ftpClientParameters. Need to remove from
> the copy.
> So we keep the parameters for the next call.
>

Yeah it sounds like a bug. Feel free to log a JIRA ticket. We should
do a local copy of the map first and remove from the local map
instead, so we keep the original options for future use.


>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Camel-FTP-consumer-socketFactory-not-work-correctly-tp5744716p5744831.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
Red Hat, Inc.
Email: cibsen@redhat.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen
Make your Camel applications look hawt, try: http://hawt.io

Re: Camel FTP consumer + socketFactory not work correctly

Posted by alexey-s <al...@mail.ru>.
Cause of the error.
Method retrieves the value of the parameter and removes it from the list.
The following method call will not find these parameters. Parameters were
destroyed in the first call.

Example FtpsEndpoint.java, line 163.
             / / And we want to keep data timeout so we can log it later
             timeout = ftpClientParameters.remove ("dataTimeout");


FtpClient work through proxy server immediately identified the error.

I think we should make a copy of ftpClientParameters. Need to remove from
the copy.
So we keep the parameters for the next call.



--
View this message in context: http://camel.465427.n5.nabble.com/Camel-FTP-consumer-socketFactory-not-work-correctly-tp5744716p5744831.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Camel FTP consumer + socketFactory not work correctly

Posted by alexey-s <al...@mail.ru>.
Exploring the magazine saw different objects

-- first start
12:07:01,016 | TRACE | ... | FtpOperations |
ponent.file.remote.FtpOperations   71 | 115 - org.apache.camel.camel-ftp -
2.12.2 | Connecting using FTPClient:
org.apache.commons.net.ftp.FTPClient@32b02753

-- second start
12:12:44,090 | TRACE | ... | FtpOperations |
ponent.file.remote.FtpOperations   71 | 115 - org.apache.camel.camel-ftp -
2.12.2 | Connecting using FTPClient:
org.apache.commons.net.ftp.FTPClient@3ccbebf3


Re-create the object FTPClient does not establish parameters.



Aleksey



--
View this message in context: http://camel.465427.n5.nabble.com/Camel-FTP-consumer-socketFactory-not-work-correctly-tp5744716p5744723.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Camel FTP consumer + socketFactory not work correctly

Posted by alexey-s <al...@mail.ru>.
Forgot to specify. Camel 2.12.2
source code ProxySoketFactory: 
https://github.com/alexey-su/camel-ftpext/tree/master/src/main/java/org/apache/commons/net/proxy
<https://github.com/alexey-su/camel-ftpext/tree/master/src/main/java/org/apache/commons/net/proxy>  


Aleksey



--
View this message in context: http://camel.465427.n5.nabble.com/Camel-FTP-consumer-socketFactory-not-work-correctly-tp5744716p5744718.html
Sent from the Camel - Users mailing list archive at Nabble.com.