camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Claus Ibsen <claus.ib...@gmail.com>
Subject Re: Trying to set JaxbDataFormat on CdiCamelContext
Date Mon, 03 Jun 2013 14:00:34 GMT
Hi

Do you have a jaxb.index file in the classpath so JAXB knows which
JAXB classes you have?

On Thu, May 30, 2013 at 4:54 PM, Ornitorrinc <ornitorrinc@gmail.com> wrote:
> My goal is to set on the CdiCamelContext, the information required about
> JaxbDataFormat to be able to use Jaxb on the routes building. But I have not
> found how to do it on the forums or in the book "Camel in Action".
>
> That would be an example of what I'd like to do using Spring:
> <camel:camelContext id="processesCamelContext">
>         <camel:contextScan />
>         <camel:dataFormats>
>          <camel:jaxb id="jaxb" contextPath="es.gc.epsilon.core.domain" />
>         </camel:dataFormats>
> </camel:camelContext>
>
> That is the code on my BootStrap to configure JaxbDataFormat:
>
>   @Inject
>   private CdiCamelContext camelCtx;
>
> [...]
>
>     JaxbDataFormat jdb = new JaxbDataFormat();
>     jdb.setContextPath("es.gc.epsilon.core.domain");
>     jdb.setPrettyPrint(true);
>     jdb.setCamelContext(camelCtx);
>     DataFormatDefinition dfd = new DataFormatDefinition(jdb);
>     camelCtx.getDataFormats().put("jaxb", dfd);
>
> And that is my attempt to configure a route:
>
>
> from("jms:queue:EP_QUEUE_JOURNAL").marshal().jaxb().bean(journalEventProcessor);
>
> But on the deploy, I get that error:
>
> Caused by: javax.xml.bind.JAXBException: class
> es.gc.epsilon.core.domain.JournalEvent nor any of its superclass is known to
> this context
>         at
> com.sun.xml.bind.v2.runtime.JAXBContextImpl.getBeanInfo(JAXBContextImpl.java:593)
> [jaxb-impl-2.2.6.jar:2.2.6]
>         at
> com.sun.xml.bind.v2.runtime.XMLSerializer.childAsRoot(XMLSerializer.java:482)
> [jaxb-impl-2.2.6.jar:2.2.6]
>         at
> com.sun.xml.bind.v2.runtime.MarshallerImpl.write(MarshallerImpl.java:323)
> [jaxb-impl-2.2.6.jar:2.2.6]
>         at
> com.sun.xml.bind.v2.runtime.MarshallerImpl.marshal(MarshallerImpl.java:251)
> [jaxb-impl-2.2.6.jar:2.2.6]
>         at
> javax.xml.bind.helpers.AbstractMarshallerImpl.marshal(AbstractMarshallerImpl.java:74)
> [jboss-jaxb-api_2.2_spec-1.0.3.Final.jar:1.0.3.Final]
>         at
> org.apache.camel.converter.jaxb.JaxbDataFormat.marshal(JaxbDataFormat.java:146)
> [camel-jaxb-2.11.0.jar:2.11.0]
>         at
> org.apache.camel.converter.jaxb.JaxbDataFormat.marshal(JaxbDataFormat.java:126)
> [camel-jaxb-2.11.0.jar:2.11.0]
>         ... 47 more
>
> I'm using:
> Apache Camel 2.11.0
> Windows7
> Jboss7
> java version "1.7.0_11"
> Java(TM) SE Runtime Environment (build 1.7.0_11-b21)
> Java HotSpot(TM) 64-Bit Server VM (build 23.6-b04, mixed mode)
>
> Any help will be appreciated.
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Trying-to-set-JaxbDataFormat-on-CdiCamelContext-tp5733512.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
www.camelone.org: The open source integration conference.

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

Mime
View raw message