2021-05-21 10:42:25.655 ERROR 10663 --- [  restartedMain] 
o.s.boot.SpringApplication               : Application run failed

org.apache.camel.FailedToCreateRouteException: Failed to create route 
HOUSEKEEPING-ROUTE: 
Route(HOUSEKEEPING-ROUTE)[From[file://mifir/?antExclude=**%2... because of 
Failed to resolve endpoint: 
file://mifir/?antExclude=**%2Farchive%2F**%2C**%2Fdata%2F**%2C**%2FLegalReportingModuleTransporterBridge%2F**%2C**%2FMAPPING%2F**%2C**%2F*.dat%2C+**%2Flog%2F**%2C+**%2FCORE%2F**%2C+**%2Ferror%2F**&antInclude=**%2F*.zip%2C**%2F*.xml%2C**%2F*.csv%2C**%2F*.txt%2C**%2F*.XML_ZIP%2C**%2F*.json&filter=%23houseKeepingFileFilter&recursive=true&scheduler=quartz&scheduler.cron=0%2B0%2F1%2B*%2B%3F%2B*%2BMON-FRI&scheduler.triggerGroup=houseKeepingGroup&scheduler.triggerId=houseKeepingId
 due to: Error binding property (filter=#houseKeepingFileFilter) with name: 
filter on bean: 
file://mifir/?antExclude=**%2Farchive%2F**%2C**%2Fdata%2F**%2C**%2FLegalReportingModuleTransporterBridge%2F**%2C**%2FMAPPING%2F**%2C**%2F*.dat%2C+**%2Flog%2F**%2C+**%2FCORE%2F**%2C+**%2Ferror%2F**&antInclude=**%2F*.zip%2C**%2F*.xml%2C**%2F*.csv%2C**%2F*.txt%2C**%2F*.XML_ZIP%2C**%2F*.json&filter=%23houseKeepingFileFilter&recursive=true&scheduler=quartz&scheduler.cron=0%2B0%2F1%2B*%2B%3F%2B*%2BMON-FRI&scheduler.triggerGroup=houseKeepingGroup&scheduler.triggerId=houseKeepingId
 with value: #houseKeepingFileFilter
        at 
org.apache.camel.reifier.RouteReifier.createRoute(RouteReifier.java:117)
        at 
org.apache.camel.impl.DefaultCamelContext.startRouteDefinitions(DefaultCamelContext.java:431)
        at 
org.apache.camel.impl.DefaultCamelContext.startRouteDefinitions(DefaultCamelContext.java:393)
        at 
org.apache.camel.impl.engine.AbstractCamelContext.doInit(AbstractCamelContext.java:2606)
        at 
org.apache.camel.support.service.BaseService.init(BaseService.java:83)
        at 
org.apache.camel.impl.engine.AbstractCamelContext.init(AbstractCamelContext.java:2378)
        at 
org.apache.camel.support.service.BaseService.start(BaseService.java:111)
        at 
org.apache.camel.impl.engine.AbstractCamelContext.start(AbstractCamelContext.java:2395)
        at 
org.apache.camel.spring.SpringCamelContext.start(SpringCamelContext.java:130)
        at 
org.apache.camel.spring.SpringCamelContext.onApplicationEvent(SpringCamelContext.java:167)
        at 
org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:172)
        at 
org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:165)
        at 
org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:139)
        at 
org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:404)
        at 
org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:361)
        at 
org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:898)
        at 
org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:554)
        at 
org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:143)
        at 
org.springframework.boot.SpringApplication.refresh(SpringApplication.java:758)
        at 
org.springframework.boot.SpringApplication.refresh(SpringApplication.java:750)
        at 
org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:397)
        at 
org.springframework.boot.SpringApplication.run(SpringApplication.java:315)
        at 
org.springframework.boot.builder.SpringApplicationBuilder.run(SpringApplicationBuilder.java:140)
        at se.tradechannel.mifid.MainApplication.main(MainApplication.java:84)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at 
