File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Other Open Source Projects and the fly likes Using org.apache.camel.Exchange Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Other Open Source Projects
Bookmark "Using org.apache.camel.Exchange" Watch "Using org.apache.camel.Exchange" New topic

Using org.apache.camel.Exchange

Claire Chan Myae

Joined: Nov 21, 2013
Posts: 8

I used org.apache.camel.Exchange to modify my body but I got following error:

Initialization of bean failed; nested exception is java.lang.NoClassDefFoundError: org/apache/camel/Exchange

is there something I still need to define or add jar before I used Exchange?

Bill Gorder

Joined: Mar 07, 2010
Posts: 1682

Welcome to the Ranch!

This question is not really about Spring so I will move it for you. However at first glance it appears the library with the class you having issue with is camel-core. Also make sure that all of your camel jars are the same version.

[How To Ask Questions][Read before you PM me]
Claire Chan Myae

Joined: Nov 21, 2013
Posts: 8

Thank you for the pointer. Following is my java using exchange to modify message body of a file.

package com.beans.test;

import org.apache.camel.Exchange;

public class ProcessHeader {
public void processExchange(Exchange exchange) {
// Do whatever you like to 'exchange'...
exchange.getIn().setBody("Here is a new message body!");

I have added jar name camel-core-2.10.0.redhat-60024.jar but no luck the problem is still exist. how do i resloved this.

Do I have to add

I agree. Here's the link:
subject: Using org.apache.camel.Exchange
It's not a secret anymore!