I am developing a program using Spring Boot and Apache Camel that reads a file from a file server using FTP and writes it to another file server using FTP. I am deploying the Spring Boot application in JBoss EAP server. when I used Apache commons-net library to connect to the FTP server, it failed with an exception, it was unable to connect to the FTP server. I printed the stacktrace. The exception is as below:
<<Some FTP logs before connecting>>
500 - I won't open a connection to IP.
java.lang.NullPointerException
...
...
But when I am doing the same thing using Apache Camel, It is not printing any exception message or stacktrace or the FTP logs. Below is my program:
public void configure() throws Exception {
errorHandler(defaultErrorHandler()
.maximumRedeliveries(3)
.redeliveryDelay(1000)
.retryAttemptedLogLevel(LoggingLevel.WARN));
from("direct:transferFile")
.log("Transferring file")
.process(requestProcessor)
.pollEnrich()
.simple("${exchangeProperty.inputEndpoint}").timeout(0).aggregationStrategy(requestAggregator)
.choice()
.when(body().isNotNull())
.toD("${exchangeProperty.outputEndpoint}", true)
.log("File transferred")
.otherwise()
.log("Empty body, exiting");
}
Can anyone please suggest me how will I print the stack trace and FTP logs in Apache Camel?