1 2 Previous Next 17 Replies Latest reply on Nov 15, 2011 3:18 AM by Claus Ibsen

    Camel exception in Exchange using OSGi:  but OK if run in Camel Context

    sandy2011 Newbie

      Hi ,

      Please see the JAVA DSL Route below.

      This is working fine when run as mvn camel:run , but when deployed as bundle in OSGI, it throws the exception in Camel Exchange as shown below.

       

       

      JAVA DSL Route

      -


       

      package camelhl7;

      import org.apache.camel.Exchange;

      import org.apache.camel.Message;

      import org.apache.camel.Processor;

      import org.apache.camel.builder.RouteBuilder;

      import org.apache.camel.model.dataformat.HL7DataFormat;

      import org.apache.camel.model.dataformat.XStreamDataFormat;

      import org.apache.camel.spring.Main;

       

      import ca.uhn.hl7v2.model.v23.message.ADT_A01;

      import ca.uhn.hl7v2.model.v23.segment.MSH;

       

      /**

      • A Camel Router

      */

      public class MyRouteBuilder extends RouteBuilder {

       

      /**

      • A main() so we can easily run these routing rules in our IDE

      */

      public static void main(String... args) throws Exception {

      Main.main(args);

      }

       

      /**

      • Lets configure the Camel routing rules using Java code...

      */

      public void configure() {

       

      // TODO create Camel routes here.

       

      HL7DataFormat hl7 = new HL7DataFormat();

      hl7.setValidate(false);

      XStreamDataFormat xstream = new XStreamDataFormat();

       

      from("mina:tcp://xxx.xxx.xxx.xxx:61610?sync=true&codec=#hl7codec")

           .unmarshal(hl7)

                .choice()

                .when(header("CamelHL7TriggerEvent").isEqualTo("A31"))

                .process(new Processor() {

                     public void process(Exchange exchange) throws Exception {

                        Message msg = exchange.getIn();

                     ADT_A01 adta01=(ADT_A01)msg.getBody();

                     MSH msh = adta01.getMSH();

                     String Sending_Application = msh.getMsh3_SendingApplication().getNamespaceID().getValue();

                     StringBuffer ColumnNames = new StringBuffer();

                     ColumnNames.append("'");

                     ColumnNames.append(Sending_Application);

                     String InsertStmt = "Insert into HL7_MSH_Ver23 values (" ColumnNames.toString()")";     

                 

                     exchange.getIn().setBody(constant(InsertStmt));

                }

                })

      .to("jdbc:testdb")

           .setBody(constant("select top 10 * from HL7_MSH_Ver23"))

      .to("jdbc:testdb")

           .marshal(xstream)

      .to("file:target/dboutput?fileName=dbout-$.xml")

           .otherwise()

           .marshal(hl7)

      .to("file:target/messages/others")

           .end()

           .setBody(constant("MSA|AA|"))

           .convertBodyTo(String.class)

           .marshal();

       

      }

      }

       

      -


       

      2.7.1.fuse-00-43 | No complete message in this packet

      14:10:02,299 | DEBUG | rIoProcessor-9.1 | ExecutorFilter                   | 124 - org.apache.servicemix.bundles.mina - 1.1.7.3 | Launching thread for /151.46.220.183:1183

      14:10:02,299 | DEBUG | - MinaThreadPool | MinaConsumer                     | 123 - org.apache.camel.camel-mina - 2.7.1.fuse-00-43 | Received body: MSH|~\&|ULTRAGENDAPRO|B|||20111021090729.271||ADTA31|634547848495993671|T|2.3|||NE|AL||ASCII

      EVN|A31|20111021090729.271|||13909xxxcav^^^^1^^^^^ghgcav

      PID||14995388|T2237536|MERIDENMER|qwertyp^^Mr||19800101000000.000|M|^^^^^PG||23 Wedderburn ^GATENorth Yorkshire^HG2 |||||M||||||||||GB||||

      PD1|||CATHERINE STREET SURGERY^^1|G3250183

      PV1||E

      14:10:02,299 | DEBUG | - MinaThreadPool | DefaultModelClassFactory         | 126 - org.apache.servicemix.bundles.hapi - 0.5.1.3 | Trying to load: ca.uhn.hl7v2.model.v23.message.ADT_A01

      14:10:02,299 | DEBUG | - MinaThreadPool | DefaultModelClassFactory         | 126 - org.apache.servicemix.bundles.hapi - 0.5.1.3 | Loaded: ca.uhn.hl7v2.model.v23.message.ADT_A01 class: class ca.uhn.hl7v2.model.v23.message.ADT_A01

      14:10:02,299 | INFO  | - MinaThreadPool | Parser                           | 126 - org.apache.servicemix.bundles.hapi - 0.5.1.3 | Instantiating msg of class ca.uhn.hl7v2.model.v23.message.ADT_A01

      14:10:02,299 | DEBUG | - MinaThreadPool | PipeParser                       | 126 - org.apache.servicemix.bundles.hapi - 0.5.1.3 | Parsing segment MSH

      14:10:02,299 | DEBUG | - MinaThreadPool | MessageIterator                  | 126 - org.apache.servicemix.bundles.hapi - 0.5.1.3 | MessageIterator.hasNext() in direction MSH? true

      14:10:02,299 | DEBUG | - MinaThreadPool | MessageIterator                  | 126 - org.apache.servicemix.bundles.hapi - 0.5.1.3 | MessageIterator.hasNext() in direction MSH? true

      14:10:02,299 | DEBUG | - MinaThreadPool | PipeParser                       | 126 - org.apache.servicemix.bundles.hapi - 0.5.1.3 | PipeParser iterating message in direction MSH at MSH

      14:10:02,299 | DEBUG | - MinaThreadPool | PipeParser                       | 126 - org.apache.servicemix.bundles.hapi - 0.5.1.3 | 2

       

       

      14:10:02,299 | DEBUG | - MinaThreadPool | PipeParser                       | 126 - org.apache.servicemix.bundles.hapi - 0.5.1.3 | 1reps delimited by: ~

      14:10:02,299 | DEBUG | - MinaThreadPool | PipeParser                       | 126 - org.apache.servicemix.bundles.hapi - 0.5.1.3 | Parsing field 2 repetition 0

      14:10:02,299 | DEBUG | - MinaThreadPool | ChoiceProcessor                  | 76 - org.apache.camel.camel-core - 2.7.1.fuse-00-43 | #0 - header(CamelHL7TriggerEvent) == A31 matches: true for: Exchange[Message: ca.uhn.hl7v2.model.v23.message.ADT_A01@1da1fb8]

      14:10:02,299 | DEBUG | - MinaThreadPool | DefaultErrorHandler              | 76 - org.apache.camel.camel-core - 2.7.1.fuse-00-43 | Failed delivery for exchangeId: ID-GHG-KEW-SIT-CA-3102-1320928365174-9-414. On delivery attempt: 0 caught: org.apache.camel.CamelExecutionException: Exception occurred during execution on the exchange: Exchange[Message: ca.uhn.hl7v2.model.v23.message.ADT_A01@1da1fb8]

      14:10:02,299 | ERROR | - MinaThreadPool | DefaultErrorHandler              | 76 - org.apache.camel.camel-core - 2.7.1.fuse-00-43 | Failed delivery for exchangeId: ID-GHG-KEW-SIT-CA-3102-1320928365174-9-414. Exhausted after delivery attempt: 1 caught: org.apache.camel.CamelExecutionException: Exception occurred during execution on the exchange: Exchange[Message: ca.uhn.hl7v2.model.v23.message.ADT_A01@1da1fb8]

      org.apache.camel.CamelExecutionException: Exception occurred during execution on the exchange: Exchange[Message: ca.uhn.hl7v2.model.v23.message.ADT_A01@1da1fb8]

           at org.apache.camel.util.ObjectHelper.wrapCamelExecutionException(ObjectHelper.java:1155)[76:org.apache.camel.camel-core:2.7.1.fuse-00-43]

           at org.apache.camel.impl.DefaultExchange.setException(DefaultExchange.java:271)[76:org.apache.camel.camel-core:2.7.1.fuse-00-43]

           at org.apache.camel.impl.converter.AsyncProcessorTypeConverter$ProcessorToAsyncProcessorBridge.process(AsyncProcessorTypeConverter.java:53)[76:org.apache.camel.camel-core:2.7.1.fuse-00-43]

           at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:80)[76:org.apache.camel.camel-core:2.7.1.fuse-00-43]

           at org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:98)[76:org.apache.camel.camel-core:2.7.1.fuse-00-43]

           at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:89)[76:org.apache.camel.camel-core:2.7.1.fuse-00-43]

           at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:80)[76:org.apache.camel.camel-core:2.7.1.fuse-00-43]

           at org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:98)[76:org.apache.camel.camel-core:2.7.1.fuse-00-43]

           at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:89)[76:org.apache.camel.camel-core:2.7.1.fuse-00-43]

           at org.apache.camel.processor.interceptor.TraceInterceptor.process(TraceInterceptor.java:99)[76:org.apache.camel.camel-core:2.7.1.fuse-00-43]

           at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:80)[76:org.apache.camel.camel-core:2.7.1.fuse-00-43]

           at org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:98)[76:org.apache.camel.camel-core:2.7.1.fuse-00-43]

           at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:89)[76:org.apache.camel.camel-core:2.7.1.fuse-00-43]

           at org.apache.camel.fabric.FabricTraceProcessor.process(FabricTraceProcessor.java:70)[76:org.apache.camel.camel-core:2.7.1.fuse-00-43]

           at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:80)[76:org.apache.camel.camel-core:2.7.1.fuse-00-43]

           at org.apache.camel.processor.RedeliveryErrorHandler.processErrorHandler(RedeliveryErrorHandler.java:314)[76:org.apache.camel.camel-core:2.7.1.fuse-00-43]

           at org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:209)[76:org.apache.camel.camel-core:2.7.1.fuse-00-43]

           at org.apache.camel.processor.DefaultChannel.process(DefaultChannel.java:269)[76:org.apache.camel.camel-core:2.7.1.fuse-00-43]

           at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:80)[76:org.apache.camel.camel-core:2.7.1.fuse-00-43]

           at org.apache.camel.processor.Pipeline.process(Pipeline.java:125)[76:org.apache.camel.camel-core:2.7.1.fuse-00-43]

           at org.apache.camel.processor.Pipeline.process(Pipeline.java:80)[76:org.apache.camel.camel-core:2.7.1.fuse-00-43]

           at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:80)[76:org.apache.camel.camel-core:2.7.1.fuse-00-43]

           at org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:98)[76:org.apache.camel.camel-core:2.7.1.fuse-00-43]

           at org.apache.camel.processor.ChoiceProcessor.process(ChoiceProcessor.java:80)[76:org.apache.camel.camel-core:2.7.1.fuse-00-43]

           at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:80)[76:org.apache.camel.camel-core:2.7.1.fuse-00-43]

           at org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:98)[76:org.apache.camel.camel-core:2.7.1.fuse-00-43]

           at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:89)[76:org.apache.camel.camel-core:2.7.1.fuse-00-43]

           at org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:73)[76:org.apache.camel.camel-core:2.7.1.fuse-00-43]

           at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:80)[76:org.apache.camel.camel-core:2.7.1.fuse-00-43]

           at org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:98)[76:org.apache.camel.camel-core:2.7.1.fuse-00-43]

           at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:89)[76:org.apache.camel.camel-core:2.7.1.fuse-00-43]

           at org.apache.camel.processor.interceptor.TraceInterceptor.process(TraceInterceptor.java:99)[76:org.apache.camel.camel-core:2.7.1.fuse-00-43]

           at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:80)[76:org.apache.camel.camel-core:2.7.1.fuse-00-43]

           at org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:98)[76:org.apache.camel.camel-core:2.7.1.fuse-00-43]

           at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:89)[76:org.apache.camel.camel-core:2.7.1.fuse-00-43]

           at org.apache.camel.fabric.FabricTraceProcessor.process(FabricTraceProcessor.java:70)[76:org.apache.camel.camel-core:2.7.1.fuse-00-43]

           at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:80)[76:org.apache.camel.camel-core:2.7.1.fuse-00-43]

           at org.apache.camel.processor.RedeliveryErrorHandler.processErrorHandler(RedeliveryErrorHandler.java:314)[76:org.apache.camel.camel-core:2.7.1.fuse-00-43]

           at org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:209)[76:org.apache.camel.camel-core:2.7.1.fuse-00-43]

           at org.apache.camel.processor.DefaultChannel.process(DefaultChannel.java:269)[76:org.apache.camel.camel-core:2.7.1.fuse-00-43]

           at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:80)[76:org.apache.camel.camel-core:2.7.1.fuse-00-43]

           at org.apache.camel.processor.Pipeline.process(Pipeline.java:125)[76:org.apache.camel.camel-core:2.7.1.fuse-00-43]

           at org.apache.camel.processor.Pipeline.process(Pipeline.java:80)[76:org.apache.camel.camel-core:2.7.1.fuse-00-43]

           at org.apache.camel.processor.UnitOfWorkProcessor.process(UnitOfWorkProcessor.java:102)[76:org.apache.camel.camel-core:2.7.1.fuse-00-43]

           at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:80)[76:org.apache.camel.camel-core:2.7.1.fuse-00-43]

           at org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:98)[76:org.apache.camel.camel-core:2.7.1.fuse-00-43]

           at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:89)[76:org.apache.camel.camel-core:2.7.1.fuse-00-43]

           at org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:73)[76:org.apache.camel.camel-core:2.7.1.fuse-00-43]

           at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:106)[76:org.apache.camel.camel-core:2.7.1.fuse-00-43]

           at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:85)[76:org.apache.camel.camel-core:2.7.1.fuse-00-43]

           at org.apache.camel.component.mina.MinaConsumer$ReceiveHandler.messageReceived(MinaConsumer.java:117)[123:org.apache.camel.camel-mina:2.7.1.fuse-00-43]

           at org.apache.mina.common.support.AbstractIoFilterChain$TailFilter.messageReceived(AbstractIoFilterChain.java:570)[124:org.apache.servicemix.bundles.mina:1.1.7.3]

           at org.apache.mina.common.support.AbstractIoFilterChain.callNextMessageReceived(AbstractIoFilterChain.java:299)[124:org.apache.servicemix.bundles.mina:1.1.7.3]

           at org.apache.mina.common.support.AbstractIoFilterChain.access$1100(AbstractIoFilterChain.java:53)[124:org.apache.servicemix.bundles.mina:1.1.7.3]

           at org.apache.mina.common.support.AbstractIoFilterChain$EntryImpl$1.messageReceived(AbstractIoFilterChain.java:648)[124:org.apache.servicemix.bundles.mina:1.1.7.3]

           at org.apache.mina.filter.executor.ExecutorFilter.processEvent(ExecutorFilter.java:220)[124:org.apache.servicemix.bundles.mina:1.1.7.3]

           at org.apache.mina.filter.executor.ExecutorFilter$ProcessEventsRunnable.run(ExecutorFilter.java:264)[124:org.apache.servicemix.bundles.mina:1.1.7.3]

           at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)[:1.6.0_27]

           at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)[:1.6.0_27]

           at java.lang.Thread.run(Thread.java:662)[:1.6.0_27]

      Caused by: java.lang.NoSuchMethodError: ca.uhn.hl7v2.model.v23.segment.MSH.getMsh3_SendingApplication()Lca/uhn/hl7v2/model/v23/datatype/HD;

           at camelhl7.MyRouteBuilder$1.process(MyRouteBuilder.java:64)[132:com.ghg.camelhl7.app1.hl7_jdbc:1.0.0.SNAPSHOT]

           at org.apache.camel.impl.converter.AsyncProcessorTypeConverter$ProcessorToAsyncProcessorBridge.process(AsyncProcessorTypeConverter.java:50)[76:org.apache.camel.camel-core:2.7.1.fuse-00-43]

           ... 57 more

      14:10:02,315 | DEBUG | - MinaThreadPool | Pipeline                         | 76 - org.apache.camel.camel-core - 2.7.1.fuse-00-43 | Message exchange has failed: so breaking out of pipeline for exchange: Exchange[Message: ca.uhn.hl7v2.model.v23.message.ADT_A01@1da1fb8] Exception: org.apache.camel.CamelExecutionException: Exception occurred during execution on the exchange: Exchange[Message: ca.uhn.hl7v2.model.v23.message.ADT_A01@1da1fb8]

      14:10:02,315 | DEBUG | - MinaThreadPool | Pipeline                         | 76 - org.apache.camel.camel-core - 2.7.1.fuse-00-43 | Message exchange has failed: so breaking out of pipeline for exchange: Exchange[Message: ca.uhn.hl7v2.model.v23.message.ADT_A01@1da1fb8] Exception: org.apache.camel.CamelExecutionException: Exception occurred during execution on the exchange: Exchange[Message: ca.uhn.hl7v2.model.v23.message.ADT_A01@1da1fb8]

      14:10:02,315 | DEBUG | - MinaThreadPool | MinaConsumer                     | 123 - org.apache.camel.camel-mina - 2.7.1.fuse-00-43 | Writing body: org.apache.camel.CamelExecutionException: Exception occurred during execution on the exchange: Exchange[Message: ca.uhn.hl7v2.model.v23.message.ADT_A01@1da1fb8]

      14:10:02,315 | WARN  | - MinaThreadPool | MinaHelper                       | 123 - org.apache.camel.camel-mina - 2.7.1.fuse-00-43 | Cannot write body: org.apache.camel.CamelExecutionException: Exception occurred during execution on the exchange: Exchange[Message: ca.uhn.hl7v2.model.v23.message.ADT_A01@1da1fb8] using session: (SOCKET, R: /151.46.220.183:1183, L: /151.46.220.183:61610, S: /151.46.220.183:61610)

      14:10:02,315 | DEBUG | - MinaThreadPool | MinaConsumer                     | 123 - org.apache.camel.camel-mina - 2.7.1.fuse-00-43 | Closing session as an exception was thrown from MINA

      14:10:02,315 | WARN  | - MinaThreadPool | MinaConsumer$ReceiveHandler      | 124 - org.apache.servicemix.bundles.mina - 1.1.7.3 | /151.46.220.183:1183 Unexpected exception from exceptionCaught handler.

      org.apache.camel.CamelException: org.apache.mina.filter.codec.ProtocolEncoderException: org.apache.camel.CamelExecutionException: Exception occurred during execution on the exchange: Exchange[Message: ca.uhn.hl7v2.model.v23.message.ADT_A01@1da1fb8]

           at org.apache.camel.component.mina.MinaConsumer$ReceiveHandler.exceptionCaught(MinaConsumer.java:95)[123:org.apache.camel.camel-mina:2.7.1.fuse-00-43]

           at org.apache.mina.common.support.AbstractIoFilterChain$TailFilter.exceptionCaught(AbstractIoFilterChain.java:564)[124:org.apache.servicemix.bundles.mina:1.1.7.3]

           at org.apache.mina.common.support.AbstractIoFilterChain.callNextExceptionCaught(AbstractIoFilterChain.java:345)[124:org.apache.servicemix.bundles.mina:1.1.7.3]

           at org.apache.mina.common.support.AbstractIoFilterChain.access$1000(AbstractIoFilterChain.java:53)[124:org.apache.servicemix.bundles.mina:1.1.7.3]

           at org.apache.mina.common.support.AbstractIoFilterChain$EntryImpl$1.exceptionCaught(AbstractIoFilterChain.java:643)[124:org.apache.servicemix.bundles.mina:1.1.7.3]

           at org.apache.mina.filter.executor.ExecutorFilter.processEvent(ExecutorFilter.java:224)[124:org.apache.servicemix.bundles.mina:1.1.7.3]

           at org.apache.mina.filter.executor.ExecutorFilter$ProcessEventsRunnable.run(ExecutorFilter.java:264)[124:org.apache.servicemix.bundles.mina:1.1.7.3]

           at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)[:1.6.0_27]

           at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)[:1.6.0_27]

           at java.lang.Thread.run(Thread.java:662)[:1.6.0_27]

      Caused by: org.apache.mina.filter.codec.ProtocolEncoderException: org.apache.camel.CamelExecutionException: Exception occurred during execution on the exchange: Exchange[Message: ca.uhn.hl7v2.model.v23.message.ADT_A01@1da1fb8]

           at org.apache.mina.filter.codec.ProtocolCodecFilter.filterWrite(ProtocolCodecFilter.java:224)[124:org.apache.servicemix.bundles.mina:1.1.7.3]

           at org.apache.mina.common.support.AbstractIoFilterChain.callPreviousFilterWrite(AbstractIoFilterChain.java:361)[124:org.apache.servicemix.bundles.mina:1.1.7.3]

           at org.apache.mina.common.support.AbstractIoFilterChain.access$1300(AbstractIoFilterChain.java:53)[124:org.apache.servicemix.bundles.mina:1.1.7.3]

           at org.apache.mina.common.support.AbstractIoFilterChain$EntryImpl$1.filterWrite(AbstractIoFilterChain.java:659)[124:org.apache.servicemix.bundles.mina:1.1.7.3]

           at org.apache.mina.filter.executor.ExecutorFilter.filterWrite(ExecutorFilter.java:236)[124:org.apache.servicemix.bundles.mina:1.1.7.3]

           at org.apache.mina.common.support.AbstractIoFilterChain.callPreviousFilterWrite(AbstractIoFilterChain.java:361)[124:org.apache.servicemix.bundles.mina:1.1.7.3]

           at org.apache.mina.common.support.AbstractIoFilterChain.access$1300(AbstractIoFilterChain.java:53)[124:org.apache.servicemix.bundles.mina:1.1.7.3]

           at org.apache.mina.common.support.AbstractIoFilterChain$EntryImpl$1.filterWrite(AbstractIoFilterChain.java:659)[124:org.apache.servicemix.bundles.mina:1.1.7.3]

           at org.apache.mina.common.support.AbstractIoFilterChain$TailFilter.filterWrite(AbstractIoFilterChain.java:587)[124:org.apache.servicemix.bundles.mina:1.1.7.3]

           at org.apache.mina.common.support.AbstractIoFilterChain.callPreviousFilterWrite(AbstractIoFilterChain.java:361)[124:org.apache.servicemix.bundles.mina:1.1.7.3]

           at org.apache.mina.common.support.AbstractIoFilterChain.fireFilterWrite(AbstractIoFilterChain.java:355)[124:org.apache.servicemix.bundles.mina:1.1.7.3]

           at org.apache.mina.transport.socket.nio.SocketSessionImpl.write0(SocketSessionImpl.java:166)[124:org.apache.servicemix.bundles.mina:1.1.7.3]

           at org.apache.mina.common.support.BaseIoSession.write(BaseIoSession.java:177)[124:org.apache.servicemix.bundles.mina:1.1.7.3]

           at org.apache.mina.common.support.BaseIoSession.write(BaseIoSession.java:168)[124:org.apache.servicemix.bundles.mina:1.1.7.3]

           at org.apache.camel.component.mina.MinaHelper.writeBody(MinaHelper.java:48)[123:org.apache.camel.camel-mina:2.7.1.fuse-00-43]

           at org.apache.camel.component.mina.MinaConsumer$ReceiveHandler.messageReceived(MinaConsumer.java:156)[123:org.apache.camel.camel-mina:2.7.1.fuse-00-43]

           at org.apache.mina.common.support.AbstractIoFilterChain$TailFilter.messageReceived(AbstractIoFilterChain.java:570)[124:org.apache.servicemix.bundles.mina:1.1.7.3]

           at org.apache.mina.common.support.AbstractIoFilterChain.callNextMessageReceived(AbstractIoFilterChain.java:299)[124:org.apache.servicemix.bundles.mina:1.1.7.3]

           at org.apache.mina.common.support.AbstractIoFilterChain.access$1100(AbstractIoFilterChain.java:53)[124:org.apache.servicemix.bundles.mina:1.1.7.3]

           at org.apache.mina.common.support.AbstractIoFilterChain$EntryImpl$1.messageReceived(AbstractIoFilterChain.java:648)[124:org.apache.servicemix.bundles.mina:1.1.7.3]

           at org.apache.mina.filter.executor.ExecutorFilter.processEvent(ExecutorFilter.java:220)[124:org.apache.servicemix.bundles.mina:1.1.7.3]

           ... 4 more

      Caused by: org.apache.camel.CamelExecutionException: Exception occurred during execution on the exchange: Exchange[Message: ca.uhn.hl7v2.model.v23.message.ADT_A01@1da1fb8]

           at org.apache.camel.util.ObjectHelper.wrapCamelExecutionException(ObjectHelper.java:1155)[76:org.apache.camel.camel-core:2.7.1.fuse-00-43]

           at org.apache.camel.impl.DefaultExchange.setException(DefaultExchange.java:271)[76:org.apache.camel.camel-core:2.7.1.fuse-00-43]

           at org.apache.camel.impl.converter.AsyncProcessorTypeConverter$ProcessorToAsyncProcessorBridge.process(AsyncProcessorTypeConverter.java:53)[76:org.apache.camel.camel-core:2.7.1.fuse-00-43]

           at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:80)[76:org.apache.camel.camel-core:2.7.1.fuse-00-43]

           at org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:98)[76:org.apache.camel.camel-core:2.7.1.fuse-00-43]

           at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:89)[76:org.apache.camel.camel-core:2.7.1.fuse-00-43]

           at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:80)[76:org.apache.camel.camel-core:2.7.1.fuse-00-43]

           at org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:98)[76:org.apache.camel.camel-core:2.7.1.fuse-00-43]

           at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:89)[76:org.apache.camel.camel-core:2.7.1.fuse-00-43]

           at org.apache.camel.processor.interceptor.TraceInterceptor.process(TraceInterceptor.java:99)[76:org.apache.camel.camel-core:2.7.1.fuse-00-43]

           at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:80)[76:org.apache.camel.camel-core:2.7.1.fuse-00-43]

           at org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:98)[76:org.apache.camel.camel-core:2.7.1.fuse-00-43]

           at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:89)[76:org.apache.camel.camel-core:2.7.1.fuse-00-43]

           at org.apache.camel.fabric.FabricTraceProcessor.process(FabricTraceProcessor.java:70)[76:org.apache.camel.camel-core:2.7.1.fuse-00-43]

           at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:80)[76:org.apache.camel.camel-core:2.7.1.fuse-00-43]

           at org.apache.camel.processor.RedeliveryErrorHandler.processErrorHandler(RedeliveryErrorHandler.java:314)[76:org.apache.camel.camel-core:2.7.1.fuse-00-43]

           at org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:209)[76:org.apache.camel.camel-core:2.7.1.fuse-00-43]

           at org.apache.camel.processor.DefaultChannel.process(DefaultChannel.java:269)[76:org.apache.camel.camel-core:2.7.1.fuse-00-43]

           at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:80)[76:org.apache.camel.camel-core:2.7.1.fuse-00-43]

           at org.apache.camel.processor.Pipeline.process(Pipeline.java:125)[76:org.apache.camel.camel-core:2.7.1.fuse-00-43]

           at org.apache.camel.processor.Pipeline.process(Pipeline.java:80)[76:org.apache.camel.camel-core:2.7.1.fuse-00-43]

           at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:80)[76:org.apache.camel.camel-core:2.7.1.fuse-00-43]

           at org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:98)[76:org.apache.camel.camel-core:2.7.1.fuse-00-43]

           at org.apache.camel.processor.ChoiceProcessor.process(ChoiceProcessor.java:80)[76:org.apache.camel.camel-core:2.7.1.fuse-00-43]

           at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:80)[76:org.apache.camel.camel-core:2.7.1.fuse-00-43]

           at org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:98)[76:org.apache.camel.camel-core:2.7.1.fuse-00-43]

           at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:89)[76:org.apache.camel.camel-core:2.7.1.fuse-00-43]

           at org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:73)[76:org.apache.camel.camel-core:2.7.1.fuse-00-43]

           at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:80)[76:org.apache.camel.camel-core:2.7.1.fuse-00-43]

           at org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:98)[76:org.apache.camel.camel-core:2.7.1.fuse-00-43]

           at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:89)[76:org.apache.camel.camel-core:2.7.1.fuse-00-43]

           at org.apache.camel.processor.interceptor.TraceInterceptor.process(TraceInterceptor.java:99)[76:org.apache.camel.camel-core:2.7.1.fuse-00-43]

           at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:80)[76:org.apache.camel.camel-core:2.7.1.fuse-00-43]

           at org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:98)[76:org.apache.camel.camel-core:2.7.1.fuse-00-43]

           at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:89)[76:org.apache.camel.camel-core:2.7.1.fuse-00-43]

           at org.apache.camel.fabric.FabricTraceProcessor.process(FabricTraceProcessor.java:70)[76:org.apache.camel.camel-core:2.7.1.fuse-00-43]

           at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:80)[76:org.apache.camel.camel-core:2.7.1.fuse-00-43]

           at org.apache.camel.processor.RedeliveryErrorHandler.processErrorHandler(RedeliveryErrorHandler.java:314)[76:org.apache.camel.camel-core:2.7.1.fuse-00-43]

           at org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:209)[76:org.apache.camel.camel-core:2.7.1.fuse-00-43]

           at org.apache.camel.processor.DefaultChannel.process(DefaultChannel.java:269)[76:org.apache.camel.camel-core:2.7.1.fuse-00-43]

           at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:80)[76:org.apache.camel.camel-core:2.7.1.fuse-00-43]

           at org.apache.camel.processor.Pipeline.process(Pipeline.java:125)[76:org.apache.camel.camel-core:2.7.1.fuse-00-43]

           at org.apache.camel.processor.Pipeline.process(Pipeline.java:80)[76:org.apache.camel.camel-core:2.7.1.fuse-00-43]

           at org.apache.camel.processor.UnitOfWorkProcessor.process(UnitOfWorkProcessor.java:102)[76:org.apache.camel.camel-core:2.7.1.fuse-00-43]

           at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:80)[76:org.apache.camel.camel-core:2.7.1.fuse-00-43]

           at org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:98)[76:org.apache.camel.camel-core:2.7.1.fuse-00-43]

           at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:89)[76:org.apache.camel.camel-core:2.7.1.fuse-00-43]

           at org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:73)[76:org.apache.camel.camel-core:2.7.1.fuse-00-43]

           at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:106)[76:org.apache.camel.camel-core:2.7.1.fuse-00-43]

           at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:85)[76:org.apache.camel.camel-core:2.7.1.fuse-00-43]

           at org.apache.camel.component.mina.MinaConsumer$ReceiveHandler.messageReceived(MinaConsumer.java:117)[123:org.apache.camel.camel-mina:2.7.1.fuse-00-43]

           ... 9 more

      Caused by: java.lang.NoSuchMethodError: ca.uhn.hl7v2.model.v23.segment.MSH.getMsh3_SendingApplication()Lca/uhn/hl7v2/model/v23/datatype/HD;

           at camelhl7.MyRouteBuilder$1.process(MyRouteBuilder.java:64)[132:com.ghg.camelhl7.app1.hl7_jdbc:1.0.0.SNAPSHOT]

           at org.apache.camel.impl.converter.AsyncProcessorTypeConverter$ProcessorToAsyncProcessorBridge.process(AsyncProcessorTypeConverter.java:50)

           ... 57 more

      14:10:02,315 | DEBUG | - MinaThreadPool | MinaConsumer                     | 123 - org.apache.camel.camel-mina - 2.7.1.fuse-00-43 | Closing session as an exception was thrown from MINA

      14:10:02,315 | WARN  | - MinaThreadPool | MinaConsumer$ReceiveHandler      | 124 - org.apache.servicemix.bundles.mina - 1.1.7.3 | /151.46.220.183:1183 Unexpected exception from exceptionCaught handler.

      org.apache.camel.CamelException: org.apache.camel.CamelExchangeException: Cannot write body. Exchange[Message: ca.uhn.hl7v2.model.v23.message.ADT_A01@1da1fb8]

           at org.apache.camel.component.mina.MinaConsumer$ReceiveHandler.exceptionCaught(MinaConsumer.java:95)[123:org.apache.camel.camel-mina:2.7.1.fuse-00-43]

           at org.apache.mina.common.support.AbstractIoFilterChain$TailFilter.exceptionCaught(AbstractIoFilterChain.java:564)[124:org.apache.servicemix.bundles.mina:1.1.7.3]

           at org.apache.mina.common.support.AbstractIoFilterChain.callNextExceptionCaught(AbstractIoFilterChain.java:345)[124:org.apache.servicemix.bundles.mina:1.1.7.3]

           at org.apache.mina.common.support.AbstractIoFilterChain.access$1000(AbstractIoFilterChain.java:53)[124:org.apache.servicemix.bun

        • 1. Re: Camel exception in Exchange using OSGi:  but OK if run in Camel Context
          Claus Ibsen Master

          You have installed the camel-hl7 feature in OSGi? As well as camel-mina right?

          • 2. Re: Camel exception in Exchange using OSGi:  but OK if run in Camel Context
            sandy2011 Newbie

            These are the bundles installed ... I have noticed one more error with no such method , Caused by: java.lang.NoSuchMethodError: ca.uhn.hl7v2.model.v23.segment.MSH.getMsh3_SendingApplication() but I know that method is present in HAPI V23 and works fine.

             

            [

            123|http://fusesource.com/forums/] Active [ ] 60 camel-mina (2.7.1.fuse-00-43)

            124 Active [ ] 60 Apache ServiceMix Bundles: mina-1.1.7 (1.1.7.3)

            125 Active [ ] 60 camel-hl7 (2.7.1.fuse-00-43)

            126 Active [ ] 60 Apache ServiceMix Bundles: hapi-0.5.1 (0.5.1.3)

            130 Active [ ] 60 SMX_ClearSpanAMQ_Route_Consumer.xml (0.0.0)

            132 Active [ ] 60 xxx  HL7 JDBC Route (1.0.0.SNAPSHOT)

            139 Resolved [ ] 60 xxx :: MSSQL Fragment :: SQL Driver (1.0.0)

            Hosts: 140

            140 Active [ ] 60 Spring JDBC (3.0.5.RELEASE)

            Fragments: 139

            141 Installed [ ] 60 A Camel Route (1.0.0.SNAPSHOT)

            142 Active [ ] 60 sqljdbc4 (4.0)

            143 Active [ ] 60 camel-jdbc (2.7.1.fuse-00-43)

            144 Active [ ] 60 camel-xstream (2.7.1.fuse-00-43)

            145 Active [ ] 60 jettison (1.2)

            -


            43]

            at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:85)76:org.apache.camel.camel-core:2.7.1.fuse-00-43

            at org.apache.camel.component.mina.MinaConsumer$ReceiveHandler.messageReceived(MinaConsumer.java:117)123:org.apache.camel.camel-mina:2.7.1.fuse-00-43

            ... 9 more

            Caused by: java.lang.NoSuchMethodError: ca.uhn.hl7v2.model.v23.segment.MSH.getMsh3_SendingApplication()Lca/uhn/hl7v2/model/v23/datatype/HD;

            at camelhl7.MyRouteBuilder$1.process(MyRouteBuilder.java:64)132:com.ghg.camelhl7.app1.hl7_jdbc:1.0.0.SNAPSHOT

            at org.apache.camel.impl.converter.AsyncProcessorTypeConverter$ProcessorToAsyncProcessorBridge.process(AsyncProcessorTypeConverter.java:50)

            ... 57 more

            17:20:46,679 | DEBUG | - MinaThreadPool | MinaConsumer | 123 - org.apache.camel.camel-mina - 2.7.1.fuse-00-43 | Closing session as an exception was thrown from MINA

            17:20:46,679 | WARN | - MinaThreadPool | MinaConsumer$ReceiveHandler | 124 - org.apache.servicemix.bundles.mina - 1.1.7.3 | /151.46.220.183:3792 Unexpected exception from exceptionCaught handler.

            org.apache.camel.CamelException: org.apache.camel.CamelExchangeException: Cannot write body. ExchangeMessage: ca.uhn.hl7v2.model.v23.message.ADT_A01@101ba21

            at org.apache.camel.component.mina.MinaConsumer$ReceiveHandler.exceptionCaught(MinaConsumer.java:95)123:org.apache.camel.camel-mina:2.7.1.fuse-00-43

            at org.apach

            -


             

            • 3. Re: Camel exception in Exchange using OSGi:  but OK if run in Camel Context
              sandy2011 Newbie

              HI Claus,

               

              It seems it is not able to find out none of the methods in ca.uhn.hl7v2.model.v23.segment.MSH class.

               

              Do you there is a clash between Apache Service Mix bundles HAPI JAR?

              • 6. Re: Camel exception in Exchange using OSGi:  but OK if run in Camel Context
                sandy2011 Newbie

                These UNIT tests don't seem to be using HAPI for HL7 message parsing.

                 

                The Route I use works fine when run alone in Camel Context, but Issue is only when deployed in Fuse ESB.

                The problem seem to be at HAPI parsing in the Process method in the Camel Route!

                • 7. Re: Camel exception in Exchange using OSGi:  but OK if run in Camel Context
                  sandy2011 Newbie

                  Hi,

                  Without Camel-HL7 component, the Camel Route bundle failed to install in the first place.

                  So after installing Camel-hl7 features, I installed the Camel Route bundles.

                  Then the bundle was successfully installed but I have started getting the Java No method found if I try access any of the Method of the hl7.segement.MSH. classes

                   

                  Any idea if any one ever used HAPI Library parsing inside OSGi container with Camel-hl7.

                   

                  I have strange feeling there is a class between Camel-hl7 HAPI library and the HAPI libraries referenced by the Camel Route Bundles!!!

                   

                   

                  -


                  araf@root> Exception in thread "SpringOsgiExtenderThread-6" org.apache.camel.RuntimeCamelException: org.apache.camel.Faile

                  ToCreateRouteException: Failed to create route route3 at: >>> Marshal[org.apache.camel.model.dataformat.HL7DataFormat@a41d

                  d] <<< in route: Route[[From[mina:tcp://xxx.xxx.xxx.xxx:61610?sync=true&codec=... because of Data format 'hl7' could not be

                  created. Ensure that the dataformat is valid and the associated Camel component is present on the classpath

                         at org.apache.camel.util.ObjectHelper.wrapRuntimeCamelException(ObjectHelper.java:1139)

                         at org.apache.camel.spring.SpringCamelContext.onApplicationEvent(SpringCamelContext.java:103)

                         at org.apache.camel.spring.CamelContextFactoryBean.onApplicationEvent(CamelContextFactoryBean.java:238)

                         at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMultica

                  ter.java:97)

                         at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:303)

                   

                         at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:911

                   

                         at org.springframework.osgi.context.support.AbstractOsgiBundleApplicationContext.finishRefresh(AbstractOsgiBundleAp

                  licationContext.java:235)

                         at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext$4.run(AbstractDelegatedExe

                  utionApplicationContext.java:358)

                         at org.springframework.osgi.util.internal.PrivilegedUtils.executeWithCustomTCCL(PrivilegedUtils.java:85)

                         at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.completeRefresh(AbstractDe

                  egatedExecutionApplicationContext.java:320)

                         at org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor$Compl

                  teRefreshTask.run(DependencyWaiterApplicationContextExecutor.java:132)

                         at java.lang.Thread.run(Thread.java:662)

                  • 8. Re: Camel exception in Exchange using OSGi:  but OK if run in Camel Context
                    Claus Ibsen Master

                    You can run osgi:headers NNN, where NNN is the bundle id number. Then check that the bundles export/import the needed packages which is in conflict.

                     

                    You app bundle should import this package. And the hl7 bundle should export the package.

                    • 9. Re: Camel exception in Exchange using OSGi:  but OK if run in Camel Context
                      Willem Jiang Master

                      Can you create a simple test case to reproduce the error ?

                      It looks like there is something wrong with the hl7 bundle itself.

                       

                      Willem

                      • 10. Re: Camel exception in Exchange using OSGi:  but OK if run in Camel Context
                        sandy2011 Newbie

                        Hi , I have attached the MANIFEST of HL7 Route Bundle and default camel-hl7 for your reference.

                        FYI: I started every thing fresh and cleaned the data folder of servicemix and reinstalled the HL7 Camel Route again. Still no luck.

                         

                        HL7 JDBC Route (132)

                        -


                        Manifest-Version = 1.0

                        Bnd-LastModified = 1321209501535

                        Tool = Bnd-0.0.357

                        Built-By = srv

                        Build-Jdk = 1.6.0_27

                        Created-By = Apache Maven Bundle Plugin

                         

                        Bundle-Name = HL7 JDBC Route

                        Bundle-SymbolicName = com.ghg.camelhl7.app1.hl7_jdbc

                        Bundle-Version = 1.0.0.SNAPSHOT

                        Bundle-ManifestVersion = 2

                         

                        Import-Package =

                                ca.uhn.hl7v2.model.v23.datatype,

                                ca.uhn.hl7v2.model.v23.message,

                                ca.uhn.hl7v2.model.v23.segment,

                                com.microsoft.sqlserver.jdbc,

                                org.apache.camel;version=2.7,

                                org.apache.camel.builder;version=2.7,

                                org.apache.camel.component.hl7;version=2.7,

                                org.apache.camel.model;version=2.7,

                                org.apache.camel.model.dataformat;version=2.7,

                                org.apache.camel.spring;version=2.7,

                                org.springframework.jdbc.datasource;version=3.0

                        Export-Package =

                                camelhl7;

                                        uses:="org.apache.camel.builder,

                                                ca.uhn.hl7v2.model.v23.datatype,

                                                ca.uhn.hl7v2.model.v23.segment,

                                                org.apache.camel,

                                                ca.uhn.hl7v2.model.v23.message,

                                                org.apache.camel.model,

                                                org.apache.camel.spring,

                                                org.apache.camel.model.dataformat"

                        -


                         

                        camel-hl7 (121)

                        -


                        Manifest-Version = 1.0

                        Karaf-Info = Camel;camel-hl7=2.7.1-fuse-00-43

                        Bnd-LastModified = 1310324006322

                        Tool = Bnd-0.0.357

                        Built-By = hudson

                        Implementation-Version = 2.7.1-fuse-00-43

                        Build-Jdk = 1.6.0_22

                        Implementation-Title = Apache Camel

                        Created-By = Apache Maven Bundle Plugin

                         

                        Bundle-Vendor = FuseSource Community

                        Bundle-Name = camel-hl7

                        Bundle-DocURL = http://fusesource.com

                        Bundle-Description = Camel HL7 support

                        Bundle-SymbolicName = org.apache.camel.camel-hl7

                        Bundle-Version = 2.7.1.fuse-00-43

                        Bundle-License = http://www.apache.org/licenses/LICENSE-2.0.txt

                        Bundle-ManifestVersion = 2

                         

                        Ignore-Package =

                                org.apache.camel.component.hl7

                        Import-Package =

                                ca.uhn.hl7v2,

                                ca.uhn.hl7v2.model,

                                ca.uhn.hl7v2.parser,

                                ca.uhn.hl7v2.util,

                                ca.uhn.hl7v2.validation,

                                ca.uhn.hl7v2.validation.impl,

                                org.apache.camel;version="[2.7,2.8)",

                                org.apache.camel.spi;version="[2.7,2.8)",

                                org.apache.camel.util;version="[2.7,2.8)",

                                org.apache.mina.common;version="[1.1.7,2.0)",

                                org.apache.mina.filter.codec;version="[1.1.7,2.0)",

                                org.slf4j;version="[1.5,2)"

                        Export-Package =

                                org.apache.camel.component.hl7;

                                        uses:="ca.uhn.hl7v2.parser,

                                                ca.uhn.hl7v2,

                                                ca.uhn.hl7v2.validation.impl,

                                                org.apache.camel,

                                                ca.uhn.hl7v2.validation,

                                                ca.uhn.hl7v2.model,

                                                org.apache.camel.util,

                                                ca.uhn.hl7v2.util,

                                                org.apache.camel.spi,

                                                org.apache.mina.filter.codec,

                                                org.apache.mina.common,

                                                org.slf4j";

                                        version=2.7.1.fuse-00-43

                         

                        Edited by: sandy2011 on Nov 13, 2011 7:47 PM

                        • 11. Re: Camel exception in Exchange using OSGi:  but OK if run in Camel Context
                          sandy2011 Newbie

                          camel-hl7 (2.7.1.fuse-00-43)

                          Apache ServiceMix Bundles: mina-1.1.7 (1.1.7.3)

                          Apache ServiceMix Bundles: hapi-0.5.1 (0.5.1.3)

                          camel-jdbc (2.7.1.fuse-00-43)

                          camel-xstream (2.7.1.fuse-00-43)

                          jettison (1.2)

                          camel-mina (2.7.1.fuse-00-43)

                          Spring JDBC (3.0.5.RELEASE)

                                                                 Fragments: 131

                          MSSQL Fragment :: SQL Driver (1.0.0)

                                                                 Hosts: 130

                          HL7 JDBC Route (1.0.0.SNAPSHOT)

                          -


                           

                           

                          package camelhl7;

                           

                          import org.apache.camel.Exchange;

                          import org.apache.camel.Message;

                          import org.apache.camel.Processor;

                          import org.apache.camel.builder.RouteBuilder;

                          import org.apache.camel.model.dataformat.HL7DataFormat;

                          import org.apache.camel.model.dataformat.XStreamDataFormat;

                          import org.apache.camel.spring.Main;

                           

                          import ca.uhn.hl7v2.model.v23.message.*;

                          import ca.uhn.hl7v2.model.v23.segment.*;

                           

                          /**

                           

                          • A Camel Router

                          */

                          public class MyRouteBuilder extends RouteBuilder {

                           

                              /**

                                

                          • A main() so we can easily run these routing rules in our IDE

                               */

                              public static void main(String... args) throws Exception {

                                  Main.main(args);

                              }

                           

                              /**

                                

                          • configure the Camel routing rules using Java code...

                               */

                              public void configure() {

                           

                              HL7DataFormat hl7 = new HL7DataFormat();

                              hl7.setValidate(false);

                              XStreamDataFormat xstream = new XStreamDataFormat();         

                              //from("file:src/data?noop=false")   

                              from("mina:tcp://151.46.220.183:61610?sync=true&codec=#hl7codec")

                              .unmarshal(hl7)

                              .choice()

                                      .when(header("CamelHL7TriggerEvent").isEqualTo("A31"))

                                  .process(new Processor() {

                                       public void process(Exchange exchange) throws Exception {

                                                     

                                            Message msg = exchange.getIn();

                                            ADT_A01 adta01=(ADT_A01)msg.getBody();           

                                            MSH msh = adta01.getMSH();           

                                                  

                                                StringBuffer ColumnNames = new StringBuffer();

                                                String Sending_Application = adta01.getMSH().getMsh3_SendingApplication().getNamespaceID().getValue();

                           

                          -


                          Exception happens when calling the getMsh3_SendingApplication and accessing all other methods throws error

                          • 12. Re: Camel exception in Exchange using OSGi:  but OK if run in Camel Context
                            sandy2011 Newbie

                            The Test Case:

                            Listens for a HL7 Message at Mina endpoint ,

                            Parses the HL7 Message,

                            Inserts into the MSSQL Database ,

                            Selects the data from SQL Database and convert to XML,

                            Write it to a folder as XML file with a dynamic file name based on current datetime

                             

                            Works fine when run in Camel Context in Eclipse IDE and Standalone mvn camel:run

                            -


                             

                            route1 >>> EventDrivenConsumerRoute[Endpoint[mina://tcp://151.46.220.183:61610?codec=%23hl7codec&sync=true] -> Instrumentation:route[UnitOfWork(Pipeline[[Channel[Unmarshal[org.apache.camel.component.hl7.HL7DataFormat@1ed7524]], Channel[choice{when header(CamelHL7TriggerEvent) == A31: Pipeline[[Channel[Wrap[camelhl7.MyRouteBuilder$1@a5c9f1] -> camelhl7.MyRouteBuilder$1@a5c9f1], Channel[sendTo(Endpoint[jdbc://testdb])], Channel[SetBody(select top 10 * from HL7_MSH_Ver23)], Channel[sendTo(Endpoint[jdbc://testdb])], Channel[Marshal[org.apache.camel.dataform

                            at.xstream.XStreamDataFormat@6d23ea]], Channel[sendTo(Endpoint[file://target/dboutput?fileName=dbout-%24%7Bdate%3Anow%3Ayyyy-MM-dd-hh-MM-ss%7D.xml])]]], otherwise: Pipeline[[Channel[Marshal[org.apache.camel.component.hl7.HL7DataFormat@1ed7524]], Channel[sendTo(Endpoint[file://target/messages/others])]]]}], Channel[Se

                            tBody(MSA|AA|)], Channel[convertBodyTo[java.lang.String]]]])]]

                            • 13. Re: Camel exception in Exchange using OSGi:  but OK if run in Camel Context
                              sandy2011 Newbie

                              The Log from Camel Context run as standalone application with the successful completion of the Camel Route

                              -


                               

                              a-2.7.1.jar]

                              MainSupport                    INFO  Apache Camel 2.7.1 starting

                              CamelNamespaceHandler          INFO  OSGi environment not detected.

                              CamelNamespaceHandler          DEBUG Using org.apache.camel.spring.CamelC

                              ontextFactoryBean as CamelContextBeanDefinitionParser

                              CamelNamespaceHandler          DEBUG Registered default: org.apache.camel

                              .spring.CamelProducerTemplateFactoryBean with id: template on camel context: camel-1

                              CamelNamespaceHandler          DEBUG Registered default: org.apache.camel

                              .spring.CamelConsumerTemplateFactoryBean with id: consumerTemplate on camel context: camel-1

                              SpringCamelContext             DEBUG Set the application context classloa

                              der to: java.net.URLClassLoader@b3ae5c

                              bstractCamelContextFactoryBean DEBUG Found JAXB created routes: []

                              SpringCamelContext             DEBUG Adding routes from builder: Routes:

                              []

                              SpringCamelContext             DEBUG onApplicationEvent: org.springframew

                              ork.context.event.ContextRefreshedEvent[source=org.springframework.context.support.ClassPathXmlApplication

                              Context@b29c9d: startup date ; root of context hierarchy]

                              SpringCamelContext             INFO  Apache Camel 2.7.1 (CamelContext: ca

                              mel-1) is starting

                              SpringCamelContext             INFO  JMX enabled. Using ManagedManagement

                              Strategy.

                              DefaultManagementAgent         DEBUG Starting JMX agent on server: com.su

                              n.jmx.mbeanserver.JmxMBeanServer@d90254

                              DefaultManagementAgent         DEBUG Registered MBean with objectname: or

                              g.apache.camel:context=AAA-KEW-SIT-CA/camel-1,type=context,name="camel-1"

                              DefaultManagementAgent         DEBUG Registered MBean with objectname: or

                              g.apache.camel:context=AAA-KEW-SIT-CA/camel-1,type=services,name=DefaultTypeConverter(0x91e143)

                              DefaultTypeConverter           DEBUG Loading type converters ...

                              AnnotationTypeConverterLoader  INFO  Loading file META-INF/services/org/a

                              pache/camel/TypeConverter to retrieve list of packages, from url: jar:file:/D:/apache-maven-3.0.3/localrep

                              o/org/apache/camel/camel-core/2.7.1/camel-core-2.7.1.jar!/META-INF/services/org/apache/camel/TypeConverter

                               

                              AnnotationTypeConverterLoader  INFO  Loading file META-INF/services/org/a

                              pache/camel/TypeConverter to retrieve list of packages, from url: jar:file:/D:/apache-maven-3.0.3/localrep

                              o/org/apache/camel/camel-hl7/2.7.1/camel-hl7-2.7.1.jar!/META-INF/services/org/apache/camel/TypeConverter

                              AnnotationTypeConverterLoader  INFO  Loading file META-INF/services/org/a

                              pache/camel/TypeConverter to retrieve list of packages, from url: jar:file:/D:/apache-maven-3.0.3/localrep

                              o/org/apache/camel/camel-mina/2.7.1/camel-mina-2.7.1.jar!/META-INF/services/org/apache/camel/TypeConverter

                               

                              efaultPackageScanClassResolver DEBUG Searching for annotations of org.apa

                              che.camel.Converter in packages: [org.apache.camel.component.hl7, org.apache.camel.component.file, org.apa

                              che.camel.component.mina, org.apache.camel.component.bean, org.apache.camel.converter]

                              efaultPackageScanClassResolver DEBUG Found: [class org.apache.camel.compo

                              nent.hl7.HL7Converter, class org.apache.camel.component.file.GenericFileConverter, class org.apache.camel.

                              component.mina.MinaConverter, class org.apache.camel.component.bean.BeanConverter, class org.apache.camel.

                              converter.CamelConverter, class org.apache.camel.converter.CollectionConverter, class org.apache.camel.con

                              verter.IOConverter, class org.apache.camel.converter.NIOConverter, class org.apache.camel.converter.Object

                              Converter, class org.apache.camel.converter.TimePatternConverter, class org.apache.camel.converter.jaxp.Do

                              mConverter, class org.apache.camel.converter.jaxp.StaxConverter, class org.apache.camel.converter.jaxp.Str

                              eamSourceConverter, class org.apache.camel.converter.jaxp.XmlConverter, class org.apache.camel.converter.s

                              tream.StreamCacheConverter]

                              AnnotationTypeConverterLoader  INFO  Found 5 packages with 15 @Converter

                              classes to load

                              DefaultTypeConverter           DEBUG Loading type converters done

                              DefaultTypeConverter           INFO  Loaded 155 type converters in 0.781

                              seconds

                              DefaultManagementAgent         DEBUG Registered MBean with objectname: or

                              g.apache.camel:context=AAA-KEW-SIT-CA/camel-1,type=services,name=DefaultExecutorServiceStrategy(0x6245a4)

                              DefaultManagementAgent         DEBUG Registered MBean with objectname: or

                              g.apache.camel:context=AAA-KEW-SIT-CA/camel-1,type=services,name=SharedProducerServicePool(0x1ca4eb4)

                              SharedProducerServicePool      DEBUG Starting service pool: org.apache.ca

                              mel.impl.SharedProducerServicePool@1ca4eb4

                              DefaultManagementAgent         DEBUG Registered MBean with objectname: or

                              g.apache.camel:context=AAA-KEW-SIT-CA/camel-1,type=services,name=DefaultInflightRepository(0x1d7e64f)

                              DefaultManagementAgent         DEBUG Registered MBean with objectname: or

                              g.apache.camel:context=AAA-KEW-SIT-CA/camel-1,type=services,name=DefaultShutdownStrategy(0x19846fd)

                              DefaultComponentResolver       DEBUG Found component: mina via type: org.

                              apache.camel.component.mina.MinaComponent via: META-INF/services/org/apache/camel/component/mina

                              DefaultManagementAgent         DEBUG Registered MBean with objectname: or

                              g.apache.camel:context=AAA-KEW-SIT-CA/camel-1,type=components,name="mina"

                              DefaultComponent               DEBUG Creating endpoint uri=[mina://tcp://

                              151.46.220.183:61610?codec=%23hl7codec&sync=true], path=[tcp://151.46.220.183:61610], parameters=[{codec=#

                              hl7codec, sync=true}]

                              EndpointHelper                 DEBUG Configured property: codec on bean:

                              org.apache.camel.component.mina.MinaConfiguration@6da8eb with value: org.apache.camel.component.hl7.HL7MLL

                              PCodec@16d079a

                              DefaultManagementAgent         DEBUG Registered MBean with objectname: or

                              g.apache.camel:context=AAA-KEW-SIT-CA/camel-1,type=threadpools,name="MinaComponent(0x1601a4f)"

                              DefaultExecutorServiceStrategy DEBUG Created new thread pool for source:

                              org.apache.camel.component.mina.MinaComponent@1601a4f with name: MinaSocketAcceptor. [poolSize=10, maxPool

                              Size=20, keepAliveTime=60 SECONDS, maxQueueSize=1000, rejectedExecutionHandler=java.util.concurrent.Thread

                              PoolExecutor$CallerRunsPolicy@1540a77, daemon=false] -> java.util.concurrent.ThreadPoolExecutor@5f634c

                              DefaultExecutorServiceStrategy DEBUG Created new thread pool for source:

                              org.apache.camel.component.mina.MinaComponent@1601a4f with name: MinaSocketConnector. [poolSize=10, maxPoo

                              lSize=20, keepAliveTime=60 SECONDS, maxQueueSize=1000, rejectedExecutionHandler=java.util.concurrent.Threa

                              dPoolExecutor$CallerRunsPolicy@1939100, daemon=false] -> java.util.concurrent.ThreadPoolExecutor@13eaab

                              DefaultExecutorServiceStrategy DEBUG Created new thread pool for source:

                              org.apache.camel.component.mina.MinaComponent@1601a4f with name: MinaThreadPool. [poolSize=10, maxPoolSize

                              =20, keepAliveTime=60 SECONDS, maxQueueSize=1000, rejectedExecutionHandler=java.util.concurrent.ThreadPool

                              Executor$CallerRunsPolicy@1174ec5, daemon=false] -> java.util.concurrent.ThreadPoolExecutor@11bf785

                              DefaultExecutorServiceStrategy DEBUG Created new thread pool for source:

                              org.apache.camel.component.mina.MinaComponent@1601a4f with name: MinaThreadPool. [poolSize=10, maxPoolSize

                              =20, keepAliveTime=60 SECONDS, maxQueueSize=1000, rejectedExecutionHandler=java.util.concurrent.ThreadPool

                              Executor$CallerRunsPolicy@19c86c5, daemon=false] -> java.util.concurrent.ThreadPoolExecutor@1346812

                              SpringCamelContext             DEBUG mina://tcp://151.46.220.183:61610?co

                              dec=%23hl7codec&sync=true converted to endpoint: Endpoint[mina://tcp://151.46.220.183:61610?codec=%23hl7co

                              dec&sync=true] by component: org.apache.camel.component.mina.MinaComponent@1601a4f

                              DefaultManagementAgent         DEBUG Registered MBean with objectname: or

                              g.apache.camel:context=AAA-KEW-SIT-CA/camel-1,type=endpoints,name="mina://tcp://151.46.220.183:61610\?code

                              c=%23hl7codec&sync=true"

                              DefaultManagementAgent         DEBUG Registered MBean with objectname: or

                              g.apache.camel:context=AAA-KEW-SIT-CA/camel-1,type=tracer,name=Tracer(0x1a06ec2)

                              DefaultManagementAgent         DEBUG Registered MBean with objectname: or

                              g.apache.camel:context=AAA-KEW-SIT-CA/camel-1,type=errorhandlers,name="DefaultErrorHandlerBuilder(ref:Came

                              lDefaultErrorHandlerBuilder)"

                              DefaultComponentResolver       DEBUG Found component: jdbc via type: org.

                              apache.camel.component.jdbc.JdbcComponent via: META-INF/services/org/apache/camel/component/jdbc

                              DefaultManagementAgent         DEBUG Registered MBean with objectname: or

                              g.apache.camel:context=AAA-KEW-SIT-CA/camel-1,type=components,name="jdbc"

                              DefaultComponent               DEBUG Creating endpoint uri=[jdbc://testdb

                              ], path=[testdb], parameters=[{}]

                              SpringCamelContext             DEBUG jdbc://testdb converted to endpoint:

                              Endpoint[jdbc://testdb] by component: org.apache.camel.component.jdbc.JdbcComponent@10a6723

                              DefaultManagementAgent         DEBUG Registered MBean with objectname: or

                              g.apache.camel:context=AAA-KEW-SIT-CA/camel-1,type=endpoints,name="jdbc://testdb"

                              DefaultComponentResolver       DEBUG Found component: file via type: org.

                              apache.camel.component.file.FileComponent via: META-INF/services/org/apache/camel/component/file

                              DefaultManagementAgent         DEBUG Registered MBean with objectname: or

                              g.apache.camel:context=AAA-KEW-SIT-CA/camel-1,type=components,name="file"

                              DefaultComponent               DEBUG Creating endpoint uri=[file://target

                              /dboutput?fileName=dbout-%24%7Bdate%3Anow%3Ayyyy-MM-dd-hh-MM-ss%7D.xml], path=[target/dboutput], parameter

                              s=[{fileName=dbout-${date:now:yyyy-MM-dd-hh-MM-ss}.xml}]

                              SimpleLanguage                 DEBUG Expression is evaluated as simple (s

                              trict) expression: dbout-$.xml

                              SpringCamelContext             DEBUG file://target/dboutput?fileName=dbou

                              t-%24%7Bdate%3Anow%3Ayyyy-MM-dd-hh-MM-ss%7D.xml converted to endpoint: Endpoint[file://target/dboutput?fil

                              eName=dbout-%24%7Bdate%3Anow%3Ayyyy-MM-dd-hh-MM-ss%7D.xml] by component: org.apache.camel.component.file.F

                              ileComponent@d1c9b5

                              DefaultManagementAgent         DEBUG Registered MBean with objectname: or

                              g.apache.camel:context=AAA-KEW-SIT-CA/camel-1,type=endpoints,name="file://target/dboutput\?fileName=dbout-

                              %24%7Bdate%3Anow%3Ayyyy-MM-dd-hh-MM-ss%7D.xml"

                              DefaultComponent               DEBUG Creating endpoint uri=[file://target

                              /messages/others], path=[target/messages/others], parameters=[{}]

                              SpringCamelContext             DEBUG file://target/messages/others conver

                              ted to endpoint: Endpoint[file://target/messages/others] by component: org.apache.camel.component.file.Fil

                              eComponent@d1c9b5

                              DefaultManagementAgent         DEBUG Registered MBean with objectname: or

                              g.apache.camel:context=AAA-KEW-SIT-CA/camel-1,type=endpoints,name="file://target/messages/others"

                              SpringCamelContext             DEBUG Warming up route id: route1 having a

                              utoStartup=true

                              RouteService                   DEBUG Starting services on route: route1

                              DefaultManagementAgent         DEBUG Registered MBean with objectname: or

                              g.apache.camel:context=AAA-KEW-SIT-CA/camel-1,type=threadpools,name="DefaultErrorHandler(0x17b2712)"

                              DefaultExecutorServiceStrategy DEBUG Created new scheduled thread pool fo

                              r source: DefaultErrorHandler[TraceInterceptor[Marshal[org.apache.camel.model.dataformat.HL7DataFormat@de5

                              cd9]]] with name: ErrorHandlerRedeliveryTask. . -> java.util.concurrent.ScheduledThreadPoolEx

                              ecutor@423da9

                              DefaultManagementAgent         DEBUG Registered MBean with objectname: or

                              g.apache.camel:context=AAA-KEW-SIT-CA/camel-1,type=services,name=ProducerCache(0x1b8737f)

                              JdbcProducer                   DEBUG Starting producer: Producer[jdbc://t

                              estdb]

                              ProducerCache                  DEBUG Adding to producer cache with key: E

                              ndpoint[jdbc://testdb] for producer: Producer[jdbc://testdb]

                              DefaultManagementAgent         DEBUG Registered MBean with objectname: or

                              g.apache.camel:context=AAA-KEW-SIT-CA/camel-1,type=services,name=ProducerCache(0x1b0bf9a)

                              JdbcProducer                   DEBUG Starting producer: Producer[jdbc://t

                              estdb]

                              ProducerCache                  DEBUG Adding to producer cache with key: E

                              ndpoint[jdbc://testdb] for producer: Producer[jdbc://testdb]

                              DefaultManagementAgent         DEBUG Registered MBean with objectname: or

                              g.apache.camel:context=AAA-KEW-SIT-CA/camel-1,type=services,name=ProducerCache(0xf32dde)

                              GenericFileProducer            DEBUG Starting producer: Producer[file://t

                              arget/dboutput?fileName=dbout-%24%7Bdate%3Anow%3Ayyyy-MM-dd-hh-MM-ss%7D.xml]

                              ProducerCache                  DEBUG Adding to producer cache with key: E

                              ndpoint[file://target/dboutput?fileName=dbout-%24%7Bdate%3Anow%3Ayyyy-MM-dd-hh-MM-ss%7D.xml] for producer:

                              Producer[file://target/dboutput?fileName=dbout-%24%7Bdate%3Anow%3Ayyyy-MM-dd-hh-MM-ss%7D.xml]

                              DefaultManagementAgent         DEBUG Registered MBean with objectname: or

                              g.apache.camel:context=AAA-KEW-SIT-CA/camel-1,type=services,name=ProducerCache(0x1487b8b)

                              GenericFileProducer            DEBUG Starting producer: Producer[file://t

                              arget/messages/others]

                              ProducerCache                  DEBUG Adding to producer cache with key: E

                              ndpoint[file://target/messages/others] for producer: Producer[file://target/messages/others]

                              DefaultManagementAgent         DEBUG Registered MBean with objectname: or

                              g.apache.camel:context=AAA-KEW-SIT-CA/camel-1,type=processors,name="unmarshal1"

                              DefaultManagementAgent         DEBUG Registered MBean with objectname: or

                              g.apache.camel:context=AAA-KEW-SIT-CA/camel-1,type=processors,name="choice1"

                              DefaultManagementAgent         DEBUG Registered MBean with objectname: or

                              g.apache.camel:context=AAA-KEW-SIT-CA/camel-1,type=routes,name="route1"

                              SpringCamelContext             DEBUG Route: route1 >>> EventDrivenConsume

                              rRoute[Endpoint[mina://tcp://151.46.220.183:61610?codec=%23hl7codec&sync=true] -> Instrumentation:route[Un

                              itOfWork(Pipeline[[Channel[Unmarshal[org.apache.camel.component.hl7.HL7DataFormat@1ed7524]], Channel[choic

                              e{when header(CamelHL7TriggerEvent) == A31: Pipeline[[Channel[Wrap[camelhl7.MyRouteBuilder$1@a5c9f1] -> ca

                              melhl7.MyRouteBuilder$1@a5c9f1], Channel[sendTo(Endpoint[jdbc://testdb])], Channel[SetBody(select top 10 *

                              from HL7_MSH_Ver23)], Channel[sendTo(Endpoint[jdbc://testdb])], Channel[Marshal[org.apache.camel.dataform

                              at.xstream.XStreamDataFormat@6d23ea]], Channel[sendTo(Endpoint[file://target/dboutput?fileName=dbout-%24%7

                              Bdate%3Anow%3Ayyyy-MM-dd-hh-MM-ss%7D.xml])]]], otherwise: Pipeline[[Channel[Marshal[org.apache.camel.compo

                              nent.hl7.HL7DataFormat@1ed7524]], Channel[sendTo(Endpoint[file://target/messages/others])]]]}], Channel[Se

                              tBody(MSA|AA|)], Channel[convertBodyTo[java.lang.String]]]])]]

                              SpringCamelContext             DEBUG Starting consumer (order: 1000) on r

                              oute: route1

                              DefaultManagementAgent         DEBUG Registered MBean with objectname: or

                              g.apache.camel:context=AAA-KEW-SIT-CA/camel-1,type=consumers,name=MinaConsumer(0x675039)

                              MinaConsumer                   DEBUG Starting consumer: Consumer[mina://t

                              cp://151.46.220.183:61610?codec=%23hl7codec&sync=true]

                              MinaConsumer                   INFO  Binding to server address: /151.46.2

                              20.183:61610 using acceptor: org.apache.mina.transport.socket.nio.SocketAcceptor@1ac1adf

                              SpringCamelContext             INFO  Route: route1 started and consuming

                              from: Endpoint[mina://tcp://151.46.220.183:61610?codec=%23hl7codec&sync=true]

                              DefaultComponent               DEBUG Creating endpoint uri=[spring-event:

                              //default], path=[default], parameters=[{}]

                              SpringCamelContext             DEBUG spring-event://default converted to

                              endpoint: Endpoint[spring-event://default] by component: org.apache.camel.component.event.EventComponent@7

                              6b359

                              DefaultManagementAgent         DEBUG Registered MBean with objectname: or

                              g.apache.camel:context=AAA-KEW-SIT-CA/camel-1,type=endpoints,name="spring-event://default"

                              SpringCamelContext             INFO  Total 1 routes, of which 1 is starte

                              d.

                              SpringCamelContext             INFO  Apache Camel 2.7.1 (CamelContext: ca

                              mel-1) started in 1.875 seconds

                              MainSupport                    DEBUG Starting Spring ApplicationContext:

                              org.springframework.context.support.ClassPathXmlApplicationContext@b29c9d

                              SpringCamelContext             DEBUG onApplicationEvent: org.springframew

                              ork.context.event.ContextStartedEvent[source=org.springframework.context.support.ClassPathXmlApplicationCo

                              ntext@b29c9d: startup date ; root of context hierarchy]

                              HL7MLLPDecoder                 DEBUG Start scanning buffer at position 0

                              HL7MLLPDecoder                 DEBUG Message starts at position 1

                              HL7MLLPDecoder                 DEBUG Message ends at position 368

                              HL7MLLPDecoder                 DEBUG Decoded HL7 from byte stream of leng

                              th 367 to String of length 367

                              HL7MLLPDecoder                 DEBUG Start scanning buffer at position 37

                              0

                              HL7MLLPDecoder                 DEBUG No complete message in this packet

                              MinaConsumer                   DEBUG Received body: MSH|^~\&|GENDAPR

                              PID||14995|T22375|MERMER|qwertyMMM^^Mr||19800101000000.000|M|^^^^PG||23 Road^HA

                              PV1||SURGERY^^1|G3250|||||GB||||

                              Parser                         INFO  Instantiating msg of class ca.uhn.hl

                              7v2.model.v23.message.ADT_A01

                              ChoiceProcessor                DEBUG #0 - header(CamelHL7TriggerEvent) ==

                              A31 matches: true for: Exchange[Message: ca.uhn.hl7v2.model.v23.message.ADT_A01@17efd36]

                              Camel File Name: null

                              SendProcessor                  DEBUG >>>> Endpoint[jdbc://testdb] Exchang

                              e[Message: Insert into HL7_MSH_Ver23 values ('ULTRAGENDAPRO','III','null','null','20111021090729.271','nul

                              l','ADT','634547848495993671','T','2.3','null','null','NE','AL','','ASCII')]

                              JdbcProducer                   DEBUG Executing JDBC statement: Insert int

                              o HL7_MSH_Ver23 values ('ULTRAGENDAPRO','III','null','null','20111021090729.271','null','ADT','63454849

                              5993671','T','2.3','null','null','NE','AL','','ASCII')

                              SendProcessor                  DEBUG >>>> Endpoint[jdbc://testdb] Exchang

                              e[Message: select top 10 * from HL7_MSH_Ver23]

                              JdbcProducer                   DEBUG Executing JDBC statement: select top

                              10 * from HL7_MSH_Ver23

                              SendProcessor                  DEBUG >>>> Endpoint[file://target/dboutput

                              ?fileName=dbout-%24%7Bdate%3Anow%3Ayyyy-MM-dd-hh-MM-ss%7D.xml] Exchange[Message:

                              GenericFileProducer            DEBUG Filename evaluated as expression: db

                              out-$.xml

                              GenericFileProducer            DEBUG Wrote [target\dboutput\dbout-2011-11

                              -13-07-11-53.xml] to [Endpoint[file://target/dboutput?fileName=dbout-%24%7Bdate%3Anow%3Ayyyy-MM-dd-hh-MM-s

                              s%7D.xml]]

                              MinaConsumer                   DEBUG Writing body: MSA|AA|

                              HL7MLLPEncoder                 DEBUG Encoding HL7 from java.lang.String t

                              o byte stream

                              • 14. Re: Camel exception in Exchange using OSGi:  but OK if run in Camel Context
                                Claus Ibsen Master

                                I have created a ticket to track this issue

                                http://fusesource.com/issues/browse/MR-550

                                 

                                The HAPI bundle seems wrong. I could reproduce the issue in an unit test.

                                1 2 Previous Next