Re: returning xml file content as response

2012-08-14 Thread Claus Ibsen
On Tue, Aug 14, 2012 at 7:51 AM, javakurious javakuri...@gmail.com wrote: Hi I have a very straightforward question.. In my camel config, I am trying to handle exception be returning a static xml response, indicating that there was an error. So, in onException tag, I just send the message

Re: Http4 component throws useless NPE if request body is String (instead of InputStream)

2012-08-14 Thread Claus Ibsen
What version of Camel do you use? On Mon, Aug 13, 2012 at 9:47 PM, pmcb55 mcbenne...@dnb.com wrote: We've been using the Camel HTTP4 component for a while now, but today we wanted to call a HTTP endpoint and pass some text as input to the endpoint. But when we use

problem in aggregation

2012-08-14 Thread vasukfuse
Hi All i have to aggregate two XML files which are available at different times.but i am getting error in out put file. here i am providing my code error details public void configure() { try { DataFormat bindy =

Re: Managing the Camel libraries and Setting up the Camel Classpath

2012-08-14 Thread Christian Schneider
Hi Guru, you can move the camel dependencies to the tomcat classloader so they are available to all wars. Quite often though this leads to problems. For example if you want to update a war file to a newer versionof some libs it can get very complex very soon. So I think you should also look

Re: Managing the Camel libraries and Setting up the Camel Classpath

2012-08-14 Thread Gnanaguru S
Thank you Christian, I was caught up with out of memory error in tomcat. /* SEVERE: Error waiting for multi-thread deployment of WAR files to complete java.util.concurrent.ExecutionException: java.lang.OutOfMemoryError: Java heap space */ *It was resolved by setting up JAVA_OPTS as 128m

Re: Managing the Camel libraries and Setting up the Camel Classpath

2012-08-14 Thread Gnanaguru S
Thanks Henry, I wont go with the thought of Inter WAR. I will get back with a solution once I find it with Tomcat forums. Regards Guru @gnanagurus -- View this message in context:

Re: Managing the Camel libraries and Setting up the Camel Classpath

2012-08-14 Thread Gnanaguru S
Hi Christian, Thanks for your effort of getting this elaborate answer. And gladly I am using Camel seriously with ServiceMix. Karaf provides a great console to manage features, And I love that model. I started with Camel Tomcat to test it, And most Interestingly this issue came up and I

Re: Http4 component throws useless NPE if request body is String (instead of InputStream)

2012-08-14 Thread pmcb55
Hi Claus - we're using the latest version 2.10.0. Simply running the JUnit test I provided should illustrate the problem - the 'System.out.println()' displays 'null' for both the exception description, and the exception cause - not particularly helpful, obviously! Cheers, Pat. -- View this

Re: Managing the Camel libraries and Setting up the Camel Classpath

2012-08-14 Thread Henryk Konsek
you can move the camel dependencies to the tomcat classloader so they are available to all wars. Quite often though this leads to problems. For example if you want to update a war file to a newer versionof some libs it can get very complex very soon. I would say even more - putting

Re: Http4 component throws useless NPE if request body is String (instead of InputStream)

2012-08-14 Thread Willem jiang
You should get the response code from the exception message if the server send the status code back. -- Willem Jiang FuseSource Web: http://www.fusesource.com (http://www.fusesource.com/) Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/) (English)

Using Simple header notation to define where to send a message

2012-08-14 Thread AlanFoster
Hi, I'm wondering if it's possible to define a header to set up where an exchange should be send to, then access it through simple within the to uri. For instance I have one route which sets up what service I need to send a message to. Then the other message sends it to the required service,

Re: Using Simple header notation to define where to send a message

2012-08-14 Thread Claus Ibsen
Hi See the FAQ http://camel.apache.org/how-do-i-use-dynamic-uri-in-to.html On Tue, Aug 14, 2012 at 1:52 PM, AlanFoster a...@alanfoster.me wrote: Hi, I'm wondering if it's possible to define a header to set up where an exchange should be send to, then access it through simple within the to

delay on Exception is not working

2012-08-14 Thread Sri
Hi, I am using camel onException() cluase with redeliveries(3).delay(1000). How ever I can see in the logs that it is retrying but its not considering the delay. Here is my route. onException(RestClient500SeriesException.class)

Re: delay on Exception is not working

2012-08-14 Thread Claus Ibsen
Maybe its the AMQ broker the retrys. Are you sure its Camel, and that the onException is being triggered. We got a zillion tests in camel, so I think its something wrong on your end. On Tue, Aug 14, 2012 at 4:31 PM, Sri sri.tec...@googlemail.com wrote: Hi, I am using camel onException()

Re: Exception in Exchange is null

2012-08-14 Thread Claus Ibsen
The exception is null because you use handled(true). If you want to get the caused exception, then its stored as a property on the exchange. Exception cause = exchange.getProperty(Exchange.CAUGHT_EXCEPTION, Exception.class); On Tue, Aug 14, 2012 at 4:35 PM, Hilde hilde.sch...@yahoo.de wrote:

Re: delay on Exception is not working

2012-08-14 Thread Sri
is there any other way that I can use delay , I am trying to use redelivery policy and I am using spring java Configuration for instatiating beans @Bean RedeliveryPolicy dispatcherRedeliveryPolicy(){ return policy; }

Re: Exception in Exchange is null

2012-08-14 Thread Hilde
Thanks you Claus, but I have just checked that the exception object is still null even though handled(false) [default]. -- View this message in context: http://camel.465427.n5.nabble.com/Exception-in-Exchange-is-null-tp5717324p5717329.html Sent from the Camel - Users mailing list archive at

Re: Exception in Exchange is null

2012-08-14 Thread Claus Ibsen
On Tue, Aug 14, 2012 at 4:58 PM, Hilde hilde.sch...@yahoo.de wrote: Thanks you Claus, but I have just checked that the exception object is still null even though handled(false) [default]. Yeah its null in both situations, as the error handler is kicking in. handled = false, just mean that when

Is this routing behaviour as expected?

2012-08-14 Thread Babak Vahdat
Hi I'm still a bit confused regarding a question by another thread and would like to ask you about the point I'm missing here. The following test passes (e.g. using the trunk code or 2.10.0 release) which I can follow and understand: public class TwoRoutesTest extends CamelTestSupport {

Re: delay on Exception is not working

2012-08-14 Thread Sri
Its redeliveryDelay() on Exception not delay() the following routes works onException(RestClient500SeriesException.class) .maximumRedeliveries(retries).redeliveryDelay(retryDelay)

Re: Exception in Exchange is null

2012-08-14 Thread Hilde
Thanks for you patient. Could you please give me some advice how we can log the stack trace subsequently? We are using the camel log component after the exchange was gone through JMS: log:errorLog?level=ERRORshowAll=truemultiline=trueshowStackTrace=true However the output inside the file looks

Re: Exception in Exchange is null

2012-08-14 Thread Claus Ibsen
Hi The log component has many options http://camel.apache.org/log See the showCaughtException option. On Tue, Aug 14, 2012 at 5:28 PM, Hilde hilde.sch...@yahoo.de wrote: Thanks for you patient. Could you please give me some advice how we can log the stack trace subsequently? We are using

Re: Is this routing behaviour as expected?

2012-08-14 Thread Raul Kripalani
Yes, it is working as expected. If you don't set a custom Aggregation Strategy on the Splitter, as of Camel 2.3, it will return the original body by default. Regards, *Raúl Kripalani* *Principal Consultant | FuseSource Corp. r...@fusesource.com | fusesource.com http://www.fusesource.com/ skype:

JSON - Jackson return list rather than POJO

2012-08-14 Thread ychawla
Hello All, I am unmarshalling data using Jackson. My dataFormats bean is set up as such: dataFormats json id=personSearchJacksonID library=Jackson unmarshalTypeName=model.PersonSearchResponse/ /dataFormats However, my return value isn't a simple POJO, it is a list of

Re: Using Simple header notation to define where to send a message

2012-08-14 Thread ychawla
Hello, You can also try using a recipient list and only have a single recipient on it. It can function as a dynamic router when you dynamically set a header. Thanks, Yogesh -- View this message in context:

Re: Is this routing behaviour as expected?

2012-08-14 Thread Babak Vahdat
Am 14.08.12 19:45 schrieb Raul Kripalani unter r...@fusesource.com: Yes, it is working as expected. If you don't set a custom Aggregation Strategy on the Splitter, as of Camel 2.3, it will return the original body by default. Thanks for the clarification, which I missed by the Splitter

Re: exposing different operations under same service in camel + cxf routing.

2012-08-14 Thread anupamsen
http://camel.465427.n5.nabble.com/file/n5717345/camel-example-cxf-proxy.rar camel-example-cxf-proxy.rar Hi There, Thanks for the reply. My goal is to expose a WS as an endpoint in Camel-CXF and based on the WS operation triggered by an external WS consumer I need to trigger the route/workflow. I

Re: exposing different operations under same service in camel + cxf routing.

2012-08-14 Thread ychawla
Hi, Have you tried turning on the tracer to see what headers are on your exchange? A simple filter such as this should work: camel:filter camel:simple${in.headers.operationName} == 'SearchRequest'/camel:simple

Re: JSON - Jackson return list rather than POJO

2012-08-14 Thread ychawla
A simple workaround for this is a custom bean processor like so: public void processPersonSearchResponseJSON(Exchange exchange) throws JsonParseException, JsonMappingException, IOException { ObjectMapper mapper = new ObjectMapper();

Re: problem in aggregation

2012-08-14 Thread ychawla
Hi, Can you add some debug statements to your aggregator: newIn.setBody(oldBody + newBody); For example, what is oldBody and what is newBody? Based on the error you are receiving, you might be concatenating two XML documents like this: document1/ document2/ This will not create a

Proof of concept for Camel Web Interface

2012-08-14 Thread helander
Hi, I would like to share with anyone interested a prototype I have made for a Web interface to Camel. It is based on Jolokia (http://jolikia.org) which is a JMX agent that provides access via http. Along with jolokia comes client interface libraries for Javascript and Java. The Jolokia agent is

Unit test failing onException clause

2012-08-14 Thread Sri
Hi , I have a route with OnException, when I try to create unit test for the route it actually faliling and saying it does not find any route java.lang.IllegalArgumentException: There are no outputs which matches: ProcessorDefinition in the route: Route[[From[activemq:queue:dispatch]] -

Re: Is this routing behaviour as expected?

2012-08-14 Thread Babak Vahdat
For other users who maybe interested it's documented here: http://camel.apache.org/splitter.html#Splitter-WhattheSplitterreturns And the corresponding JIRA: https://issues.apache.org/jira/browse/CAMEL-2682 Babak Am 14.08.12 20:57 schrieb Babak Vahdat unter babak.vah...@swissonline.ch: Am

Multiple paramater with cxf:end point

2012-08-14 Thread camelraj
Hi, I am developing some camel , here is my camel context. Pls let me know how can I configure the parameter if I want to call 'complexParameters' which has two parameter. cxf:cxfEndpoint id=routerEndpoint address=http://localhost:8080/test-service/TestService; serviceClass=service.TestService/

cxfrs: GET and POST handling in bean

2012-08-14 Thread paramjyotsingh
I am trying to expose restful service using camel:cxfrs cxf:rsServer address=http://localhost:8080; id=rsServer serviceClass=mypackage.ServiceClass/ bean id=serviceBean class=mypackage.Servicebean/ camel:from uri=cxfrs://bean://rsServer/ camel:bean ref=serviceBean/ @Path(/path) public class

Re: Exception in Exchange is null

2012-08-14 Thread Hilde
Thanks, as I can read the camel log component exists in the first place to log out the exchange object and not to log stack traces. -- View this message in context: http://camel.465427.n5.nabble.com/Exception-in-Exchange-is-null-tp5717324p5717337.html Sent from the Camel - Users mailing list

Re: Unit test failing onException clause

2012-08-14 Thread Babak Vahdat
Hi you should do: weaveByType(ProcessDefinition.class) instead of: weaveByType(ProcessorDefinition.class) Babak -- View this message in context: http://camel.465427.n5.nabble.com/Unit-test-failing-onException-clause-tp5717350p5717356.html Sent from the Camel - Users mailing list

Re: Splitter + aggregator + dynamic timeout

2012-08-14 Thread Babak Vahdat
Hi I WAS WRONG with my bug assumption, see the answer here: http://camel.465427.n5.nabble.com/Is-this-routing-behaviour-as-expected-td5717331.html Sorry for the noise confusion. Babak Aleksander Pena wrote Henryk, thanks for another way of resolving my requirements it works perfectly

Re: cxfrs: GET and POST handling in bean

2012-08-14 Thread Willem jiang
Hi, You can find the same example here[1], basic camel-cxfrs consumer just put the operation name and invocation parameters into the message, camel route can do the transformation as you want. If you just want to use bean to provide the service, you can use CXF directly.

Re: Multiple paramater with cxf:end point

2012-08-14 Thread Willem jiang
If you want camel-cxf producer invoke the service with this two parameter, you can put the parameter into a list like this ListObject parameterList = new ArrayList(); parameterList.add(part1); parameterList.add(part2); Then you just need to put the parameterList into the message body. --

Re: cxfrs: GET and POST handling in bean

2012-08-14 Thread paramjyotsingh
Is it not possible to handle it somehow in camel routes. Is there any way Camel identifies the request type like GET, POST, PUT or DELETE as we have for restful service and invoke the annotated method. I know i can use JAX-RS to handle calls to implementation bean, but is it possible to have