Add after the <from>

<transform><simple>${body[0]}</simple></transform>

To grab the data out of the CXF MessageContextList holder object


On Mon, Sep 23, 2013 at 1:15 PM, vsmahesh <aneesh_...@yahoo.co.in> wrote:
> Hi all,
> When I am trying to marshall incoming POJO in cxf .I am getting the *class
> org.apache.cxf.message.MessageContentsList nor any of its super class is
> known to this context.* error.
>
> My camel Route is like this,
> <camelContext xmlns="http://camel.apache.org/schema/spring";>
> <dataFormats>
>                         <jaxb id="input" prettyPrint="true"
> contextPath="com.abcd.mes.bw.energyconsumption"
>                                 
> partClass="com.abcd.mes.bw.energyconsumption.Details" />
>
> </dataFormats>
>     <redeliveryPolicyProfile redeliveryDelay="25" maximumRedeliveries="3"
> id="sapRedelivery"/>
>     <route id="MES_to_InboundQUEUE">
>         <from uri="cxf:bean:PowerConsumptionEndpoint"/>
>         <marshal ref="input"/>
>     <to uri="activemq:queue:EC_InboundQueue"/>
>
>     </route>
>
> The Details.java file is like
>
> package com.abcd.mes.bw.energyconsumption;
> import java.util.ArrayList;
> import java.util.List;
> import javax.xml.bind.annotation.XmlAccessType;
> import javax.xml.bind.annotation.XmlAccessorType;
> import javax.xml.bind.annotation.XmlElement;
> import javax.xml.bind.annotation.XmlRootElement;
> import javax.xml.bind.annotation.XmlSchemaType;
> import javax.xml.bind.annotation.XmlType;
> import javax.xml.datatype.XMLGregorianCalendar;
>
> @XmlAccessorType(XmlAccessType.FIELD)
> @XmlType(name = "", propOrder = {
>     "dateTime",
>     "plantID",
>     "plantName",
>     "powerConsumed",
>     "units",
>     "targetValue",
>     "plannedValue",
>     "sysDateTime",
>     "updatedby"
> })
> @XmlRootElement(name="Details")
> public class Details {
>
>          @XmlElement(name = "Date_Time")
>      @XmlSchemaType(name = "dateTime")
>      protected XMLGregorianCalendar dateTime;
>      @XmlElement(name = "Plant_ID")
>      protected String plantID;
>      @XmlElement(name = "Plant_Name")
>      protected String plantName;
>      @XmlElement(name = "Power_consumed")
>      protected String powerConsumed;
>      @XmlElement(name = "Units")
>      protected String units;
>      @XmlElement(name = "TargetValue")
>      protected String targetValue;
>      @XmlElement(name = "PlannedValue")
>      protected String plannedValue;
>      @XmlElement(name = "Sys_DateTime")
>      @XmlSchemaType(name = "dateTime")
>      protected XMLGregorianCalendar sysDateTime;
>      @XmlElement(name = "Updatedby")
>      protected String updatedby;
>
>      /**
>       * Gets the value of the dateTime property.
>       *
>       * @return
>       *     possible object is
>       *     {@link XMLGregorianCalendar }
>       *
>       */
>      public XMLGregorianCalendar getDateTime() {
>          return dateTime;
>      }
>
>      /**
>       * Sets the value of the dateTime property.
>       *
>       * @param value
>       *     allowed object is
>       *     {@link XMLGregorianCalendar }
>       *
>       */
>      public void setDateTime(XMLGregorianCalendar value) {
>          this.dateTime = value;
>      }
>
>      /**
>       * Gets the value of the plantID property.
>       *
>       * @return
>       *     possible object is
>       *     {@link String }
>       *
>       */
>      public String getPlantID() {
>          return plantID;
>      }
>
>      /**
>       * Sets the value of the plantID property.
>       *
>       * @param value
>       *     allowed object is
>       *     {@link String }
>       *
>       */
>      public void setPlantID(String value) {
>          this.plantID = value;
>      }
>
>      /**
>       * Gets the value of the plantName property.
>       *
>       * @return
>       *     possible object is
>       *     {@link String }
>       *
>       */
>      public String getPlantName() {
>          return plantName;
>      }
>
>      /**
>       * Sets the value of the plantName property.
>       *
>       * @param value
>       *     allowed object is
>       *     {@link String }
>       *
>       */
>      public void setPlantName(String value) {
>          this.plantName = value;
>      }
>
>      /**
>       * Gets the value of the powerConsumed property.
>       *
>       * @return
>       *     possible object is
>       *     {@link String }
>       *
>       */
>      public String getPowerConsumed() {
>          return powerConsumed;
>      }
>
>      /**
>       * Sets the value of the powerConsumed property.
>       *
>       * @param value
>       *     allowed object is
>       *     {@link String }
>       *
>       */
>      public void setPowerConsumed(String value) {
>          this.powerConsumed = value;
>      }
>
>      /**
>       * Gets the value of the units property.
>       *
>       * @return
>       *     possible object is
>       *     {@link String }
>       *
>       */
>      public String getUnits() {
>          return units;
>      }
>
>      /**
>       * Sets the value of the units property.
>       *
>       * @param value
>       *     allowed object is
>       *     {@link String }
>       *
>       */
>      public void setUnits(String value) {
>          this.units = value;
>      }
>
>      /**
>       * Gets the value of the targetValue property.
>       *
>       * @return
>       *     possible object is
>       *     {@link String }
>       *
>       */
>      public String getTargetValue() {
>          return targetValue;
>      }
>
>      /**
>       * Sets the value of the targetValue property.
>       *
>       * @param value
>       *     allowed object is
>       *     {@link String }
>       *
>       */
>      public void setTargetValue(String value) {
>          this.targetValue = value;
>      }
>
>      /**
>       * Gets the value of the plannedValue property.
>       *
>       * @return
>       *     possible object is
>       *     {@link String }
>       *
>       */
>      public String getPlannedValue() {
>          return plannedValue;
>      }
>
>      /**
>       * Sets the value of the plannedValue property.
>       *
>       * @param value
>       *     allowed object is
>       *     {@link String }
>       *
>       */
>      public void setPlannedValue(String value) {
>          this.plannedValue = value;
>      }
>
>      /**
>       * Gets the value of the sysDateTime property.
>       *
>       * @return
>       *     possible object is
>       *     {@link XMLGregorianCalendar }
>       *
>       */
>      public XMLGregorianCalendar getSysDateTime() {
>          return sysDateTime;
>      }
>
>      /**
>       * Sets the value of the sysDateTime property.
>       *
>       * @param value
>       *     allowed object is
>       *     {@link XMLGregorianCalendar }
>       *
>       */
>      public void setSysDateTime(XMLGregorianCalendar value) {
>          this.sysDateTime = value;
>      }
>
>      /**
>       * Gets the value of the updatedby property.
>       *
>       * @return
>       *     possible object is
>       *     {@link String }
>       *
>       */
>      public String getUpdatedby() {
>          return updatedby;
>      }
>
>      /**
>       * Sets the value of the updatedby property.
>       *
>       * @param value
>       *     allowed object is
>       *     {@link String }
>       *
>       */
>      public void setUpdatedby(String value) {
>          this.updatedby = value;
>      }
>
>  }
>
>
> The soap message which i am sening from the SOAPuI is like this
>
> <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/";
> xmlns:urn="urn:outotec:pi:mes:id59:PowerConsumption">
>    <soapenv:Header/>
>    <soapenv:Body>
>       <ns2:MT_PowerConsumption
> xmlns:ns2="urn:abcd:pi:mes:id59:PowerConsumption"
> xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/";>
>  <Details>
>   <Date_Time>2013-07-01T07:27:03.6124567+03:00</Date_Time>
>   <Plant_ID>12</Plant_ID>
>   <Plant_Name>aa</Plant_Name>
>   <Power_consumed>12</Power_consumed>
>   <Units>watts</Units>
>   <TargetValue>12</TargetValue>
>   <PlannedValue>12</PlannedValue>
>   <Sys_DateTime>2013-07-01T07:27:03.6124567+03:00</Sys_DateTime>
>   <Updatedby>12</Updatedby>
>   </Details>
>   </ns2:MT_PowerConsumption>
>    </soapenv:Body>
> </soapenv:Envelope>
>
>
> The error generated is
>
> Java.io.IOException: javax.xml.bind.JAXBException: class
> org.apache.cxf.message.MessageContentsList nor any of its super class is
> known to this context.
>         at
> org.apache.camel.converter.jaxb.JaxbDataFormat.marshal(JaxbDataFormat.java:103)[236:org.apache.camel.camel-jaxb:2.10.0.fuse-71-047]
>         at
> org.apache.camel.processor.MarshalProcessor.process(MarshalProcessor.java:59)[147:org.apache.camel.camel-core:2.10.0.fuse-71-047]
>         at
> org.apache.camel.util.AsyncProcessorConverterHelper$ProcessorToAsyncProcessorBridge.process(AsyncProcessorConverterHelper.java:61)[147:org.apache.camel.camel-core:2.10.0.fuse-71-047]
>         at
> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)[147:org.apache.camel.camel-core:2.10.0.fuse-71-047]
>         at
> org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99)[147:org.apache.camel.camel-core:2.10.0.fuse-71-047]
>         at
> org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)[147:org.apache.camel.camel-core:2.10.0.fuse-71-047]
>         at
> org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:73)[147:org.apache.camel.camel-core:2.10.0.fuse-71-047]
>         at
> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)[147:org.apache.camel.camel-core:2.10.0.fuse-71-047]
>         at
> org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99)[147:org.apache.camel.camel-core:2.10.0.fuse-71-047]
>         at
> org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)[147:org.apache.camel.camel-core:2.10.0.fuse-71-047]
>         at
> org.apache.camel.processor.interceptor.TraceInterceptor.process(TraceInterceptor.java:91)[147:org.apache.camel.camel-core:2.10.0.fuse-71-047]
>         at
> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)[147:org.apache.camel.camel-core:2.10.0.fuse-71-047]
>         at
> org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99)[147:org.apache.camel.camel-core:2.10.0.fuse-71-047]
>         at
> org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)[147:org.apache.camel.camel-core:2.10.0.fuse-71-047]
>         at
> org.apache.camel.fabric.FabricTraceProcessor.process(FabricTraceProcessor.java:81)[147:org.apache.camel.camel-core:2.10.0.fuse-71-047]
>         at
> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)[147:org.apache.camel.camel-core:2.10.0.fuse-71-047]
>         at
> org.apache.camel.processor.RedeliveryErrorHandler.processErrorHandler(RedeliveryErrorHandler.java:334)[147:org.apache.camel.camel-core:2.10.0.fuse-71-047]
>         at
> org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:220)[147:org.apache.camel.camel-core:2.10.0.fuse-71-047]
>         at
> org.apache.camel.processor.RouteContextProcessor.processNext(RouteContextProcessor.java:45)[147:org.apache.camel.camel-core:2.10.0.fuse-71-047]
>         at
> org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)[147:org.apache.camel.camel-core:2.10.0.fuse-71-047]
>         at
> org.apache.camel.processor.interceptor.DefaultChannel.process(DefaultChannel.java:303)[147:org.apache.camel.camel-core:2.10.0.fuse-71-047]
>         at
> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)[147:org.apache.camel.camel-core:2.10.0.fuse-71-047]
>         at
> org.apache.camel.processor.Pipeline.process(Pipeline.java:117)[147:org.apache.camel.camel-core:2.10.0.fuse-71-047]
>         at
> org.apache.camel.processor.Pipeline.process(Pipeline.java:80)[147:org.apache.camel.camel-core:2.10.0.fuse-71-047]
>         at
> org.apache.camel.processor.RouteContextProcessor.processNext(RouteContextProcessor.java:45)[147:org.apache.camel.camel-core:2.10.0.fuse-71-047]
>         at
> org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)[147:org.apache.camel.camel-core:2.10.0.fuse-71-047]
>         at
> org.apache.camel.processor.UnitOfWorkProcessor.processAsync(UnitOfWorkProcessor.java:150)[147:org.apache.camel.camel-core:2.10.0.fuse-71-047]
>         at
> org.apache.camel.processor.UnitOfWorkProcessor.process(UnitOfWorkProcessor.java:117)[147:org.apache.camel.camel-core:2.10.0.fuse-71-047]
>         at
> org.apache.camel.processor.RouteInflightRepositoryProcessor.processNext(RouteInflightRepositoryProcessor.java:48)[147:org.apache.camel.camel-core:2.10.0.fuse-71-047]
>         at
> org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)[147:org.apache.camel.camel-core:2.10.0.fuse-71-047]
>         at
> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)[147:org.apache.camel.camel-core:2.10.0.fuse-71-047]
>         at
> org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99)[147:org.apache.camel.camel-core:2.10.0.fuse-71-047]
>         at
> org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)[147:org.apache.camel.camel-core:2.10.0.fuse-71-047]
>         at
> org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:73)[147:org.apache.camel.camel-core:2.10.0.fuse-71-047]
>         at
> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:99)[147:org.apache.camel.camel-core:2.10.0.fuse-71-047]
>         at
> org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:86)[147:org.apache.camel.camel-core:2.10.0.fuse-71-047]
>         at
> org.apache.camel.component.cxf.CxfConsumer$1.syncInvoke(CxfConsumer.java:125)[211:org.apache.camel.camel-cxf:2.10.0.fuse-71-047]
>         at
> org.apache.camel.component.cxf.CxfConsumer$1.invoke(CxfConsumer.java:75)[211:org.apache.camel.camel-cxf:2.10.0.fuse-71-047]
>         at
> org.apache.cxf.interceptor.ServiceInvokerInterceptor$1.run(ServiceInvokerInterceptor.java:58)[169:org.apache.cxf.cxf-api:2.6.0.fuse-71-047]
>         at java.util.concurrent.Executors$RunnableAdapter.call(Unknown
> Source)[:1.6.0_45]
>         at java.util.concurrent.FutureTask$Sync.innerRun(Unknown 
> Source)[:1.6.0_45]
>         at java.util.concurrent.FutureTask.run(Unknown Source)[:1.6.0_45]
>         at
> org.apache.cxf.workqueue.SynchronousExecutor.execute(SynchronousExecutor.java:37)[169:org.apache.cxf.cxf-api:2.6.0.fuse-71-047]
>         at
> org.apache.cxf.interceptor.ServiceInvokerInterceptor.handleMessage(ServiceInvokerInterceptor.java:107)[169:org.apache.cxf.cxf-api:2.6.0.fuse-71-047]
>         at
> org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:262)[169:org.apache.cxf.cxf-api:2.6.0.fuse-71-047]
>         at
> org.apache.cxf.phase.PhaseInterceptorChain.resume(PhaseInterceptorChain.java:231)[169:org.apache.cxf.cxf-api:2.6.0.fuse-71-047]
>         at
> org.apache.cxf.interceptor.OneWayProcessorInterceptor$1.run(OneWayProcessorInterceptor.java:144)[169:org.apache.cxf.cxf-api:2.6.0.fuse-71-047]
>         at
> org.apache.cxf.workqueue.AutomaticWorkQueueImpl$3.run(AutomaticWorkQueueImpl.java:426)[169:org.apache.cxf.cxf-api:2.6.0.fuse-71-047]
>         at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown
> Source)[:1.6.0_45]
>         at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown
> Source)[:1.6.0_45]
>         at
> org.apache.cxf.workqueue.AutomaticWorkQueueImpl$AWQThreadFactory$1.run(AutomaticWorkQueueImpl.java:351)[169:org.apache.cxf.cxf-api:2.6.0.fuse-71-047]
>         at java.lang.Thread.run(Unknown Source)[:1.6.0_45]
> Caused by: javax.xml.bind.JAXBException: class
> org.apache.cxf.message.MessageContentsList nor any of its super class is
> known to this context.
>         at
> com.sun.xml.bind.v2.runtime.JAXBContextImpl.getBeanInfo(JAXBContextImpl.java:594)[158:org.apache.servicemix.bundles.jaxb-impl:2.2.1.1_2]
>         at
> com.sun.xml.bind.v2.runtime.XMLSerializer.childAsRoot(XMLSerializer.java:482)[158:org.apache.servicemix.bundles.jaxb-impl:2.2.1.1_2]
>         at
> com.sun.xml.bind.v2.runtime.MarshallerImpl.write(MarshallerImpl.java:315)[158:org.apache.servicemix.bundles.jaxb-impl:2.2.1.1_2]
>         at
> com.sun.xml.bind.v2.runtime.MarshallerImpl.marshal(MarshallerImpl.java:244)[158:org.apache.servicemix.bundles.jaxb-impl:2.2.1.1_2]
>         at
> javax.xml.bind.helpers.AbstractMarshallerImpl.marshal(AbstractMarshallerImpl.java:74)[:2.0.0.fuse-71-047]
>         at
> org.apache.camel.converter.jaxb.JaxbDataFormat.marshal(JaxbDataFormat.java:120)[236:org.apache.camel.camel-jaxb:2.10.0.fuse-71-047]
>         at
> org.apache.camel.converter.jaxb.JaxbDataFormat.marshal(JaxbDataFormat.java:100)[236:org.apache.camel.camel-jaxb:2.10.0.fuse-71-047]
>
>
> Thanks,
> Mahesh
>
>
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/Getting-error-while-marshalling-class-org-apache-cxf-message-MessageContentsList-nor-any-of-its-supe-tp5740061.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
Red Hat, Inc.
Email: cib...@redhat.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen

Reply via email to