While converting csv to xml facing Marshalling Issue-javax.xml.bind.JAXBException, class java.util.ArrayList nor any of its super class is known to this context.

Solution Verified - Updated -

Issue

  • User is getting error when marshalling a list of objects using JAXB.
  • User is trying to convert CSV to XML. So first user converted to java objects using camel-bindy.
  • Then tried to marshall to XML using JAXB, but its getting the error
Caused by: java.io.IOException: javax.xml.bind.JAXBException: class java.util.ArrayList nor any of its super class is known to this context.
    at org.apache.camel.converter.jaxb.JaxbDataFormat.marshal(JaxbDataFormat.java:133)[234:org.apache.camel.camel-jaxb:2.12.0.redhat-610379]
    at org.apache.camel.processor.MarshalProcessor.process(MarshalProcessor.java:81)[145:org.apache.camel.camel-core:2.12.0.redhat-610379]
    at org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:72)[145:org.apache.camel.camel-core:2.12.0.redhat-610379].
  • How to resolve this issue ?

Environment

  • Red Hat JBoss Fuse
    • 6.1.0

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content