karaf-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jean-Baptiste Onofré ...@nanthrax.net>
Subject Re: unable to marshal type because it is missing @xmlrootelement annotation
Date Wed, 09 Sep 2015 13:19:03 GMT
I guess this class com.bosch.cdm.dcm.parser.mdx.pojo.MSRSW is yours ;)

As you use JAXB to unmarshall, you have to use the JAXB annotations, at 
least @XmlRootElement on the MSRSW class.

Regards
JB

On 09/09/2015 01:49 PM, abhilashb wrote:
> Hi,
>
> I am able to marshal using jaxb from my standalone application in java.
> When i tried in karaf, i am getting below errors. Please provide me a
> solution
> javax.xml.bind.MarshalException
>   - with linked exception:
> [com.sun.istack.SAXException2: unable to marshal type
> "com.bosch.cdm.dcm.parser.mdx.pojo.MSRSW" as an element because
>   is missing an @XmlRootElement annotation]
>          at
> com.sun.xml.bind.v2.runtime.MarshallerImpl.write(MarshallerImpl.java:318)
>          at
> com.sun.xml.bind.v2.runtime.MarshallerImpl.marshal(MarshallerImpl.java:244)
>          at
> javax.xml.bind.helpers.AbstractMarshallerImpl.marshal(AbstractMarshallerImpl.java:118)
>          at
> com.bosch.cdm.dcm.model.parser.mapper.DcmDxmMapper.mapDcmToDxa(DcmDxmMapper.java:101)
>          at
> com.bosch.service.MServiceManager.execute(MServiceManager.java:137)
>          at com.bosch.manager.MManager.onDataResponse(MManager.java:68)
>          at com.bosch.redis.MRedis.onDataResponse(MRedis.java:134)
>          at
> com.bosch.redis.MRedisSubscriber.onMessage(MRedisSubscriber.java:24)
>          at redis.clients.jedis.JedisPubSub.process(JedisPubSub.java:113)
>          at redis.clients.jedis.JedisPubSub.proceed(JedisPubSub.java:83)
>          at redis.clients.jedis.Jedis.subscribe(Jedis.java:1974)
>          at
> com.bosch.redis.MRedisSubscribeWorker.run(MRedisSubscribeWorker.java:43)
>          at java.lang.Thread.run(Thread.java:745)
>          at
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
>          at
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
>          at java.lang.Thread.run(Thread.java:745)
> Caused by: com.sun.istack.SAXException2: unable to marshal type
> "com.bosch.cdm.dcm.parser.mdx.pojo.MSRSW" as an elemen
> because it is missing an @XmlRootElement annotation
>          at
> com.sun.xml.bind.v2.runtime.XMLSerializer.reportError(XMLSerializer.java:248)
>          at
> com.sun.xml.bind.v2.runtime.ClassBeanInfoImpl.serializeRoot(ClassBeanInfoImpl.java:320)
>          at
> com.sun.xml.bind.v2.runtime.XMLSerializer.childAsRoot(XMLSerializer.java:494)
>          at
> com.sun.xml.bind.v2.runtime.MarshallerImpl.write(MarshallerImpl.java:315)
>          ... 15 more
>
>
>   ID | State  | Lvl | Version  | Name
> ----------------------------------------------------------------------------------
>   84 | Active |  50 | 2.13.2   | camel-core
>   85 | Active |  50 | 2.13.2   | camel-karaf-commands
> 100 | Active |  50 | 1.1.1    | geronimo-jta_1.1_spec
> 101 | Active |  50 | 2.13.2   | camel-spring
> 102 | Active |  50 | 2.13.2   | camel-blueprint
> 103 | Active |  50 | 3.1.0.7  | Apache ServiceMix :: Bundles ::
> commons-httpclient
> 104 | Active |  50 | 1.8.0    | Commons Codec
> 105 | Active |  50 | 1.0      | Servlet 3.0
> 106 | Active |  50 | 2.13.2   | camel-http
> 107 | Active |  50 | 2.13.2   | camel-stream
> 108 | Active |  50 | 3.3.0    | Commons Net
> 109 | Active |  50 | 0.1.50.1 | Apache ServiceMix :: Bundles :: jsch
> 110 | Active |  50 | 2.13.2   | camel-ftp
> 112 | Active |  80 | 2.13.2   | camel-core-osgi
> 640 | Active |  80 |          | mvn:javax.xml.crypto/jsr105-api/1.0.1
> 641 | Active |  80 | 4.4.1    | Apache Apache HttpCore OSGi bundle
> 642 | Active |  80 | 4.4.1    | Apache Apache HttpClient OSGi bundle
> 670 | Active |  80 |          | mvn:com.tunnelvisionlabs/antlr4/4.4
> 688 | Active |  80 |          | mvn:javax.xml.bind/jaxb-api/2.2.6
> 689 | Active |  80 | 1.0.3    | Pearl
> 690 | Active |  80 | 1.0.3    | MyService
>
>
>
> --
> View this message in context: http://karaf.922171.n3.nabble.com/unable-to-marshal-type-because-it-is-missing-xmlrootelement-annotation-tp4042428.html
> Sent from the Karaf - Dev mailing list archive at Nabble.com.
>

-- 
Jean-Baptiste Onofré
jbonofre@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com

Mime
View raw message