Недопустимое исключение контекста пакета

Connor Blair спросил: 13 октября 2017 в 07:42 в: java

Я использую Apache Camel, чтобы получить файл с сервера, используя sftp. Мой код получает от

sftp://example.com: 22 / DEV139 / Uploads / Alamo? Имя пользователя = admin & пароль = admin & двоичный = true & отключение = true & delete = true

Он может успешно извлекать файлы из этого каталога, поскольку я вижу содержимое файлов в моих журналах, но затем выдает следующее исключение.

2017-11-06 16: 18: 42,498 | ОШИБКА | || FromAlamoSFTP = > [msgtyp: AlamoCSV msgdst: CDX] || java.lang.IllegalStateException: недопустимый BundleContext.at org.apache.felix.framework.BundleContextImpl.checkValidity (BundleContextImpl.java:514) в org.apache.felix.framework.BundleContextImpl.lext.jpg apache.camel.core.osgi.OsgiClassResolver.resolveClass (OsgiClassResolver.java:58) в org.apache.camel.component.bean.BeanHelper.isAssignableToExpectedType (BeanHelper.java:121) в orbean.ap.came .ap BeanInfo.matchMethod (BeanInfo.java:1074) в org.apache.camel.component.bean.BeanInfo.removeNonMatchingMethods (BeanInfo.java:999) в org.apache.camel.component.bean.BeanInfo.chooseMethoj: ( 566) на org.apache.camel.component.bean.BeanInfo.createInvocation (BeanInfo.java:254) на org.apache.camel.component.bean.BeanInfo.createInvocation (BeanInfo.java:185) на org.apache.camel .component.bean.BeanProcessor.process (BeanProcessor.java:159) в org.apache.camel.management.InstrumentationProcessor.process (InstrumentationProcessor.java:77) в org.apache.camel .processor.RedeliveryErrorHandler.process (RedeliveryErrorHandler.java:468) в org.apache.camel.processor.CamelInternalProcessor.process (CamelInternalProcessor.java:196) в org.apache.camel.processor.1 ) в org.apache.camel.processor.Pipeline.process (Pipeline.java:83) в org.apache.camel.util.AsyncProcessorHelper.process (AsyncProcessorHelper.java:109) в org.apache.camel.processor.Pipeline. процесс (Pipeline.java:63) в org.apache.camel.processor.CamelInternalProcessor.process (CamelInternalProcessor.java:171) в org.apache.camel.component.file.GenericFileConsumer.processExchange (GenericFileConsumer.java:45) .apache.camel.component.file.remote.RemoteFileConsumer.processExchange (RemoteFileConsumer.java:137) в org.apache.camel.component.file.GenericFileConsumer.processBatch (GenericFileConsumer.java:22appon.lava:226). org. .file.GenericFileConsumer.poll (GenericFileConsumer.java:190) в org.apache.camel.impl.ScheduledPollConsumer.doRun (ScheduledPollConsum er.java:175)at org.apache.camel.impl.ScheduledPollConsumer.run (ScheduledPollConsumer.java:102) в java.util.concurrent.Executors $ RunnableAdapter.call (Executors.java:511) в java.util.concur Feat. в java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1149) в java.util.concurrent.ThreadPoolExecutor $ Worker.run (ThreadPoolExecutor.java:624) в java.lang.Thread.run (поток )

Мой код выглядит следующим образом.

public class FromAlamoRouteBuilder extends RouteBuilder implements
    InitializingBean, DisposableBean {@EnforceInitialization
private String DEAD_LETTER_MQ = "";@EnforceInitialization
private String ALAMO_SFTP_SOURCE;   @EnforceInitialization
private String DESTINATION_QUEUE;  @EnforceInitialization(preventZero = false)
private int exceptionMaximumRedeliveries;@EnforceInitialization(preventZero = false)
private int exceptionMaximumRedeliveriesDelay;  public void configure() throws Exception {    onException(Exception.class)
        .handled(true)
        .retriesExhaustedLogLevel(LoggingLevel.ERROR)
        .retryAttemptedLogLevel(LoggingLevel.WARN)
        .maximumRedeliveries((int) exceptionMaximumRedeliveries)
        .redeliveryDelay((int) exceptionMaximumRedeliveriesDelay)
        .bean("logging", "error(*, '${exception.stacktrace}')")
        .to(DEAD_LETTER_MQ)
        .stop();    /*
     * The exchange body is expected to be an Alamo CSV file
     */ 
    from(ALAMO_SFTP_SOURCE)
        .routeId("FromAlamoSFTP")
        .setExchangePattern(ExchangePattern.InOnly)
        .bean("logging", "info(*, 'Received message " + ALAMO_SFTP_SOURCE  + "[${body}]')")
        .setHeader(MsgHdr.MESSAGE_TYPE, constant("AlamoCSV"))
        .setHeader(MsgHdr.MESSAGE_DESTINATION, constant("CDX"))
        .bean("logging", "info(*, 'Attempting to place Alamo msg on DESTINATION QUEUE " + DESTINATION_QUEUE + "')")
        .to(DESTINATION_QUEUE)      
        .bean("logging", "info(*, 'Successfully placed Alamo msg on " + DESTINATION_QUEUE + "')");}public void setDeadLetterQueue(String dEAD_LETTER_MQ) {
    DEAD_LETTER_MQ = dEAD_LETTER_MQ;
}public void setExceptionMaximumRedeliveries(int exceptionMaximumRedeliveries) {
    this.exceptionMaximumRedeliveries = exceptionMaximumRedeliveries;
}public void setExceptionMaximumRedeliveriesDelay(
        int exceptionMaximumRedeliveriesDelay) {
    this.exceptionMaximumRedeliveriesDelay = exceptionMaximumRedeliveriesDelay;
}public void setDestinationQueue(String queue){
    this.DESTINATION_QUEUE = queue;  
}public void setAlamoSftpSource(String bcRelease){
    this.ALAMO_SFTP_SOURCE = bcRelease;
}public void afterPropertiesSet() throws Exception {
    System.out.println("FromAlamoRouteBuilder is starting up");
    FieldInitialization.checkAllFields(this);
} public void destroy() throws Exception {
    System.out.println("FromAlmoRouteBuilder is shutting down");
}
}

0 ответов