2 Replies Latest reply on Apr 26, 2012 6:49 AM by simplex-software

    Data format 'jaxb' could not be created

    simplex-software

      Greetings,

       

      I'm using Camel 2.8.0-fuse-04-01. I got the following RouteBuilder:

       

          JaxbDataFormat jdb = new JaxbDataFormat();

          jdb.setContextPath("com.unic.delimij.integration.jaxb.prod");

          LOGGER.info(">>> DataFormatName: " +jdb.getDataFormatName());

          from("{{product.file.inbox}}).split(body().tokenize("{{product.tokenizer"))

            .streaming().unmarshal(jdb).to("jpa:product");

      Installing the bundle on Karaf raises the following exception:

       

      karaf@root> Exception in thread "SpringOsgiExtenderThread-36" org.apache.camel.RuntimeCamelException: org.apache.camel.FailedToCreateRouteException: Failed to create route route14 at: >>> Split[{token

      ize(body, {{product.tokenizer)} -> [Marshal[org.apache.camel.model.dataformat.JaxbDataFormat@7b750dd2], Bean[ref:testBean]]] <<< in route: Route[[From[{{product.file.inbox}}?preMove=inprogress&move=..

      .. because of Data format 'jaxb' could not be created. Ensure that the data format is valid and the associated Camel component is present on the classpath

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

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

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

              at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.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(AbstractOsgiBundleApplicationContext.java:235)

              at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext$4.run(AbstractDelegatedExecutionApplicationContext.java:358)

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

              at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.completeRefresh(AbstractDelegatedExecutionApplicationContext.java:320)

              at org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor$CompleteRefreshTask.run(DependencyWaiterApplicationContextExecutor.java:132)

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

      Caused by: org.apache.camel.FailedToCreateRouteException: Failed to create route route14 at: >>> Split[{tokenize(body, {{product.tokenizer)} -> [Marshal[org.apache.camel.model.dataformat.JaxbDataForma

      t@7b750dd2], Bean[ref:testBean]]] <<< in route: Route[[From[{{product.file.inbox}}?preMove=inprogress&move=.... because of Data format 'jaxb' could not be created. Ensure that the data format is valid

      and the associated Camel component is present on the classpath

              at org.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:820)

              at org.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:165)

              at org.apache.camel.impl.DefaultCamelContext.startRoute(DefaultCamelContext.java:698)

              at org.apache.camel.impl.DefaultCamelContext.startRouteDefinitions(DefaultCamelContext.java:1696)

              at org.apache.camel.impl.DefaultCamelContext.doStartCamel(DefaultCamelContext.java:1481)

              at org.apache.camel.impl.DefaultCamelContext.doStart(DefaultCamelContext.java:1373)

              at org.apache.camel.spring.SpringCamelContext.doStart(SpringCamelContext.java:169)

              at org.apache.camel.impl.ServiceSupport.start(ServiceSupport.java:67)

              at org.apache.camel.impl.ServiceSupport.start(ServiceSupport.java:54)

              at org.apache.camel.impl.DefaultCamelContext.start(DefaultCamelContext.java:1341)

              at org.apache.camel.spring.SpringCamelContext.maybeStart(SpringCamelContext.java:213)

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

              ... 10 more

      Caused by: java.lang.IllegalArgumentException: Data format 'jaxb' could not be created. Ensure that the data format is valid and the associated Camel component is present on the classpath

              at org.apache.camel.model.DataFormatDefinition.getDataFormat(DataFormatDefinition.java:90)

              at org.apache.camel.model.DataFormatDefinition.getDataFormat(DataFormatDefinition.java:80)

              at org.apache.camel.model.UnmarshalDefinition.createProcessor(UnmarshalDefinition.java:144)

              at org.apache.camel.model.ProcessorDefinition.createOutputsProcessor(ProcessorDefinition.java:385)

              at org.apache.camel.model.ProcessorDefinition.createOutputsProcessor(ProcessorDefinition.java:134)

              at org.apache.camel.impl.DefaultRouteContext.createProcessor(DefaultRouteContext.java:106)

              at org.apache.camel.model.ProcessorDefinition.createChildProcessor(ProcessorDefinition.java:153)

              at org.apache.camel.model.SplitDefinition.createProcessor(SplitDefinition.java:95)

              at org.apache.camel.model.ProcessorDefinition.makeProcessor(ProcessorDefinition.java:430)

              at org.apache.camel.model.ProcessorDefinition.addRoutes(ProcessorDefinition.java:183)

              at org.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:817)

              ... 21 more

       

      What could be wron here ?

       

      Many thanks in advance,

       

      Nicolas