Hello,
I am using maven and this are the dependencies:

                <dependency>
                        <groupId>org.apache.camel</groupId>
                        <artifactId>camel-spring</artifactId>
                        <version>2.4.0</version>
                </dependency>

                <dependency>
                        <groupId>org.apache.camel</groupId>
                        <artifactId>camel-jms</artifactId>
                        <version>2.4.0</version>
                </dependency>
                
                <dependency>
                        <groupId>org.apache.camel</groupId>
                        <artifactId>camel-jaxb</artifactId>
                        <version>2.4.0</version>
                </dependency>

I am still getting this error. Maybe I am missing something on how Jaxb is
supposed to work for Camel.

This is my route (verbatim)

                <route>
                        <from uri="amq:queue:event.x" />
                        <unmarshal>
                                <jaxb prettyPrint="true" 
contextPath="test.integration.dto" />
                        </unmarshal>
                        <marshal>
                                <jaxb prettyPrint="true" 
contextPath="test.integration.dto" />
                        </marshal>
                        <to uri="amq:queue:event.y" />
                </route>

This is the my class that I want to marshall, unmarshall:

package test.integration.dto;

import java.io.Serializable;

import javax.xml.bind.annotation.XmlRootElement;
 
@XmlRootElement
public class Event implements Serializable {
    String type;
    String user;
    String system;
    
    public String getType() {
        return type;
    }
    public void setType(String type) {
        this.type = type;
    }
    public String getUser() {
        return user;
    }
    public void setUser(String user) {
        this.user = user;
    }
    public String getSystem() {
        return system;
    }
    public void setSystem(String system) {
        this.system = system;
    } 
}

That is all the config I have done. Does anyone see any problems with that?
I send a JMS message to event.x

<Event/>

is the content of the JMS message. I am hoping that it will unmarshall that
into an Event pojo (above, annotated). Then marshal it back into xml. I
still get the DataFormat error:

Caused by: java.io.IOException: "test.integration.dto" doesnt contain
ObjectFactory.class or jaxb.index

Thanks for all the responses!



-- 
View this message in context: 
http://camel.465427.n5.nabble.com/JAXB-Unmarshalling-DataFormat-error-suggestions-tp2814620p2835310.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Reply via email to