Я пытаюсь использовать camel-quartz2
для планирования конечной точки FTP в приложении весенней загрузки. Но, тем не менее, при запуске приложения выдается исключение нулевого указателя.
Ниже приведен фрагмент кода для FTP URI
private final String NBP_GMI_TRADE_DAILY_FTP_CONNECTION_URI = "ftp://<username>@<hostip>/NBP/GMI/?password=<password>"
+ "&disconnect=true"
+ "&idempotent=true"
+ "&idempotentKey=${file:name}-${file:size}"
+ "&sendEmptyMessageWhenIdle=true"
+ "&filter=#nbpGmiTradeDailyFileFilter"
+ "&passiveMode=true"
+ "&binary=true"
+ "&recursive=true"
+ "scheduler=quartz2"
+ "&scheduler.cron=0+0/2+*+?+*+SUN,SAT+*";
Конфигурация FTP Camel
from(NBP_GMI_TRADE_DAILY_FTP_CONNECTION_URI)
.routeId("NBP_GMI_TRADE_DAILY_FTP_ROUTE")
.choice()
.when(simple("${body} != null")).setHeader(Exchange.FILE_NAME,simple("${file:name.noext}_${date:now:yyyyMMddHHmmssSSS}.${file:ext}")).to("file://{{user.home}}/NBP/data/daily/backup/?fileName=${date:now:yyyyMMdd}/${file:name}").end();
При запуске приложения я получаю исключение
org.apache.camel.spring.boot.CamelSpringBootInitializationException: java.lang.NullPointerException
at org.apache.camel.spring.boot.RoutesCollector.onApplicationEvent(RoutesCollector.java:225) ~[camel-spring-boot-2.19.3.jar:2.19.3]
at org.apache.camel.spring.boot.RoutesCollector.onApplicationEvent(RoutesCollector.java:52) ~[camel-spring-boot-2.19.3.jar:2.19.3]
at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:167) ~[spring-context-4.3.10.RELEASE.jar:4.3.10.RELEASE]
at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:139) ~[spring-context-4.3.10.RELEASE.jar:4.3.10.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:393) ~[spring-context-4.3.10.RELEASE.jar:4.3.10.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:347) ~[spring-context-4.3.10.RELEASE.jar:4.3.10.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:883) ~[spring-context-4.3.10.RELEASE.jar:4.3.10.RELEASE]
at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.finishRefresh(EmbeddedWebApplicationContext.java:144) ~[spring-boot-1.5.6.RELEASE.jar:1.5.6.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:546) ~[spring-context-4.3.10.RELEASE.jar:4.3.10.RELEASE]
at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:122) ~[spring-boot-1.5.6.RELEASE.jar:1.5.6.RELEASE]
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:693) ~[spring-boot-1.5.6.RELEASE.jar:1.5.6.RELEASE]
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:360) ~[spring-boot-1.5.6.RELEASE.jar:1.5.6.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:303) ~[spring-boot-1.5.6.RELEASE.jar:1.5.6.RELEASE]
at com.fis.derivatives.utility.nbp.Application.main(Application.java:36) [classes/:na]
Caused by: java.lang.NullPointerException: null
at org.apache.camel.impl.DefaultScheduledPollConsumerScheduler.startScheduler(DefaultScheduledPollConsumerScheduler.java:145) ~[camel-core-2.19.3.jar:2.19.3]
at org.apache.camel.impl.ScheduledPollConsumer.startScheduler(ScheduledPollConsumer.java:456) ~[camel-core-2.19.3.jar:2.19.3]
at org.apache.camel.component.file.remote.FtpConsumer.doStart(FtpConsumer.java:67) ~[camel-ftp-2.19.3.jar:2.19.3]
at org.apache.camel.support.ServiceSupport.start(ServiceSupport.java:61) ~[camel-core-2.19.3.jar:2.19.3]
at org.apache.camel.impl.DefaultCamelContext.startService(DefaultCamelContext.java:3514) ~[camel-core-2.19.3.jar:2.19.3]
at org.apache.camel.impl.DefaultCamelContext.doStartOrResumeRouteConsumers(DefaultCamelContext.java:3831) ~[camel-core-2.19.3.jar:2.19.3]
at org.apache.camel.impl.DefaultCamelContext.doStartRouteConsumers(DefaultCamelContext.java:3767) ~[camel-core-2.19.3.jar:2.19.3]
at org.apache.camel.impl.DefaultCamelContext.safelyStartRouteServices(DefaultCamelContext.java:3687) ~[camel-core-2.19.3.jar:2.19.3]
at org.apache.camel.impl.DefaultCamelContext.doStartOrResumeRoutes(DefaultCamelContext.java:3451) ~[camel-core-2.19.3.jar:2.19.3]
at org.apache.camel.impl.DefaultCamelContext.doStartCamel(DefaultCamelContext.java:3305) ~[camel-core-2.19.3.jar:2.19.3]
at org.apache.camel.impl.DefaultCamelContext.access$000(DefaultCamelContext.java:202) ~[camel-core-2.19.3.jar:2.19.3]
at org.apache.camel.impl.DefaultCamelContext$2.call(DefaultCamelContext.java:3089) ~[camel-core-2.19.3.jar:2.19.3]
at org.apache.camel.impl.DefaultCamelContext$2.call(DefaultCamelContext.java:3085) ~[camel-core-2.19.3.jar:2.19.3]
at org.apache.camel.impl.DefaultCamelContext.doWithDefinedClassLoader(DefaultCamelContext.java:3108) ~[camel-core-2.19.3.jar:2.19.3]
at org.apache.camel.impl.DefaultCamelContext.doStart(DefaultCamelContext.java:3085) ~[camel-core-2.19.3.jar:2.19.3]
at org.apache.camel.support.ServiceSupport.start(ServiceSupport.java:61) ~[camel-core-2.19.3.jar:2.19.3]
at org.apache.camel.impl.DefaultCamelContext.start(DefaultCamelContext.java:3022) ~[camel-core-2.19.3.jar:2.19.3]
at org.apache.camel.spring.boot.RoutesCollector.maybeStart(RoutesCollector.java:242) ~[camel-spring-boot-2.19.3.jar:2.19.3]
at org.apache.camel.spring.boot.RoutesCollector.onApplicationEvent(RoutesCollector.java:217) ~[camel-spring-boot-2.19.3.jar:2.19.3]
... 13 common frames omitted
Я использовал нижеприведенную версию Spring-Boot и Apache Camel соответственно
spring-boot: 1.5.6.RELEASE
apache-camel: 2.19.3
Любая помощь будет принята с благодарностью.