You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by sscott <st...@codemettle.com> on 2013/01/03 18:05:52 UTC

Unable to consume syslog messages

I'm attempting to use camel-syslog as detailed at
http://camel.apache.org/syslog.html to consume syslog messages. I'm using
Camel 2.10.2, Oracle JDK 1.6.0_31 64-Bit on CentOS 6.2.

I set up a simple test using Netty:

    val ctx = new DefaultCamelContext

    val dataFormat = new Rfc3164SyslogDataFormat

    ctx.addRoutes(new RouteBuilder() {
        def configure() {
           
from("netty:udp://localhost:5140?sync=false&allowDefaultCodec=false")
                .setExchangePattern(ExchangePattern.InOnly)
                .unmarshal(dataFormat)
                .bean(classOf[SyslogBean])
        }
    })
    ctx.start()

(SyslogBean has a single method that accepts a
o.a.c.component.syslog.SyslogMessage and logs it).

I set up rsyslogd to forward *.* to localhost:5140.  Every log message
causes Camel to output an InvalidPayloadException caused by a
NoTypeConversionAvailableException with the detail "No type converter
available to convert from type:
org.jboss.netty.buffer.BigEndianHeapChannelBuffer to the required type:
java.io.InputStream with value BigEndianHeapChannelBuffer(ridx=0, widx=105,
cap=105)"

When I change the from() to be "mina:", with or without the sync=false and
allowDefaultCodec=false options, and change the maven dependencies to
camel-mina from camel-netty, the same exceptions are thrown with the detail
"No body available of type: java.io.InputStream on: Message: [Body is null].
Caused by: No type converter available to convert from type: null to the
required type: java.io.InputStream with value null."

This probably is more of a netty/mina question than a syslog dataformat
question, any help is appreciated



--
View this message in context: http://camel.465427.n5.nabble.com/Unable-to-consume-syslog-messages-tp5724850.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Unable to consume syslog messages

Posted by Claus Ibsen <cl...@gmail.com>.
On Tue, Jan 8, 2013 at 5:56 PM, sscott <st...@codemettle.com> wrote:
> sscott wrote
>> I set up rsyslogd to forward *.* to localhost:5140.  Every log message
>> causes Camel to output an InvalidPayloadException caused by a
>> NoTypeConversionAvailableException with the detail "No type converter
>> available to convert from type:
>> org.jboss.netty.buffer.BigEndianHeapChannelBuffer to the required type:
>> java.io.InputStream with value BigEndianHeapChannelBuffer(ridx=0,
>> widx=105, cap=105)"
>>
>> When I change the from() to be "mina:", with or without the sync=false and
>> allowDefaultCodec=false options, and change the maven dependencies to
>> camel-mina from camel-netty, the same exceptions are thrown with the
>> detail "No body available of type: java.io.InputStream on: Message: [Body
>> is null]. Caused by: No type converter available to convert from type:
>> null to the required type: java.io.InputStream with value null."
>
> In case anybody ever has this problem in the future, it was caused by using
> maven-assembly-plugin to package all the code into a jar-with-dependencies.
> I'm assuming it's a TypeConverter / MANIFEST.MF issue.
>

Thanks for sharing your solution to the problem.

Yeah be careful with the packaginging an uber JAR thingy. The content
in the various files in the META-INF dir need to be merged together,
and not override each other.

>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Unable-to-consume-syslog-messages-tp5724850p5725140.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
Red Hat, Inc.
FuseSource is now part of Red Hat
Email: cibsen@redhat.com
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen

Re: Unable to consume syslog messages

Posted by sscott <st...@codemettle.com>.
sscott wrote
> I set up rsyslogd to forward *.* to localhost:5140.  Every log message
> causes Camel to output an InvalidPayloadException caused by a
> NoTypeConversionAvailableException with the detail "No type converter
> available to convert from type:
> org.jboss.netty.buffer.BigEndianHeapChannelBuffer to the required type:
> java.io.InputStream with value BigEndianHeapChannelBuffer(ridx=0,
> widx=105, cap=105)"
> 
> When I change the from() to be "mina:", with or without the sync=false and
> allowDefaultCodec=false options, and change the maven dependencies to
> camel-mina from camel-netty, the same exceptions are thrown with the
> detail "No body available of type: java.io.InputStream on: Message: [Body
> is null]. Caused by: No type converter available to convert from type:
> null to the required type: java.io.InputStream with value null."

In case anybody ever has this problem in the future, it was caused by using
maven-assembly-plugin to package all the code into a jar-with-dependencies.
I'm assuming it's a TypeConverter / MANIFEST.MF issue.



--
View this message in context: http://camel.465427.n5.nabble.com/Unable-to-consume-syslog-messages-tp5724850p5725140.html
Sent from the Camel - Users mailing list archive at Nabble.com.