Hi,
I am facing strange issue with Camel FTP component. We are using CAMEL FTP
for transferring files to LINUX server and using binary=true in endpoint.
Sometime FTP is failing with below exception :
exception org.apache.camel.ResolveEndpointFailedException :
: Could not find a suitable setter for property: binary as there isn't a
setter method with same type: java.lang.String nor type conversion possible:
No type converter available to convert from type: java.lang.String to the
required type: boolean with value true
I tried giving binary = "true" as well as binary=true
Not sure what is the problem. Moreover this issue comes quite rarely 2 times
in last 30 days.
Any help will be appreciated
Below is my implementation snippet :
// Code for creating endpoint :
StringBuilder endPointUri = new
StringBuilder(ftpDetails.getTransferScheme().getName().toLowerCase());
String url = ftpDetails.getServerAddr() + ":" +
ftpDetails.getPort();
if (StringUtils.isNotBlank(ftpDetails.getRemoteFilePath())) {
url = url + "/" + ftpDetails.getRemoteFilePath();
}
endPointUri
.append("://").append(url).append('/').append("?username=").append(ftpDetails.getUserName())
.append("&password=").append(ftpDetails.getPassword()).append("&maximumReconnectAttempts=").append(2).append("&binary=true");
//Actual FTP transfer code
endpoint = createEndPoint(context, endPointUri);
// create a producer that can produce the exchange (= send the mail)
Producer producer = endpoint.createProducer();
// start the producer
producer.start();
// create Exchange and process file transfer
Exchange exchange = null;
Message in = null;
Map<String, Object> headers = null;
String fileName= "test.txt";
// create the exchange with the file in message
exchange = endpoint.createExchange();
in = exchange.getIn();
headers = new HashMap<String, Object>();
headers.put("CamelFileName", fileName);
in.setBody(new File(reportPath));
in.setHeaders(headers);
producer.process(exchange);
Any clue will be very helpful.
--
View this message in context:
http://camel.465427.n5.nabble.com/Issue-with-Camel-Binary-true-tp5785615.html
Sent from the Camel - Users mailing list archive at Nabble.com.