camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joe San <codeintheo...@gmail.com>
Subject Re: JAXB Data Format
Date Thu, 16 Aug 2012 13:50:39 GMT
Exception in thread "main" java.lang.NoClassDefFoundError:
org/slf4j/LoggerFactory
    at
org.apache.camel.support.ServiceSupport.<clinit>(ServiceSupport.java:38)
    at
org.example.filexml.CamelWithFileAndXML.main(CamelWithFileAndXML.java:23)
Caused by: java.lang.ClassNotFoundException: org.slf4j.LoggerFactory
    at java.net.URLClassLoader$1.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    ... 2 more

My simple route fails with the above exception. All I have in my pom.xml
defined is:

    <dependency>
        <groupId>org.apache.camel</groupId>
        <artifactId>camel-core</artifactId>
        <version>2.9.2</version>
    </dependency>
    <dependency>
      <groupId>org.apache.camel</groupId>
      <artifactId>camel-jaxb</artifactId>
      <version>2.9.2</version>
    </dependency>

Do I need additional dependencies to be added other than this?

Regards,
Jothi

On Thu, Aug 16, 2012 at 3:34 PM, Joe San <codeintheopen@gmail.com> wrote:

> I just found that out from Chapter 4. I would have expected this hint that
> "when the bean has only one method, camel invokes it automagically without
> having to explicitly specifying it" in Chapter 3 itself.
>
> Regards,
> Jothi
>
>
> On Thu, Aug 16, 2012 at 3:32 PM, Claus Ibsen <claus.ibsen@gmail.com>wrote:
>
>> On Thu, Aug 16, 2012 at 3:16 PM, Joe San <codeintheopen@gmail.com> wrote:
>> > Thanks for pointing me to toe documentation. My actual question got
>> > clarified once I had a look into the documentation.
>> >
>> > From the Camel in Action book:
>> >
>> > from("quartz://report?cron=0+0+6+*+*+?")
>> > .to("http://riders.com/orders/cmd=received&date=yesterday")
>> > .bean(new OrderToCsvBean())
>> > .to("file://riders/orders?fileName=report-${header.Date}.csv");
>> >
>> > How does Camel know which method in the OrderToCsvBean() class to
>> invoke.
>> > Unfortunately the book does not mentions this in Chapter 3. Not sure if
>> it
>> > is mentioned in Chapter 4 as I'm yet to start with Chapter 4.
>> >
>>
>> Yep chapter 4 is all about using beans/pojos with Camel; see for
>> example page 105.
>>
>> But basically if the pojo/bean has 1 method, then Camel knows that it
>> should invoke that method.
>> Its when you have 2+ methods it gets more complicated. You can of
>> course tell Camel the method name to use etc.
>>
>> But its all covered as well in chapter 4, as well you can find pieces
>> of details scattered online in the Camel docs.
>>
>>
>> > Regards,
>> > Jothi
>> >
>> > On Thu, Aug 16, 2012 at 2:46 PM, Babak Vahdat
>> > <babak.vahdat@swissonline.ch>wrote:
>> >
>> >> Check the documentation for this:
>> >>
>> >> http://camel.apache.org/bean-binding.html
>> >>
>> >> Babak
>> >>
>> >> Am 16.08.12 14:32 schrieb "Joe San" unter <codeintheopen@gmail.com>:
>> >>
>> >> >I have decided to use JAXB instead of xStream. My route definition
>> looks
>> >> >like this:
>> >> >
>> >> >        final JaxbDataFormat jaxb = new
>> >> >JaxbDataFormat("com.example.filexml");
>> >> >        context.addRoutes(new RouteBuilder() {
>> >> >            public void configure() {
>> >> >                from("file://my.xml").unmarshal(jaxb).bean(new
>> >> >ProcessorBean()).to("file://my.xml");
>> >> >            }
>> >> >        });
>> >> >
>> >> >How do I get hold of the UnMarshalled Java Object (say Person.java)
>> in my
>> >> >ProcessorBean. Also, when I use a bean for Processing, how does Camel
>> know
>> >> >which method to invoke in that bean?
>> >> >
>> >> >Regards,
>> >> >Jothi
>> >> >
>> >> >On Thu, Aug 16, 2012 at 1:56 PM, Joe San <codeintheopen@gmail.com>
>> wrote:
>> >> >
>> >> >> Guys,
>> >> >>
>> >> >> I have a route which is defined as below:
>> >> >>
>> >> >> from("file://my.xml").marshal().xstream("UTF-8").bean(new
>> >> >> ProcessorBean()).to("file://my.xml");
>> >> >>
>> >> >> All I want to do is access the my.xml in my ProcessorBean. Where
>> and how
>> >> >> do I specify the Java object which will be filled with the values
>> in the
>> >> >> xml file?
>> >> >>
>> >> >> Regards,
>> >> >> Jothi
>> >> >>
>> >>
>> >>
>> >>
>>
>>
>>
>> --
>> Claus Ibsen
>> -----------------
>> FuseSource
>> Email: cibsen@fusesource.com
>> Web: http://fusesource.com
>> Twitter: davsclaus, fusenews
>> Blog: http://davsclaus.com
>> Author of Camel in Action: http://www.manning.com/ibsen
>>
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message