Camel
  1. Camel
  2. CAMEL-3890

Camel Syslog Converter Not Selected Automatically

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.7.1
    • Fix Version/s: 2.7.3, 2.8.0
    • Component/s: None
    • Labels:
      None
    • Environment:

      Mac OS X 10.6.7, JDK 1.6, Maven 3.0.2, Camel 2.7.1

    • Patch Info:
      Patch Available

      Description

      When creating a route that sends text data from a file to the Camel Syslog unmarshal data format, the following error is returned.
      Looking at the org.apache.camel.component.syslog.Rfc3164SyslogConverter reveals that the @Converter annotation is missing at the class level.
      The attached test case illustrates the problem. With modifications to the pom.xml to point to the modified version of the camel-syslog the test works. See the comment: CHANGE TO POINT TO MODIFIED CAMEL-SYSLOG

      org.apache.camel.NoTypeConversionAvailableException: No type converter available to convert from type: java.lang.String to the required type: org.apache.camel.component.syslog.SyslogMessage with value <165>Aug 4 05:34:00 mymachine myproc[10]: %% It's\n time to make the do-nuts. %% Ingredients: Mix=OK, Jelly=OK #\n Devices: Mixer=OK, Jelly_Injector=OK, Frier=OK # Transport:\n Conveyer1=OK, Conveyer2=OK # %%

      at org.apache.camel.impl.converter.BaseTypeConverterRegistry.mandatoryConvertTo(BaseTypeConverterRegistry.java:143)[camel-core-2.7.1.jar:2.7.1]
      at org.apache.camel.util.ExchangeHelper.convertToMandatoryType(ExchangeHelper.java:142)[camel-core-2.7.1.jar:2.7.1]
      at org.apache.camel.component.syslog.Rfc3164SyslogDataFormat.marshal(Rfc3164SyslogDataFormat.java:29)[camel-syslog-2.7.1.jar:2.7.1]
      at org.apache.camel.processor.MarshalProcessor.process(MarshalProcessor.java:57)[camel-core-2.7.1.jar:2.7.1]
      at org.apache.camel.impl.converter.AsyncProcessorTypeConverter$ProcessorToAsyncProcessorBridge.process(AsyncProcessorTypeConverter.java:50)[camel-core-2.7.1.jar:2.7.1]
      at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:77)[camel-core-2.7.1.jar:2.7.1]
      at org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:98)[camel-core-2.7.1.jar:2.7.1]
      at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:89)[camel-core-2.7.1.jar:2.7.1]
      at org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:68)[camel-core-2.7.1.jar:2.7.1]
      at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:77)[camel-core-2.7.1.jar:2.7.1]
      at org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:98)[camel-core-2.7.1.jar:2.7.1]
      at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:89)[camel-core-2.7.1.jar:2.7.1]
      at org.apache.camel.processor.interceptor.TraceInterceptor.process(TraceInterceptor.java:99)[camel-core-2.7.1.jar:2.7.1]
      at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:77)[camel-core-2.7.1.jar:2.7.1]
      at org.apache.camel.processor.RedeliveryErrorHandler.processErrorHandler(RedeliveryErrorHandler.java:299)[camel-core-2.7.1.jar:2.7.1]
      at org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:208)[camel-core-2.7.1.jar:2.7.1]
      at org.apache.camel.processor.DefaultChannel.process(DefaultChannel.java:269)[camel-core-2.7.1.jar:2.7.1]
      at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:77)[camel-core-2.7.1.jar:2.7.1]
      at org.apache.camel.processor.Pipeline.process(Pipeline.java:125)[camel-core-2.7.1.jar:2.7.1]
      at org.apache.camel.processor.Pipeline.process(Pipeline.java:80)[camel-core-2.7.1.jar:2.7.1]
      at org.apache.camel.processor.UnitOfWorkProcessor.process(UnitOfWorkProcessor.java:109)[camel-core-2.7.1.jar:2.7.1]
      at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:77)[camel-core-2.7.1.jar:2.7.1]
      at org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:98)[camel-core-2.7.1.jar:2.7.1]
      at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:89)[camel-core-2.7.1.jar:2.7.1]
      at org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:68)[camel-core-2.7.1.jar:2.7.1]
      at org.apache.camel.component.file.GenericFileConsumer.processExchange(GenericFileConsumer.java:330)[camel-core-2.7.1.jar:2.7.1]
      at org.apache.camel.component.file.GenericFileConsumer.processBatch(GenericFileConsumer.java:157)[camel-core-2.7.1.jar:2.7.1]
      at org.apache.camel.component.file.GenericFileConsumer.poll(GenericFileConsumer.java:121)[camel-core-2.7.1.jar:2.7.1]
      at org.apache.camel.impl.ScheduledPollConsumer.run(ScheduledPollConsumer.java:97)[camel-core-2.7.1.jar:2.7.1]
      at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)[:1.6.0_24]
      at java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:317)[:1.6.0_24]
      at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:150)[:1.6.0_24]
      at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(ScheduledThreadPoolExecutor.java:98)[:1.6.0_24]
      at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodic(ScheduledThreadPoolExecutor.java:180)[:1.6.0_24]
      at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:204)[:1.6.0_24]
      at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)[:1.6.0_24]
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)[:1.6.0_24]
      at java.lang.Thread.run(Thread.java:680)[:1.6.0_24]

      1. camel-syslog.patch
        0.6 kB
        Roberto Rojas
      2. camel-syslog-test.tar.gz
        21 kB
        Roberto Rojas

        Activity

        Hide
        Claus Ibsen added a comment -

        Roberto do you mind re-attaching the patches and make sure to [x] about the Apache license. Then we should be able to get the patch into the trunk

        Show
        Claus Ibsen added a comment - Roberto do you mind re-attaching the patches and make sure to [x] about the Apache license. Then we should be able to get the patch into the trunk
        Hide
        Roberto Rojas added a comment -

        Sure, no problem. I'll keep it in mind to apply the ASF license when upload those files.

        Show
        Roberto Rojas added a comment - Sure, no problem. I'll keep it in mind to apply the ASF license when upload those files.
        Hide
        Edstrom Johan added a comment -

        Fixed in revision

        1097978, Thanks Roberto!

        Show
        Edstrom Johan added a comment - Fixed in revision 1097978, Thanks Roberto!
        Hide
        Roberto Rojas added a comment - - edited

        Sure, any time.

        Show
        Roberto Rojas added a comment - - edited Sure, any time.
        Hide
        Martin added a comment -

        Has this been validated in 2.8.2 I get the same error. Hopefully something I'm doing wrong...

        from("direct:syslog")
          .convertBodyTo(java.lang.String.class)
          .marshal().syslog()
          .to("netty:udp://localhost:10514")
        

        2011-11-20 19:36:34,462 [main] INFO interceptor.Tracer - ID-martins-macbook-pro-local-50036-1321839379898-1-1 >>> (route1) from(direct://syslog) --> <<< Pattern:InOnly, Headers:

        {breadcrumbId=ID-martin-gees-macbook-pro-local-50036-1321839379898-1-2}, BodyType:String, Body:THIS IS A TEST
        2011-11-20 19:36:34,469 [main] INFO interceptor.Tracer - ID-martins-macbook-pro-local-50036-1321839379898-1-1 >>> (route1) --> Marshal[org.apache.camel.model.dataformat.SyslogDataFormat@66e8791] <<< Pattern:InOnly, Headers:{breadcrumbId=ID-martin-gees-macbook-pro-local-50036-1321839379898-1-2}

        , BodyType:String, Body:THIS IS A TEST

        Error 2011-11-20 19:36:34,618 [main] ERROR processor.DefaultErrorHandler - Failed delivery for exchangeId: ID-martin-gees-macbook-pro-local-50036-1321839379898-1-1. Exhausted after delivery attempt: 1 caught: org.apache.camel.NoTypeConversionAvailableException: No type converter available to convert from type: java.lang.String to the required type: org.apache.camel.component.syslog.SyslogMessage with value THIS IS A TEST
        Message: No type converter available to convert from type: java.lang.String to the required type: org.apache.camel.component.syslog.SyslogMessage with value THIS IS A TEST
        Line
        Method
        ->> 140
        mandatoryConvertTo in org.apache.camel.impl.converter.BaseTypeConverterRegistry
        • - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        143 convertToMandatoryType in org.apache.camel.util.ExchangeHelper
        29 marshal . . . . . . . . in org.apache.camel.component.syslog.Rfc3164SyslogDataFormat
        58 process in org.apache.camel.processor.MarshalProcessor
        50 process . . . . . . . . in org.apache.camel.impl.converter.AsyncProcessorTypeConverter$ProcessorToAsyncProcessorBridge
        78 process in org.apache.camel.util.AsyncProcessorHelper
        98 processNext . . . . . . in org.apache.camel.processor.DelegateAsyncProcessor
        89 process in ''
        162 process . . . . . . . . in org.apache.camel.processor.interceptor.TraceInterceptor
        78 process in org.apache.camel.util.AsyncProcessorHelper
        98 processNext . . . . . . in org.apache.camel.processor.DelegateAsyncProcessor
        89 process in ''
        50 process . . . . . . . . in org.apache.camel.processor.interceptor.Debug$1
        78 process in org.apache.camel.util.AsyncProcessorHelper
        318 processErrorHandler . . in org.apache.camel.processor.RedeliveryErrorHandler
        209 process in ''
        306 process . . . . . . . . in org.apache.camel.processor.DefaultChannel
        78 process in org.apache.camel.util.AsyncProcessorHelper
        116 process . . . . . . . . in org.apache.camel.processor.Pipeline
        79 process in ''
        132 process . . . . . . . . in org.apache.camel.processor.UnitOfWorkProcessor
        78 process in org.apache.camel.util.AsyncProcessorHelper
        98 processNext . . . . . . in org.apache.camel.processor.DelegateAsyncProcessor
        89 process in ''
        69 process . . . . . . . . in org.apache.camel.management.InstrumentationProcessor
        78 process in org.apache.camel.util.AsyncProcessorHelper
        61 process . . . . . . . . in org.apache.camel.component.direct.DirectProducer
        102 process in org.apache.camel.processor.UnitOfWorkProcessor
        104 process . . . . . . . . in org.apache.camel.util.AsyncProcessorHelper
        85 process in org.apache.camel.processor.DelegateAsyncProcessor
        63 process . . . . . . . . in org.apache.camel.processor.UnitOfWorkProducer
        351 doInProducer in org.apache.camel.impl.ProducerCache$2
        323 doInProducer . . . . . . in ''
        222 doInProducer in org.apache.camel.impl.ProducerCache
        323 sendExchange . . . . . . in ''
        168 send in ''
        110 send . . . . . . . . . . in org.apache.camel.impl.DefaultProducerTemplate
        123 sendBody in ''
        341 sendBody . . . . . . . . in ''
        49 testSendingSyslogMessage in com.icsynergy.idr.SyslogRoutingTests
        45 runReflectiveCall . . . in org.junit.runners.model.FrameworkMethod$1
        15 run in org.junit.internal.runners.model.ReflectiveCallable
        42 invokeExplosively . . . in org.junit.runners.model.FrameworkMethod
        20 evaluate in org.junit.internal.runners.statements.InvokeMethod
        28 evaluate . . . . . . . . in org.junit.internal.runners.statements.RunBefores
        30 evaluate in org.junit.internal.runners.statements.RunAfters
        263 runLeaf . . . . . . . . in org.junit.runners.ParentRunner
        68 runChild in org.junit.runners.BlockJUnit4ClassRunner
        47 runChild . . . . . . . . in ''
        231 run in org.junit.runners.ParentRunner$3
        60 schedule . . . . . . . . in org.junit.runners.ParentRunner$1
        229 runChildren in org.junit.runners.ParentRunner
        50 access$000 . . . . . . . in ''
        222 evaluate in org.junit.runners.ParentRunner$2
        30 evaluate . . . . . . . . in org.junit.internal.runners.statements.RunAfters
        300 run in org.junit.runners.ParentRunner
        128 runChild . . . . . . . . in org.junit.runners.Suite
        24 runChild in ''
        231 run . . . . . . . . . . in org.junit.runners.ParentRunner$3
        60 schedule in org.junit.runners.ParentRunner$1
        229 runChildren . . . . . . in org.junit.runners.ParentRunner
        50 access$000 in ''
        222 evaluate . . . . . . . . in org.junit.runners.ParentRunner$2
        300 run in org.junit.runners.ParentRunner
        285 doCall . . . . . . . . . in _GrailsTest_groovy$_run_closure4
        243 doCall in _GrailsTest_groovy$_run_closure2
        190 doCall . . . . . . . . . in _GrailsTest_groovy$_run_closure1_closure21
        179 doCall in _GrailsTest_groovy$_run_closure1
        ^ 82
        doCall . . . . . . . . . in TestApp$_run_closure1
        Caused by RuntimeCamelException: java.nio.BufferUnderflowException
        ->> 834
        invokeMethod in org.apache.camel.util.ObjectHelper
        • - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        50 convertTo in org.apache.camel.impl.converter.StaticMethodTypeConverter
        182 doConvertTo . . . . . . in org.apache.camel.impl.converter.BaseTypeConverterRegistry
        47 doConvertTo in org.apache.camel.impl.converter.LazyLoadingTypeConverter
        138 mandatoryConvertTo . . . in org.apache.camel.impl.converter.BaseTypeConverterRegistry
        143 convertToMandatoryType in org.apache.camel.util.ExchangeHelper
        29 marshal . . . . . . . . in org.apache.camel.component.syslog.Rfc3164SyslogDataFormat
        Show
        Martin added a comment - Has this been validated in 2.8.2 I get the same error. Hopefully something I'm doing wrong... from( "direct:syslog" ) .convertBodyTo(java.lang. String .class) .marshal().syslog() .to( "netty:udp: //localhost:10514" ) 2011-11-20 19:36:34,462 [main] INFO interceptor.Tracer - ID-martins-macbook-pro-local-50036-1321839379898-1-1 >>> (route1) from(direct://syslog) --> <<< Pattern:InOnly, Headers: {breadcrumbId=ID-martin-gees-macbook-pro-local-50036-1321839379898-1-2}, BodyType:String, Body:THIS IS A TEST 2011-11-20 19:36:34,469 [main] INFO interceptor.Tracer - ID-martins-macbook-pro-local-50036-1321839379898-1-1 >>> (route1) --> Marshal [org.apache.camel.model.dataformat.SyslogDataFormat@66e8791] <<< Pattern:InOnly, Headers:{breadcrumbId=ID-martin-gees-macbook-pro-local-50036-1321839379898-1-2} , BodyType:String, Body:THIS IS A TEST Error 2011-11-20 19:36:34,618 [main] ERROR processor.DefaultErrorHandler - Failed delivery for exchangeId: ID-martin-gees-macbook-pro-local-50036-1321839379898-1-1. Exhausted after delivery attempt: 1 caught: org.apache.camel.NoTypeConversionAvailableException: No type converter available to convert from type: java.lang.String to the required type: org.apache.camel.component.syslog.SyslogMessage with value THIS IS A TEST Message: No type converter available to convert from type: java.lang.String to the required type: org.apache.camel.component.syslog.SyslogMessage with value THIS IS A TEST Line Method ->> 140 mandatoryConvertTo in org.apache.camel.impl.converter.BaseTypeConverterRegistry - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 143 convertToMandatoryType in org.apache.camel.util.ExchangeHelper 29 marshal . . . . . . . . in org.apache.camel.component.syslog.Rfc3164SyslogDataFormat 58 process in org.apache.camel.processor.MarshalProcessor 50 process . . . . . . . . in org.apache.camel.impl.converter.AsyncProcessorTypeConverter$ProcessorToAsyncProcessorBridge 78 process in org.apache.camel.util.AsyncProcessorHelper 98 processNext . . . . . . in org.apache.camel.processor.DelegateAsyncProcessor 89 process in '' 162 process . . . . . . . . in org.apache.camel.processor.interceptor.TraceInterceptor 78 process in org.apache.camel.util.AsyncProcessorHelper 98 processNext . . . . . . in org.apache.camel.processor.DelegateAsyncProcessor 89 process in '' 50 process . . . . . . . . in org.apache.camel.processor.interceptor.Debug$1 78 process in org.apache.camel.util.AsyncProcessorHelper 318 processErrorHandler . . in org.apache.camel.processor.RedeliveryErrorHandler 209 process in '' 306 process . . . . . . . . in org.apache.camel.processor.DefaultChannel 78 process in org.apache.camel.util.AsyncProcessorHelper 116 process . . . . . . . . in org.apache.camel.processor.Pipeline 79 process in '' 132 process . . . . . . . . in org.apache.camel.processor.UnitOfWorkProcessor 78 process in org.apache.camel.util.AsyncProcessorHelper 98 processNext . . . . . . in org.apache.camel.processor.DelegateAsyncProcessor 89 process in '' 69 process . . . . . . . . in org.apache.camel.management.InstrumentationProcessor 78 process in org.apache.camel.util.AsyncProcessorHelper 61 process . . . . . . . . in org.apache.camel.component.direct.DirectProducer 102 process in org.apache.camel.processor.UnitOfWorkProcessor 104 process . . . . . . . . in org.apache.camel.util.AsyncProcessorHelper 85 process in org.apache.camel.processor.DelegateAsyncProcessor 63 process . . . . . . . . in org.apache.camel.processor.UnitOfWorkProducer 351 doInProducer in org.apache.camel.impl.ProducerCache$2 323 doInProducer . . . . . . in '' 222 doInProducer in org.apache.camel.impl.ProducerCache 323 sendExchange . . . . . . in '' 168 send in '' 110 send . . . . . . . . . . in org.apache.camel.impl.DefaultProducerTemplate 123 sendBody in '' 341 sendBody . . . . . . . . in '' 49 testSendingSyslogMessage in com.icsynergy.idr.SyslogRoutingTests 45 runReflectiveCall . . . in org.junit.runners.model.FrameworkMethod$1 15 run in org.junit.internal.runners.model.ReflectiveCallable 42 invokeExplosively . . . in org.junit.runners.model.FrameworkMethod 20 evaluate in org.junit.internal.runners.statements.InvokeMethod 28 evaluate . . . . . . . . in org.junit.internal.runners.statements.RunBefores 30 evaluate in org.junit.internal.runners.statements.RunAfters 263 runLeaf . . . . . . . . in org.junit.runners.ParentRunner 68 runChild in org.junit.runners.BlockJUnit4ClassRunner 47 runChild . . . . . . . . in '' 231 run in org.junit.runners.ParentRunner$3 60 schedule . . . . . . . . in org.junit.runners.ParentRunner$1 229 runChildren in org.junit.runners.ParentRunner 50 access$000 . . . . . . . in '' 222 evaluate in org.junit.runners.ParentRunner$2 30 evaluate . . . . . . . . in org.junit.internal.runners.statements.RunAfters 300 run in org.junit.runners.ParentRunner 128 runChild . . . . . . . . in org.junit.runners.Suite 24 runChild in '' 231 run . . . . . . . . . . in org.junit.runners.ParentRunner$3 60 schedule in org.junit.runners.ParentRunner$1 229 runChildren . . . . . . in org.junit.runners.ParentRunner 50 access$000 in '' 222 evaluate . . . . . . . . in org.junit.runners.ParentRunner$2 300 run in org.junit.runners.ParentRunner 285 doCall . . . . . . . . . in _GrailsTest_groovy$_run_closure4 243 doCall in _GrailsTest_groovy$_run_closure2 190 doCall . . . . . . . . . in _GrailsTest_groovy$_run_closure1_closure21 179 doCall in _GrailsTest_groovy$_run_closure1 ^ 82 doCall . . . . . . . . . in TestApp$_run_closure1 Caused by RuntimeCamelException: java.nio.BufferUnderflowException ->> 834 invokeMethod in org.apache.camel.util.ObjectHelper - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 50 convertTo in org.apache.camel.impl.converter.StaticMethodTypeConverter 182 doConvertTo . . . . . . in org.apache.camel.impl.converter.BaseTypeConverterRegistry 47 doConvertTo in org.apache.camel.impl.converter.LazyLoadingTypeConverter 138 mandatoryConvertTo . . . in org.apache.camel.impl.converter.BaseTypeConverterRegistry 143 convertToMandatoryType in org.apache.camel.util.ExchangeHelper 29 marshal . . . . . . . . in org.apache.camel.component.syslog.Rfc3164SyslogDataFormat
        Hide
        Claus Ibsen added a comment -

        Martin what runtime do you use? eg do you run Camel in ServiceMix, Karaf, Tomcat etc?

        Show
        Claus Ibsen added a comment - Martin what runtime do you use? eg do you run Camel in ServiceMix, Karaf, Tomcat etc?

          People

          • Assignee:
            Hadrian Zbarcea
            Reporter:
            Roberto Rojas
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development