org.springframework.boot.devtools.restart.RestartLauncher.run(RestartLauncher.java:49)
Caused by: org.apache.camel.ResolveEndpointFailedException: Failed to resolve 
endpoint: 
file://mifir/?antExclude=**%2Farchive%2F**%2C**%2Fdata%2F**%2C**%2FLegalReportingModuleTransporterBridge%2F**%2C**%2FMAPPING%2F**%2C**%2F*.dat%2C+**%2Flog%2F**%2C+**%2FCORE%2F**%2C+**%2Ferror%2F**&antInclude=**%2F*.zip%2C**%2F*.xml%2C**%2F*.csv%2C**%2F*.txt%2C**%2F*.XML_ZIP%2C**%2F*.json&filter=%23houseKeepingFileFilter&recursive=true&scheduler=quartz&scheduler.cron=0%2B0%2F1%2B*%2B%3F%2B*%2BMON-FRI&scheduler.triggerGroup=houseKeepingGroup&scheduler.triggerId=houseKeepingId
 due to: Error binding property (filter=#houseKeepingFileFilter) with name: 
filter on bean: 
file://mifir/?antExclude=**%2Farchive%2F**%2C**%2Fdata%2F**%2C**%2FLegalReportingModuleTransporterBridge%2F**%2C**%2FMAPPING%2F**%2C**%2F*.dat%2C+**%2Flog%2F**%2C+**%2FCORE%2F**%2C+**%2Ferror%2F**&antInclude=**%2F*.zip%2C**%2F*.xml%2C**%2F*.csv%2C**%2F*.txt%2C**%2F*.XML_ZIP%2C**%2F*.json&filter=%23houseKeepingFileFilter&recursive=true&scheduler=quartz&scheduler.cron=0%2B0%2F1%2B*%2B%3F%2B*%2BMON-FRI&scheduler.triggerGroup=houseKeepingGroup&scheduler.triggerId=houseKeepingId
 with value: #houseKeepingFileFilter
        at 
org.apache.camel.impl.engine.AbstractCamelContext.doGetEndpoint(AbstractCamelContext.java:896)
        at 
org.apache.camel.impl.engine.AbstractCamelContext.getEndpoint(AbstractCamelContext.java:802)
        at 
org.apache.camel.builder.endpoint.AbstractEndpointBuilder.resolve(AbstractEndpointBuilder.java:58)
        at 
org.apache.camel.reifier.RouteReifier.doCreateRoute(RouteReifier.java:247)
        at 
org.apache.camel.reifier.RouteReifier.createRoute(RouteReifier.java:111)
        ... 28 common frames omitted
Caused by: org.apache.camel.PropertyBindingException: Error binding property 
(filter=#houseKeepingFileFilter) with name: filter on bean: 
file://mifir/?antExclude=**%2Farchive%2F**%2C**%2Fdata%2F**%2C**%2FLegalReportingModuleTransporterBridge%2F**%2C**%2FMAPPING%2F**%2C**%2F*.dat%2C+**%2Flog%2F**%2C+**%2FCORE%2F**%2C+**%2Ferror%2F**&antInclude=**%2F*.zip%2C**%2F*.xml%2C**%2F*.csv%2C**%2F*.txt%2C**%2F*.XML_ZIP%2C**%2F*.json&filter=%23houseKeepingFileFilter&recursive=true&scheduler=quartz&scheduler.cron=0%2B0%2F1%2B*%2B%3F%2B*%2BMON-FRI&scheduler.triggerGroup=houseKeepingGroup&scheduler.triggerId=houseKeepingId
 with value: #houseKeepingFileFilter
        at 
org.apache.camel.support.PropertyBindingSupport.setSimplePropertyViaConfigurer(PropertyBindingSupport.java:849)
        at 
org.apache.camel.support.PropertyBindingSupport.doSetPropertyValue(PropertyBindingSupport.java:609)
        at 
org.apache.camel.support.PropertyBindingSupport.doBuildPropertyOgnlPath(PropertyBindingSupport.java:481)
        at 
org.apache.camel.support.PropertyBindingSupport.doBindProperties(PropertyBindingSupport.java:376)
        at 
org.apache.camel.support.PropertyBindingSupport.access$100(PropertyBindingSupport.java:87)
        at 
org.apache.camel.support.PropertyBindingSupport$Builder.bind(PropertyBindingSupport.java:1877)
        at 
org.apache.camel.support.DefaultEndpoint.setProperties(DefaultEndpoint.java:435)
        at 
org.apache.camel.support.DefaultEndpoint.configureProperties(DefaultEndpoint.java:403)
        at 
org.apache.camel.support.ScheduledPollEndpoint.configureProperties(ScheduledPollEndpoint.java:115)
        at 
org.apache.camel.support.DefaultComponent.setProperties(DefaultComponent.java:387)
        at 
org.apache.camel.component.file.GenericFileComponent.createEndpoint(GenericFileComponent.java:69)
        at 
org.apache.camel.component.file.GenericFileComponent.createEndpoint(GenericFileComponent.java:38)
        at 
org.apache.camel.support.DefaultComponent.createEndpoint(DefaultComponent.java:156)
        at 
org.apache.camel.impl.engine.AbstractCamelContext.doGetEndpoint(AbstractCamelContext.java:862)
        ... 32 common frames omitted
Caused by: org.apache.camel.NoSuchBeanException: No bean could be found in the 
registry for: houseKeepingFileFilter of type: 
org.apache.camel.component.file.GenericFileFilter
        at 
org.apache.camel.support.CamelContextHelper.mandatoryLookupAndConvert(CamelContextHelper.java:253)
        at 
org.apache.camel.support.EndpointHelper.resolveReferenceParameter(EndpointHelper.java:290)
        at 
org.apache.camel.support.EndpointHelper.resolveReferenceParameter(EndpointHelper.java:250)
        at 
org.apache.camel.support.component.PropertyConfigurerSupport.property(PropertyConfigurerSupport.java:53)
        at 
org.apache.camel.component.file.FileEndpointConfigurer.configure(FileEndpointConfigurer.java:174)
        at 
org.apache.camel.support.PropertyBindingSupport.setSimplePropertyViaConfigurer(PropertyBindingSupport.java:847)
        ... 45 common frames omitted

/M

‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐

On Friday, May 21st, 2021 at 07:18, Claus Ibsen <claus.ib...@gmail.com> wrote:

> Hi
>
> Crashes at startup. Can you tell what kind of crash, and do you see
>
> any exceptions or something?
>
> On Wed, May 19, 2021 at 3:13 PM Mikael Andersson Wigander
>
> mikael.andersson.wigan...@pm.me.invalid wrote:
>
> > Hi
> >
> > In Camel 2.x we have a file component with a filter bean and now migrating 
> > to Camel 3 the bean is not found and program crashes upon start.
> >
> > The migration has been only with the route converting to use 
> > EndpointRoutebuilder, the config, bean and class is unchanged.
> >
> > Config
> >
> > @Bean
> >
> > public static
> >
> > HouseKeepingFileFilter
> >
> > <
> >
> > String
> >
> > houseKeepingFileFilter
> >
> > () {
> >
> > return new
> >
> > HouseKeepingFileFilter
> >
> > <>()
> >
> > ;
> >
> > }
> >
> > Impl
> >
> > @CommonsLog
> >
> > public class
> >
> > HouseKeepingFileFilter
> >
> > <T>
> >
> > implements
> >
> > GenericFileFilter
> >
> > <
> >
> > String
> >
> > > {
> >
> > public boolean
> >
> > accept
> >
> > (
> >
> > GenericFile
> >
> > file) {
> >
> > SimpleDateFormat
> >
> > sdf
> >
> > =
> >
> > new
> >
> > SimpleDateFormat
> >
> > (
> >
> > "yyyy-MM-dd HH:mm:ss"
> >
> > )
> >
> > ;
> >
> > final boolean
> >
> > isValid
> >
> > =
> >
> > file
> >
> > .
> >
> > isDirectory
> >
> > ()
> >
> > ?
> >
> > true
> >
> > :
> >
> > file
> >
> > .
> >
> > getLastModified
> >
> > ()
> >
> > <
> >
> > LocalDateTime
> >
> > .
> >
> > now
> >
> > ()
> >
> > .
> >
> > minusMonths
> >
> > (1L)
> >
> > .
> >
> > atZone
> >
> > (
> >
> > ZoneId
> >
> > .
> >
> > systemDefault
> >
> > ())
> >
> > .
> >
> > toInstant
> >
> > ()
> >
> > .
> >
> > toEpochMilli
> >
> > ()
> >
> > ;
> >
> > log
> >
> > .
> >
> > trace
> >
> > (
> >
> > MessageFormat
> >
> > .
> >
> > format
> >
> > (
> >
> > "File :{0}, with modification date: {1} is {2} for archive"
> >
> > ,
> >
> > file
> >
> > .
> >
> > getFileName
> >
> > ()
> >
> > ,
> >
> > sdf
> >
> > .
> >
> > format
> >
> > (file
> >
> > .
> >
> > getLastModified
> >
> > ())
> >
> > ,
> >
> > isValid
> >
> > ?
> >
> > "valid"
> >
> > :
> >
> > "NOT valid"
> >
> > ))
> >
> > ;
> >
> > return
> >
> > isValid
> >
> > ;
> >
> > }
> >
> > }
> >
> > Camel 3
> >
> > @Override
> >
> > public void
> >
> > configure
> >
> > ()
> >
> > throws
> >
> > Exception
> >
> > {
> >
> > from
> >
> > (
> >
> > file
> >
> > (
> >
> > "mifir/"
> >
> > )
> >
> > .
> >
> > antInclude
> >
> > (
> >
> > "{{housekeeping.files.include}}"
> >
> > )
> >
> > .
> >
> > antExclude
> >
> > (
> >
> > "/archive/,/data/,/LegalReportingModuleTransporterBridge/,
> >
> > /M
> >
> > APPING/,{{housekeeping.files.exclude}}"
> >
> > )
> >
> > .
> >
> > recursive
> >
> > (
> >
> > true
> >
> > )
> >
> > .
> >
> > filter
> >
> > (
> >
> > "#houseKeepingFileFilter"
> >
> > )
> >
> > .
> >
> > scheduler
> >
> > (
> >
> > "quartz"
> >
> > )
> >
> > .
> >
> > schedulerProperties
> >
> > (
> >
> > "cron"
> >
> > ,
> >
> > "{{housekeeping.cron}}"
> >
> > )
> >
> > .
> >
> > schedulerProperties
> >
> > (
> >
> > "triggerId"
> >
> > ,
> >
> > "houseKeepingId"
> >
> > )
> >
> > .
> >
> > schedulerProperties
> >
> > (
> >
> > "triggerGroup"
> >
> > ,
> >
> > "houseKeepingGroup"
> >
> > ))
> >
> > .
> >
> > description
> >
> > (
> >
> > "HOUSEKEEPING-ROUTE"
> >
> > ,
> >
> > "Archive files older than a month"
> >
> > ,
> >
> > "en"
> >
> > )
> >
> > .
> >
> > process
> >
> > (s
> >
> > ->
> >
> > {
> >
> > long
> >
> > houseKeepingSize
> >
> > =
> >
> > 0L
> >
> > ;
> >
> > final
> >
> > Message
> >
> > in
> >
> > =
> >
> > s
> >
> > .
> >
> > getIn
> >
> > ()
> >
> > ;
> >
> > try
> >
> > {
> >
> > houseKeepingSize
> >
> > =
> >
> > in
> >
> > .
> >
> > getHeader
> >
> > (
> >
> > "HouseKeepingSize"
> >
> > ,
> >
> > Long
> >
> > .
> >
> > class
> >
> > )
> >
> > ;
> >
> > }
> >
> > catch
> >
> > (
> >
> > Exception
> >
> > ignored) {
> >
> > }
> >
> > final
> >
> > File
> >
> > body
> >
> > =
> >
> > in
> >
> > .
> >
> > getBody
> >
> > (
> >
> > File
> >
> > .
> >
> > class
> >
> > )
> >
> > ;
> >
> > houseKeepingSize
> >
> > +=
> >
> > body
> >
> > .
> >
> > length
> >
> > ()
> >
> > ;
> >
> > in
> >
> > .
> >
> > setHeader
> >
> > (
> >
> > "HouseKeepingSize"
> >
> > ,
> >
> > houseKeepingSize
> >
> > )
> >
> > ;
> >
> > })
> >
> > .
> >
> > aggregate
> >
> > (
> >
> > constant
> >
> > (
> >
> > true
> >
> > )
> >
> > ,
> >
> > new
> >
> > ZipAggregationStrategy
> >
> > (
> >
> > true
> >
> > ))
> >
> > .
> >
> > to
> >
> > (
> >
> > log
> >
> > (
> >
> > "HouseKeeping"
> >
> > )
> >
> > .
> >
> > level
> >
> > (
> >
> > "INFO"
> >
> > )
> >
> > .
> >
> > groupInterval
> >
> > (5_000L)
> >
> > .
> >
> > groupActiveOnly
> >
> > (
> >
> > true
> >
> > ))
> >
> > .
> >
> > completionFromBatchConsumer
> >
> > ()
> >
> > .
> >
> > eagerCheckCompletion
> >
> > ()
> >
> > .
> >
> > to
> >
> > (
> >
> > file
> >
> > (
> >
> > "mifir/archive"
> >
> > ))
> >
> > .
> >
> > log
> >
> > (
> >
> > "Monthly housekeeping is done! Archived 
> > ${exchangeProperty.CamelAggregatedSize} files and saved 
> > ${header.HouseKeepingSize} bytes"
> >
> > )
> >
> > .
> >
> > end
> >
> > ()
> >
> > ;
> >
> > }
> >
> > Camel 2
> >
> > @Override
> >
> > public void
> >
> > configure
> >
> > ()
> >
> > throws
> >
> > Exception
> >
> > {
> >
> > from
> >
> > (
> >
> > "file:mifir/"
> >
> > "?antInclude={{housekeeping.files.include}}"
> >
> > "&antExclude=/archive/,/data/,/LegalReportingModuleTransporterBridge/,/MAPPING/,{{housekeeping.files.exclude}}"
> >
> > "&recursive=true"
> >
> > "&filter=#houseKeepingFileFilter"
> >
> > "&scheduler=quartz2"
> >
> > "&scheduler.cron={{housekeeping.cron}}"
> >
> > "&scheduler.triggerId=houseKeepingId"
> >
> > "&scheduler.triggerGroup=houseKeepingGroup"
> >
> > )
> >
> > .
> >
> > description
> >
> > (
> >
> > "HOUSEKEEPING-ROUTE"
> >
> > ,
> >
> > "Archive files older than a month"
> >
> > ,
> >
> > "en"
> >
> > )
> >
> > .
> >
> > process
> >
> > (s
> >
> > ->
> >
> > {
> >
> > long
> >
> > houseKeepingSize
> >
> > =
> >
> > 0L
> >
> > ;
> >
> > final
> >
> > Message
> >
> > in
> >
> > =
> >
> > s
> >
> > .
> >
> > getIn
> >
> > ()
> >
> > ;
> >
> > try
> >
> > {
> >
> > houseKeepingSize
> >
> > =
> >
> > in
> >
> > .
> >
> > getHeader
> >
> > (
> >
> > "HouseKeepingSize"
> >
> > ,
> >
> > Long
> >
> > .
> >
> > class
> >
> > )
> >
> > ;
> >
> > }
> >
> > catch
> >
> > (
> >
> > Exception
> >
> > ignored) {
> >
> > }
> >
> > final
> >
> > File
> >
> > body
> >
> > =
> >
> > in
> >
> > .
> >
> > getBody
> >
> > (
> >
> > File
> >
> > .
> >
> > class
> >
> > )
> >
> > ;
> >
> > houseKeepingSize
> >
> > +=
> >
> > body
> >
> > .
> >
> > length
> >
> > ()
> >
> > ;
> >
> > in
> >
> > .
> >
> > setHeader
> >
> > (
> >
> > "HouseKeepingSize"
> >
> > ,
> >
> > houseKeepingSize
> >
> > )
> >
> > ;
> >
> > })
> >
> > .
> >
> > aggregate
> >
> > (
> >
> > constant
> >
> > (
> >
> > true
> >
> > )
> >
> > ,
> >
> > new
> >
> > ZipAggregationStrategy
> >
> > (
> >
> > true
> >
> > ))
> >
> > .
> >
> > to
> >
> > (
> >
> > "log:HouseKeeping?level=INFO&groupInterval=5000&groupActiveOnly=true"
> >
> > )
> >
> > .
> >
> > completionFromBatchConsumer
> >
> > ()
> >
> > .
> >
> > eagerCheckCompletion
> >
> > ()
> >
> > .
> >
> > to
> >
> > (
> >
> > "file:mifir/archive"
> >
> > )
> >
> > .
> >
> > log
> >
> > (
> >
> > "Monthly housekeeping is done! Archived ${property.CamelAggregatedSize} 
> > files and saved ${header.HouseKeepingSize} bytes"
> >
> > )
> >
> > .
> >
> > end
> >
> > ()
> >
> > ;
> >
> > }
> >
> > Read the migration guide but not finding any clues…
> >
> > From Camel 2.25.3 to 3.6.0
> >
> > /M
>
> --
>
> Claus Ibsen
> -----------
>
> http://davsclaus.com @davsclaus
>
> Camel in Action 2: https://www.manning.com/ibsen2

Reply via email to