updload server multipart
hi a client post a http/multipart file to my camel server how handle and store it on the server side with camel 2.3.0 ? thx bruno -- View this message in context: http://old.nabble.com/updload-server-multipart-tp28853525p28853525.html Sent from the Camel - Users mailing list archive at Nabble.com.
Re: updload server multipart
hi willem thx , that s what i want to code and for the the other side, the client get the audio file ? is it handle by jetty as a static file ? how to setup static file with camel-jetty ? i am very glad with camel for our project, very good job Regards Bruno willem.jiang wrote: > > Hi, > > Here is an unit test[1] that you can take a look. > > [1]https://svn.apache.org/repos/asf/camel/trunk/components/camel-jetty/src/test/java/org/apache/camel/component/jetty/MultiPartFormTest.java > > Willem > Tapdur wrote: >> hi >> a client post a http/multipart file to my camel server >> how handle and store it on the server side with camel 2.3.0 ? >> thx >> bruno > > > -- View this message in context: http://old.nabble.com/updload-server-multipart-tp28853525p28857068.html Sent from the Camel - Users mailing list archive at Nabble.com.
Re: updload server multipart
hi willem, any chance that s work in 2.3.0 ? i saw a comment in our source code that works nicely in 2.4.0 However the 2.4.0 is not available and i need this feature before wenesday. Regards Bruno Tapdur wrote: > > hi willem > > thx , that s what i want to code > > and for the the other side, the client get the audio file ? is it handle > by jetty as a static file ? how to setup static file with camel-jetty ? > > i am very glad with camel for our project, very good job > > > Regards > Bruno > > willem.jiang wrote: >> >> Hi, >> >> Here is an unit test[1] that you can take a look. >> >> [1]https://svn.apache.org/repos/asf/camel/trunk/components/camel-jetty/src/test/java/org/apache/camel/component/jetty/MultiPartFormTest.java >> >> Willem >> Tapdur wrote: >>> hi >>> a client post a http/multipart file to my camel server >>> how handle and store it on the server side with camel 2.3.0 ? >>> thx >>> bruno >> >> >> > > -- View this message in context: http://old.nabble.com/updload-server-multipart-tp28853525p28879898.html Sent from the Camel - Users mailing list archive at Nabble.com.
Re: updload server multipart
we have this class cast exception with 2.3.0 :jetty-7.0.1.v20091125 2010-06-14 16:11:40.625:WARN::FAILED org.eclipse.jetty.servlets.MultiPartFilter: java.lang.ClassCastException: java.lang.String cannot be cast to java.io.File 2010-06-14 16:11:40.625:WARN::FAILED servletcontexthand...@16a9b9c@16a9b9c/,null: java.lang.ClassCastException: java.lang.String cannot be cast to java.io.File 2010-06-14 16:11:40.625:WARN::Error starting handlers with your test java code Regards willem.jiang wrote: > > Hi, > > Here is an unit test[1] that you can take a look. > > [1]https://svn.apache.org/repos/asf/camel/trunk/components/camel-jetty/src/test/java/org/apache/camel/component/jetty/MultiPartFormTest.java > > Willem > Tapdur wrote: >> hi >> a client post a http/multipart file to my camel server >> how handle and store it on the server side with camel 2.3.0 ? >> thx >> bruno > > > -- View this message in context: http://old.nabble.com/updload-server-multipart-tp28853525p28880090.html Sent from the Camel - Users mailing list archive at Nabble.com.
Re: updload server multipart
hi willem we tried to updload in an other way but in lost, i think the is an other bug : (in a .processor(...) { HttpMessage msg = (HttpMessage) exchange.getIn(); HttpServletRequest request = msg.getRequest(); boolean isMultipart = ServletFileUpload.isMultipartContent(request); String messageFileName = null; if (isMultipart) { // Create a new file upload handler ServletFileUpload upload = new ServletFileUpload(); // Parse the request FileItemIterator iter = upload.getItemIterator(request); the iter returned by upload.getItemIterator() is null. what do you think Regards Bruno willem.jiang wrote: > > Hi Bruno, > > I'm sorry, I just found the ClassCastException when I replied your > letter, so the patch is fresh. > I'm afraid you have to apply the patch[1] to CAMEL-2.3.0 yourself, > otherwise you have to wait for the CAMEL 2.4.0 release. > > [1] https://issues.apache.org/activemq/browse/CAMEL-2806 > > Willem > > Tapdur wrote: >> we have this class cast exception with 2.3.0 >> >> >> :jetty-7.0.1.v20091125 >> 2010-06-14 16:11:40.625:WARN::FAILED >> org.eclipse.jetty.servlets.MultiPartFilter: java.lang.ClassCastException: >> java.lang.String cannot be cast to java.io.File >> 2010-06-14 16:11:40.625:WARN::FAILED >> servletcontexthand...@16a9b9c@16a9b9c/,null: >> java.lang.ClassCastException: >> java.lang.String cannot be cast to java.io.File >> 2010-06-14 16:11:40.625:WARN::Error starting handlers >> >> with your test java code >> >> >> Regards >> >> >> >> willem.jiang wrote: >>> Hi, >>> >>> Here is an unit test[1] that you can take a look. >>> >>> [1]https://svn.apache.org/repos/asf/camel/trunk/components/camel-jetty/src/test/java/org/apache/camel/component/jetty/MultiPartFormTest.java >>> >>> Willem >>> Tapdur wrote: >>>> hi >>>> a client post a http/multipart file to my camel server >>>> how handle and store it on the server side with camel 2.3.0 ? >>>> thx >>>> bruno >>> >>> >> > > > -- View this message in context: http://old.nabble.com/updload-server-multipart-tp28853525p28896486.html Sent from the Camel - Users mailing list archive at Nabble.com.
generic cxf rest consumer
Hi, i am a newbie on camel and i want to use camel and cxfrs in a generic maner between protocol and processeur (i don't want to glue the service to the rest uri). i want something like this http://camel.apache.org/schema/spring";> http://localhost:9000/poc.camel.enabler-0.0.1-SNAPSHOT/greeting"/> the initial request is something like that (via SOAPUI) post http://localhost:9000/poc.camel.enabler-0.0.1-SNAPSHOT/greeting tapdur and i want the body logs in the log file via a route: so is it possible to declare a generic rest camel consumer that get the rest body to the current camel route ? Thx -- View this message in context: http://old.nabble.com/generic-cxf-rest-consumer-tp27452217p27452217.html Sent from the Camel - Users mailing list archive at Nabble.com.
cxfrs improvment
hi the comunity i have a question on the cxf improvment, why do we need to provide a bean service to put an Exchange message to a camel route ? as we only need on reception of http request to put a message with the headers and the body to a camel route ? is it a 2.2.0 feature ? if already in the trunk how wich is the generic consumer component ? Thx Bruno -- View this message in context: http://old.nabble.com/cxfrs-improvment-tp27493187p27493187.html Sent from the Camel - Users mailing list archive at Nabble.com.
Restlet in a webapp
hi i am trying to use camel-restlet component in a jonas/tomcat j2ee. i am getting mad with restlet depencies, does someone has alreday did that ? i use dependecies org.restlet and org.restlet.ext.servlet (and declare the RestletServlet in the web.xml) how to integrate Restlet servlet to camel ? via spring ? but at deploy time i always have the camel error msg : adress already bind in JVM. Thx Bruno -- View this message in context: http://old.nabble.com/Restlet-in-a-webapp-tp27502117p27502117.html Sent from the Camel - Users mailing list archive at Nabble.com.
Re: Restlet in a webapp
hi willem i try but in loss 2010-02-09 10:14:29,131 : DefaultPollingConsumerPollStrategy.rollback : Consumer Consumer[http://localhost:9002/poc.camel.enabler-0.0.1-SNAPSHOT/greeting] could not poll endpoint: http://localhost:9002/poc.camel.enabler-0.0.1-SNAPSHOT/greeting caused by: java.net.ConnectException: Connection refused: connect org.apache.camel.RuntimeCamelException: java.net.ConnectException: Connection refused: connect i think in a srvlet u can't listen to an other port...i am still investigating Bruno willem.jiang wrote: > > Can you try change the camel-restlet's endpoint uri to use other port ? > > Willem > > Tapdur wrote: >> hi i am trying to use camel-restlet component in a jonas/tomcat j2ee. >> i am getting mad with restlet depencies, does someone has alreday did >> that ? >> >> i use dependecies org.restlet and org.restlet.ext.servlet (and declare >> the >> RestletServlet in the web.xml) >> how to integrate Restlet servlet to camel ? via spring ? >> >> >> but at deploy time i always have the camel error msg : adress already >> bind >> in JVM. >> >> >> Thx >> Bruno >> > > > -- View this message in context: http://old.nabble.com/Restlet-in-a-webapp-tp27502117p27512550.html Sent from the Camel - Users mailing list archive at Nabble.com.
Re: Restlet in a webapp
hi willem i get one step forward for restlet engine : i use this dependencies maven-restlet Public online Restlet repository http://maven.restlet.org javax.xml.bind jaxb-api ${jaxb-api.version} com.sun.xml.bind jaxb-impl ${jaxb-impl.version} org.apache.camel camel-core ${camel-version} org.apache.camel camel-restlet ${camel-version} org.restlet.jee org.restlet 2.0-M7 org.restlet.jee org.restlet.ext.servlet 2.0-M7 org.restlet.jee org.restlet.ext.spring 2.0-M7 com.noelios.restlet com.noelios.restlet 1.1.8 com.noelios.restlet com.noelios.restlet.ext.spring 1.1.8 com.noelios.restlet com.noelios.restlet.ext.servlet 1.1.8 poc.camel.greeting poc.camel.greeting 0.0.1-SNAPSHOT and the WEB-INF/web.xml : RestletServlet org.restlet.ext.servlet.ServerServlet RestletServlet /* and it works. back to camel : i declare in the spring-beans.xml : http://camel.apache.org/schema/spring";> http://localhost:9090/poc.camel.enabler-0.0.1-SNAPSHOT?restletMethod=post"/> i change the port for restlet engine 9090 and no error at deploy time. then i send the client request : POST http://127.0.0.1:9090/poc.camel.enabler-0.0.1-SNAPSHOT Tapdur and it ... failed : 404 2010-02-09 17:53:34,737 : StreamServerHelper.start : Starting the internal HTTP server 2010-02-09 17:53:34,768 : DefaultCamelContext.start : Apache Camel 2.1.0 (CamelContext:camel) started 2010-02-09 17:53:34,784 : ContextLoader.initWebApplicationContext : Root WebApplicationContext: initialization completed in 6795 ms 2010-02-09 17:53:34,784 : AbsJWebContainerServiceImpl.registerWar : War /C:/JOnAS-4.10.3/webapps/poc.camel.enabler-0.0.1-SNAPSHOT.war available at the context /poc.camel.enabler-0.0.1-SNAPSHOT. 2010-02-09 17:53:54,404 : LogFilter.afterHandle : 2010-02-0917:53:54 127.0.0.1 - - 9090POST/ - 404 330 35 16 http://127.0.0.1:9090 Jakarta Commons-HttpClient/3.1 - so my question is how camel/restlet component configure the restlet engine to route toward him ? is it a restlet engine or a camel-restlet issue ? Thx Bruno willem.jiang wrote: > > Can you try change the camel-restlet's endpoint uri to use other port ? > > Willem > > Tapdur wrote: >> hi i am trying to use camel-restlet component in a jonas/tomcat j2ee. >> i am getting mad with restlet depencies, does someone has alreday did >> that ? >> >> i use dependecies org.restlet and org.restlet.ext.servlet (and declare >> the >> RestletServlet in the web.xml) >> how to integrate Restlet servlet to camel ? via spring ? >> >> >> but at deploy time i always have the camel error msg : adress already >> bind >> in JVM. >> >> >> Thx >> Bruno >> > > > -- View this message in context: http://old.nabble.com/Restlet-in-a-webapp-tp27502117p27518974.html Sent from the Camel - Users mailing list archive at Nabble.com.
Re: Restlet in a webapp
an other step it works ;-) ... and failed ;-( thx willem, i am near but i still have a problem. when i declare in the spring-bean.xml the route like that http://camel.apache.org/schema/spring";>--> http://127.0.0.1:9090/?restletMethods=POST,GET"/>--> --> it works VERY VERY WELL 2010-02-10 13:37:25,334 : LogFilter.afterHandle : 2010-02-1013:37:25 127.0.0.1 - - 9090POST/ - 200 35 35 0 http://127.0.0.1:9090 Jakarta Commons-HttpClient/3.1 - BUT if i declare like that : http://camel.apache.org/schema/spring";>--> http://127.0.0.1:9090/greeting?restletMethods=POST,GET"/>--> --> it FAILS 2010-02-10 13:39:02,467 : LogFilter.afterHandle : 2010-02-1013:39:02 127.0.0.1 - - 9090POST/ - 404 330 35 16 http://127.0.0.1:9090 Jakarta Commons-HttpClient/3.1 - who lost the uriPattern (/greeting) ? camel don't received it ? how investigate this ? (in the web.xml, i declare RestletServlet org.restlet.ext.servlet.ServerServlet RestletServlet /* ) willem.jiang wrote: > > You didn't set the response message for the client. > Please check out the camel-restlet unit tests[1] for the working examples. > > [1]https://svn.apache.org/repos/asf/camel/trunk/components/camel-restlet/src/test/java/org/apache/camel/component/restlet > > Willem > > Tapdur wrote: >> hi willem >> >> i get one step forward >> >> for restlet engine : i use this dependencies >> >> >> >> maven-restlet >> Public online Restlet repository >> http://maven.restlet.org >> >> >> >> >> javax.xml.bind >> jaxb-api >> ${jaxb-api.version} >> >> >> com.sun.xml.bind >> jaxb-impl >> ${jaxb-impl.version} >> >> >> org.apache.camel >> camel-core >> ${camel-version} >> >> >> org.apache.camel >> camel-restlet >> ${camel-version} >> >> >> org.restlet.jee >> org.restlet >> 2.0-M7 >> >> >> org.restlet.jee >> org.restlet.ext.servlet >> 2.0-M7 >> >> >> org.restlet.jee >> org.restlet.ext.spring >> 2.0-M7 >> >> >> com.noelios.restlet >> com.noelios.restlet >> 1.1.8 >> >> >> com.noelios.restlet >> com.noelios.restlet.ext.spring >> 1.1.8 >> >> >> com.noelios.restlet >> com.noelios.restlet.ext.servlet >> 1.1.8 >> >> >> poc.camel.greeting >> poc.camel.greeting >> 0.0.1-SNAPSHOT >> >> >> >> and the WEB-INF/web.xml : >> >> >>RestletServlet >> >> org.restlet.ext.servlet.ServerServlet >> >> >> >> >>RestletServlet >>/* >> >> >> >> and it works. >> >> back to camel : >> i declare in the spring-beans.xml : >> >> >> http://camel.apache.org/schema/spring";> >> >> > uri="restlet:http://localhost:9090/poc.camel.enabler-0.0.1-SNAPSHOT?restletMethod=post"/> >> >> >> >> >> i change the port for restlet engine 9090 and no error at deploy time. >> >> >> t
Re: Restlet in a webapp
YE IT WORKS LIKE A CHARM ;-) last error was a mistake in soapUI ;-) one last question, is there an option to make a distinction between /greeting and /greetings in the uriPattern (both match the processor) ? Thx again willem, that made my day loll and i would go further with camel ;-)) willem.jiang wrote: > > I think you need to update your client's url. > according to the log, it looks like the HttpClient still use the path "/". > > Willem > > Tapdur wrote: >> an other step it works ;-) ... and failed ;-( >> >> thx willem, i am near but i still have a problem. >> >> when i declare in the spring-bean.xml the route like that >> >> > xmlns="http://camel.apache.org/schema/spring";>--> >> >> > uri="restlet:http://127.0.0.1:9090/?restletMethods=POST,GET"/>--> >> >>--> >> >> >> it works VERY VERY WELL >> 2010-02-10 13:37:25,334 : LogFilter.afterHandle : 2010-02-10 13:37:25 >> 127.0.0.1- - 9090POST/ - 200 35 >> 35 0 http://127.0.0.1:9090 Jakarta >> Commons-HttpClient/3.1 - >> >> >> >> >> BUT if i declare like that : >> >> > xmlns="http://camel.apache.org/schema/spring";>--> >> >> > uri="restlet:http://127.0.0.1:9090/greeting?restletMethods=POST,GET"/>--> >> >>--> >> >> >> it FAILS >> 2010-02-10 13:39:02,467 : LogFilter.afterHandle : 2010-02-10 13:39:02 >> 127.0.0.1- - 9090POST/ - 404 330 >> 35 16 http://127.0.0.1:9090 Jakarta >> Commons-HttpClient/3.1 - >> >> >> who lost the uriPattern (/greeting) ? camel don't received it ? how >> investigate this ? >> >> (in the web.xml, i declare >>RestletServlet >> >> org.restlet.ext.servlet.ServerServlet >> >> >> >> >>RestletServlet >>/* >> >> ) >> >> >> >> >> >> >> >> >> willem.jiang wrote: >>> You didn't set the response message for the client. >>> Please check out the camel-restlet unit tests[1] for the working >>> examples. >>> >>> [1]https://svn.apache.org/repos/asf/camel/trunk/components/camel-restlet/src/test/java/org/apache/camel/component/restlet >>> >>> Willem >>> >>> Tapdur wrote: >>>> hi willem >>>> >>>> i get one step forward >>>> >>>> for restlet engine : i use this dependencies >>>> >>>> >>>> >>>>maven-restlet >>>>Public online Restlet repository >>>>http://maven.restlet.org >>>> >>>> >>>> >>>> >>>>javax.xml.bind >>>>jaxb-api >>>>${jaxb-api.version} >>>> >>>> >>>>com.sun.xml.bind >>>>jaxb-impl >>>>${jaxb-impl.version} >>>> >>>> >>>>org.apache.camel >>>>camel-core >>>>${camel-version} >>>> >>>> >>>>org.apache.camel >>>>camel-restlet >>>>${camel-version} >>>> >>>> >>>>org.restlet.jee >>>>org.restlet >>>>2.0-M7 >>>> >>>> >>>>org.restlet.jee >>>>org.restlet.ext.servlet >>>>2.0-M7 >>>> >>>> >>>>org.restlet.jee >>>>org.restlet.ext.spring >>>>2.0-M7 >>>> >>>> >>>>com.noelios.restlet >>>>com.noelios.r
xsd, unmarshal and getBody
Hi i doin't understand why it fail : i have an xsd file http://www.w3.org/2001/XMLSchema"; > i use xjc to produce the java file i have this route http://127.0.0.1:9090/greeting?restletMethods=POST,GET"/> This process failed public void process(Exchange exchange) throws Exception { GreetingRequestType user = (GreetingRequestType) exchange.getIn().getBody(GreetingRequestType.class); // GreetingResponseType gr = new GreetingResponseType(); gr.setWelcome(user.getName()); exchange.getOut().setBody( gr ); } the user is always nill, how to retrieve the instance ? (present in the echange value see in debug mode) but not this one public void process(Exchange exchange) throws Exception { // nothing } the incoming request is well unmarshall and marshall in the response why ? Thx Bruno -- View this message in context: http://old.nabble.com/xsd%2C-unmarshal-and-getBody-tp27540894p27540894.html Sent from the Camel - Users mailing list archive at Nabble.com.
in.getBody() Bug ???
Hi community in the process method, i want to get a body of type wich is generated by xjc, how to pass to the getBody() the jaxb option ignoreJAXBElement="false" (used in the unmarshall) ? this line fail (within the correct object in the echange.in.value attribute): GreetingRequestType user = (GreetingRequestType) exchange.getIn().getBody(GreetingRequestType.class); is it a bug or is there any workaround ? Thx Bruno -- View this message in context: http://old.nabble.com/in.getBody%28%29-Bug-tp27544321p27544321.html Sent from the Camel - Users mailing list archive at Nabble.com.
Re: in.getBody() Bug ???
no exception just return null object 2010-02-11 15:19:04,197 : Logger.process : 37b63738-e0c4-46aa-9906-a3a25805896f >>> (route1) from(http://127.0.0.1:9090/greeting) --> <<< Pattern:InOut, Headers:{org.restlet.http.version=HTTP/1.0, CamelHttpUri=http://127.0.0.1:9090/greeting, org.restlet.http.headers=[Accept: xml/application, Content-Type: , User-Agent: Jakarta Commons-HttpClient/3.1, Host: 127.0.0.1:9090, Content-Length: 57], CamelHttpMethod=POST, org.restlet.startTime=1265897944026}, BodyType:String, Body: Tapdur 2010-02-11 15:19:04,369 : Logger.process : 37b63738-e0c4-46aa-9906-a3a25805896f >>> (route1) --> log://poc.camel.greeting?level=DEBUG <<< Pattern:InOut, Headers:{org.restlet.http.headers=[Accept: xml/application, Content-Type: , User-Agent: Jakarta Commons-HttpClient/3.1, Host: 127.0.0.1:9090, Content-Length: 57], CamelHttpUri=http://127.0.0.1:9090/greeting, org.restlet.startTime=1265897944026, org.restlet.http.version=HTTP/1.0, CamelHttpMethod=POST}, BodyType:javax.xml.bind.JAXBElement, Body:javax.xml.bind.jaxbelem...@143c268 2010-02-11 15:19:04,432 : Logger.process : 37b63738-e0c4-46aa-9906-a3a25805896f >>> (route1) log://poc.camel.greeting?level=DEBUG --> ref:greeting <<< Pattern:InOut, Headers:{CamelHttpUri=http://127.0.0.1:9090/greeting, org.restlet.startTime=1265897944026, org.restlet.http.headers=[Accept: xml/application, Content-Type: , User-Agent: Jakarta Commons-HttpClient/3.1, Host: 127.0.0.1:9090, Content-Length: 57], org.restlet.http.version=HTTP/1.0, CamelHttpMethod=POST}, BodyType:javax.xml.bind.JAXBElement, Body:javax.xml.bind.jaxbelem...@143c268 Ashwin Karpe wrote: > > Hi, > > Can you also post the exception that is being thrown...? > > In addition is the payload being sent to the processor a serializable > object of GreetingRequestType.class? > > You may want to introduce a log() in the DSL to get a sense of the > contents of the exchange > > Cheers, > > Ashwin... > > > Tapdur wrote: >> >> Hi community >> >> in the process method, i want to get a body of type wich is generated by >> xjc, how to pass to the getBody() the jaxb option >> ignoreJAXBElement="false" (used in the unmarshall) ? >> >> this line fail (within the correct object in the echange.in.value >> attribute): GreetingRequestType user = (GreetingRequestType) >> exchange.getIn().getBody(GreetingRequestType.class); >> >> is it a bug or is there any workaround ? >> >> Thx >> Bruno >> >> >> >> >> > > -- View this message in context: http://old.nabble.com/in.getBody%28%29-Bug-tp27544321p27545970.html Sent from the Camel - Users mailing list archive at Nabble.com.
Re: in.getBody() Bug ???
thx it works ! in fact, the errors are due to the xsd delcaration and jaxb side (not camel side). it works well with XmlRootElement but not with complex type ;-) thx for all now i can go forward with lovely camel Bruno willem.jiang wrote: > > Hi, > > I think you need to let the jaxb unmarshal the xml without wrapping with > JAXBElement, just like this > > contextPath="poc.camel.echange" /> > > > Willem > > Tapdur wrote: >> no exception just return null object >> >> 2010-02-11 15:19:04,197 : Logger.process : >> 37b63738-e0c4-46aa-9906-a3a25805896f >>> (route1) >> from(http://127.0.0.1:9090/greeting) --> <<< Pattern:InOut, >> Headers:{org.restlet.http.version=HTTP/1.0, >> CamelHttpUri=http://127.0.0.1:9090/greeting, >> org.restlet.http.headers=[Accept: xml/application, Content-Type: , >> User-Agent: Jakarta Commons-HttpClient/3.1, Host: 127.0.0.1:9090, >> Content-Length: 57], CamelHttpMethod=POST, >> org.restlet.startTime=1265897944026}, BodyType:String, >> Body: >>Tapdur >> >> >> 2010-02-11 15:19:04,369 : Logger.process : >> 37b63738-e0c4-46aa-9906-a3a25805896f >>> (route1) --> >> log://poc.camel.greeting?level=DEBUG <<< Pattern:InOut, >> Headers:{org.restlet.http.headers=[Accept: xml/application, Content-Type: >> , >> User-Agent: Jakarta Commons-HttpClient/3.1, Host: 127.0.0.1:9090, >> Content-Length: 57], CamelHttpUri=http://127.0.0.1:9090/greeting, >> org.restlet.startTime=1265897944026, org.restlet.http.version=HTTP/1.0, >> CamelHttpMethod=POST}, BodyType:javax.xml.bind.JAXBElement, >> Body:javax.xml.bind.jaxbelem...@143c268 >> >> 2010-02-11 15:19:04,432 : Logger.process : >> 37b63738-e0c4-46aa-9906-a3a25805896f >>> (route1) >> log://poc.camel.greeting?level=DEBUG --> ref:greeting <<< Pattern:InOut, >> Headers:{CamelHttpUri=http://127.0.0.1:9090/greeting, >> org.restlet.startTime=1265897944026, org.restlet.http.headers=[Accept: >> xml/application, Content-Type: , User-Agent: Jakarta >> Commons-HttpClient/3.1, >> Host: 127.0.0.1:9090, Content-Length: 57], >> org.restlet.http.version=HTTP/1.0, CamelHttpMethod=POST}, >> BodyType:javax.xml.bind.JAXBElement, >> Body:javax.xml.bind.jaxbelem...@143c268 >> >> >> >> >> >> >> >> >> Ashwin Karpe wrote: >>> Hi, >>> >>> Can you also post the exception that is being thrown...? >>> >>> In addition is the payload being sent to the processor a serializable >>> object of GreetingRequestType.class? >>> >>> You may want to introduce a log() in the DSL to get a sense of the >>> contents of the exchange >>> >>> Cheers, >>> >>> Ashwin... >>> >>> >>> Tapdur wrote: >>>> Hi community >>>> >>>> in the process method, i want to get a body of type wich is generated >>>> by >>>> xjc, how to pass to the getBody() the jaxb option >>>> ignoreJAXBElement="false" (used in the unmarshall) ? >>>> >>>> this line fail (within the correct object in the echange.in.value >>>> attribute): GreetingRequestType user = (GreetingRequestType) >>>> exchange.getIn().getBody(GreetingRequestType.class); >>>> >>>> is it a bug or is there any workaround ? >>>> >>>> Thx >>>> Bruno >>>> >>>> >>>> >>>> >>>> >>> >> > > > -- View this message in context: http://old.nabble.com/in.getBody%28%29-Bug-tp27544321p27570760.html Sent from the Camel - Users mailing list archive at Nabble.com.
restlet header
Hi i am trying to get a specific application header in my http request over restlet and it always null why ? here is the client request : GET http://127.0.0.1/greeting HTTP/1.0 Accept: xml/application IGC-E164: 3370301169 User-Agent: Jakarta Commons-HttpClient/3.1 Host: 127.0.0.1 here is my log trace : Logger.process : 59eacefd-b77f-4b33-be04-22d0978587ce >>> (route1) from(http://127.0.0.1:80/greeting) --> ref:greeting <<< Pattern:InOut, Headers:{org.restlet.startTime=1267465996121, org.restlet.http.headers=[Accept: xml/application, IGC-E164: 3370301169, User-Agent: Jakarta Commons-HttpClient/3.1, Host: 127.0.0.1], CamelHttpMethod=GET, CamelHttpUri=http://127.0.0.1/greeting, org.restlet.http.version=HTTP/1.0}, BodyType:null, Body:null And i want to get the IGC-E164 header attribute here are the code wich always failed 1 / Map hdrs = (HashMap) exchange.getIn().getHeaders(); Map httpHeaders = (HashMap) hdrs.get("org.restlet.http.headers"); String e164 = (String ) httpHeaders.get("IGC-E164"); 2/ String e164 = (String ) exchange.getIn().getHeader("IGC-E164"); It is not very clear in the documentation, what i have missed ? Thk Bruno -- View this message in context: http://old.nabble.com/restlet-header-tp27746948p27746948.html Sent from the Camel - Users mailing list archive at Nabble.com.
wich EIP to use ?
Hi all, i have newbie question relative to EIP pattern, i don't see wich one correspond to my pb. (to simplify) : i send an order to "direct:order" from (direct:order") .to(direct:generateOrder-id) .to(direct:printOrder); from(direct:generateOrder-id") .to(http:///...) from(direct:printOrder) ... My issue is printOrder must be proceed after generation of the order-id BUT the endpoint generateOrder-Id is an http request and put its result in the out.setBody() and when i arrive in "direct:printOrder) i lost te initial order. The process i want is when i receive an order, i generate an order-id and call the direct:printOrder with the initial order and the new order-id ? any suggestion ? Thx Bruno -- View this message in context: http://old.nabble.com/wich-EIP-to-use---tp27829976p27829976.html Sent from the Camel - Users mailing list archive at Nabble.com.
camel:http Get /PATH
hi i have a big issue with the http component i want in the header HTTP_URI only the path without prefix by the host. by defaut it won't be ok to(http://@ip/path -> HTTP_URI = GET http://@IP/path i try this from(direct:notif) .setHeader(Exchange.HTTP_URI,"/path") .to(http://@ip); it fails , host null how manage this ? any idea ? Thx Bruno -- View this message in context: http://old.nabble.com/camel%3Ahttp-Get--PATH-tp27950896p27950896.html Sent from the Camel - Users mailing list archive at Nabble.com.
camel/restlet 1 endpoint for any path without list uris
Hi, Is there a trick to specify one camel/restlet entrypoint for any http path and use a eip to fork on specific path like this , without any list uri ? from("restlet:http://"+IgcProperties.get("igc.greeting.host")+":"+IgcProperties.get("igc.greeting.port")+"?restletMethods=post,get") .choice() .when(header("HTTP_PATH").isEqualTo("/greeting")).to("greetingService") .otherwise().throwException(new Exception()); this code generate http error 404 Thx Bruno -- View this message in context: http://old.nabble.com/camel-restlet-1-endpoint-for-any-path-without-list-uris-tp28049159p28049159.html Sent from the Camel - Users mailing list archive at Nabble.com.
Re: camel/restlet 1 endpoint for any path without list uris
Hi willem Thx for your answer, howerver, i launch my cammel route in a web-app / spring server, is there a web.xml configuration for camel-jetty ? i have error 404 with no camel trace. Regards Bruno willem.jiang wrote: > > Hi, > > I don't think the camel-restlet can meet your requirement. > But with the help of camel-jetty component, you can implement it easily. > > from("jetty:http://"+IgcProperties.get("igc.greeting.host")+":"+IgcProperties.get("igc.greeting.port")) > .choice() > .when(header("HTTP_PATH").isEqualTo("/greeting")).to("greetingService") > .otherwise().throwException(new Exception()); > > Willem > > Tapdur wrote: >> Hi, >> >> Is there a trick to specify one camel/restlet entrypoint for any http >> path >> and use a eip to fork on specific path like this , without any list uri ? >> >> >> from("restlet:http://"+IgcProperties.get("igc.greeting.host")+":"+IgcProperties.get("igc.greeting.port")+"?restletMethods=post,get") >> .choice() >> >> .when(header("HTTP_PATH").isEqualTo("/greeting")).to("greetingService") >> .otherwise().throwException(new Exception()); >> >> >> this code generate http error 404 >> >> Thx >> Bruno >> >> > > > -- View this message in context: http://old.nabble.com/camel-restlet-1-endpoint-for-any-path-without-list-uris-tp28049159p28067729.html Sent from the Camel - Users mailing list archive at Nabble.com.
Re: camel/restlet 1 endpoint for any path without list uris
Strange behavior 1/ when i use the url from my browser : httpp://127.0.0.0:9080/ -> it display Greeting (the choice/when/simple return true but the path doens't match with the url 2/ when i use the url from my browser : httpp://127.0.0.0:9080/greeting -> it display 404 not found (the jetty server don't handle the url why ? Bruno here is my spring dsl http://0.0.0.0:9080/"/> $CamelHttpPath = /greeting Greeting ${in.body} Igc Service not supported ${in.body} willem.jiang wrote: > > Hi, > > I don't think the camel-restlet can meet your requirement. > But with the help of camel-jetty component, you can implement it easily. > > from("jetty:http://"+IgcProperties.get("igc.greeting.host")+":"+IgcProperties.get("igc.greeting.port")) > .choice() > .when(header("HTTP_PATH").isEqualTo("/greeting")).to("greetingService") > .otherwise().throwException(new Exception()); > > Willem > > Tapdur wrote: >> Hi, >> >> Is there a trick to specify one camel/restlet entrypoint for any http >> path >> and use a eip to fork on specific path like this , without any list uri ? >> >> >> from("restlet:http://"+IgcProperties.get("igc.greeting.host")+":"+IgcProperties.get("igc.greeting.port")+"?restletMethods=post,get") >> .choice() >> >> .when(header("HTTP_PATH").isEqualTo("/greeting")).to("greetingService") >> .otherwise().throwException(new Exception()); >> >> >> this code generate http error 404 >> >> Thx >> Bruno >> >> > > > -- View this message in context: http://old.nabble.com/camel-restlet-1-endpoint-for-any-path-without-list-uris-tp28049159p28068882.html Sent from the Camel - Users mailing list archive at Nabble.com.
routing cxf web service proxy getting crazy
hi the community i want to use camel for routing cxf webservices but i am facing to some problems i don t understand here is my xml http://p-socle-as1:9008/wsp/services/wsprovider-1.0"; serviceClass="com.wsp.service.WsProvider" /> http://www.orange.com/wsp/Interfaces/WsPRovider/v1";> http://camel.apache.org/schema/spring"; useMDCLogging="true"> my WsProvider has 2 mehtods with differents arguments types. my issue is if i mention dataFormat as MESSAGE i have the message "Ambiguous method invocations possible" if i set as PAYLOAD (wich is what i want) i have : "No type converter available to convert from type: org.apache.camel.component.cxf.CxfPayload to the required type:" i must do or miss a stupid thing but i don t see it many thx Regards Bruno -- View this message in context: http://camel.465427.n5.nabble.com/routing-cxf-web-service-proxy-getting-crazy-tp5743808.html Sent from the Camel - Users mailing list archive at Nabble.com.
route cxf jaxb webservices -> NoTypeConversionAvailableException
hi all, i desesperate to run a "simple" use case wit camel. http://localhost:9008/wservice/services/wsservice-1.0"; serviceClass="WsServiceImpl" /> http://wservice/v1"; xmlns:data="http://wservice/v1/root";> http://camel.apache.org/schema/spring"; useMDCLogging="true"> both webservices are genereated by wsdl2java from the same wsdl. the initial request is consumed by cxfEndpoint but when i send the message to the target webservice WS-Service i have NoTypeConversionAvailableException exception. i understand the reaason, the body is of type CxfPayload No type converter available to convert from type: org.apache.camel.component.cxf.CxfPayload to the required type ... how to manage the convertion of CxfPayload ? is the a trick to use jaxb2 generated converter instead of convertBodyTo ? many thx Regards Bruno -- View this message in context: http://camel.465427.n5.nabble.com/route-cxf-jaxb-webservices-NoTypeConversionAvailableException-tp5743864.html Sent from the Camel - Users mailing list archive at Nabble.com.
Re: route cxf jaxb webservices -> NoTypeConversionAvailableException
thx Claus i will try but it found a wotrh turn around like ALL works fine except i receive an empty body, how to return the marshaled response to the cxf:cxfEnpoint message ? always in a dsl way like ? but i don t know where to use it. any idea ? thx bruno -- View this message in context: http://camel.465427.n5.nabble.com/route-cxf-jaxb-webservices-NoTypeConversionAvailableException-tp5743864p5743936.html Sent from the Camel - Users mailing list archive at Nabble.com.
DSL how to write "exchange.getOut().setBody(responsePayload);"
hi all i am facing to a simple need but i can't find any response : i have to return a value to my cxfEndpoint without coding any Processor (as i want to be full DSL EIP compliant), is there a trick or a maner to code the line exchange.getOut().setBody(responsePayload); seen in every processor in a pure DSL ? i have ${in.body} but i dont know how to access to the exchange.out message thx bruno -- View this message in context: http://camel.465427.n5.nabble.com/DSL-how-to-write-exchange-getOut-setBody-responsePayload-tp5743955.html Sent from the Camel - Users mailing list archive at Nabble.com.
stupid pipeline question
hi all when i use a route with cxfEndpoint like this it works fine the to response is well returned in the grom response. however, if i want to insert a mapper before and/or after the to uri i lost the body, why ??? may i use transform ? to return a com.a.response to the from messasge ? thx a lot bruno -- View this message in context: http://camel.465427.n5.nabble.com/stupid-pipeline-question-tp5744415.html Sent from the Camel - Users mailing list archive at Nabble.com.
Re: stupid pipeline question
It is dozer mapping -- View this message in context: http://camel.465427.n5.nabble.com/stupid-pipeline-question-tp5744415p5744425.html Sent from the Camel - Users mailing list archive at Nabble.com.
camel kafka - provider no partition key
Hi, i use the camel-kafka component and when i send a message to a topic it raise an error :No partition key set. t is due to the new api of the component. on the wiki page there is a sample for the consumer xml dsl but none for the provider, any idea ? thx Best Regards Bruno Message History --- RouteId ProcessorId Processor Elapsed (ms) [route7] [route7] [servlet:///customers/neworder?httpMethodRestrict=POST ] [10] [route7] [restBinding3 ] [ ] [ 3] [route7] [to4 ] [direct:customerNewOrder ] [ 4] [route3] [log1 ] [log ] [ 1] [route3] [to1 ] [kafka:localhost:9092?topic=orders&zookeeperHost=localhost&zookeeperPort=2181 ] [ 2] Exchange --- Exchange[ Id ID-P-7ZZ3CGBI-58294-1417540637830-1-2 ExchangePattern InOut Headers {accept=*/*, accept-encoding=gzip,deflate,sdch, accept-language=fr-FR,fr;q=0.8,en-US;q=0.6,en;q=0.4, breadcrumbId=ID-P-7ZZ3CGBI-58294-1417540637830-1-1, CamelHttpCharacterEncoding=UTF-8, CamelHttpMethod=POST, CamelHttpPath=, CamelHttpQuery=null, CamelHttpServletRequest=org.apache.catalina.connector.RequestFacade@1350201, CamelHttpServletResponse=org.apache.catalina.connector.ResponseFacade@116b42c, CamelHttpUri=/customers/neworder, CamelHttpUrl=http://localhost:8080/customers/neworder, CamelRedelivered=false, CamelRedeliveryCounter=0, CamelServletContextPath=/customers/neworder, connection=keep-alive, content-length=55, Content-Type=application/json, cookie=_pk_id.2.1fff=026a212c399ad03f.1410797639.15.1411684275.1411681543., dnt=1, host=localhost:8080, origin=chrome-extension://hgmloofddffdnphfgcellkdfbfbjeloo, user-agent=Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/35.0.1916.153 Safari/537.36} BodyTypeorg.apache.camel.converter.stream.InputStreamCache Body[Body is instance of org.apache.camel.StreamCache] ] Stacktrace --- org.apache.camel.CamelExchangeException: No partition key set. Exchange[Message: [Body is instance of org.apache.camel.StreamCache]] at org.apache.camel.component.kafka.KafkaProducer.process(KafkaProducer.java:67) -- View this message in context: http://camel.465427.n5.nabble.com/camel-kafka-provider-no-partition-key-tp5759971.html Sent from the Camel - Users mailing list archive at Nabble.com.
kafka inout issue
Hi the community, i have a route wich work well based on activeMQ from http .. to direct:provider to activemq:consumer and a consumer wich is listen on from activemq:consumer and reply a consumer msg. i then migrate to Kafka. The consumer receive the topic message, tranform it but the provider never receive the response and http response return with the provider default response and not the consumer response. here is the provider route wich never receive the consumer reponse : Le Provider répond Hello les consumers kafka.PARTITION_KEY and the consumer route ${body} et le consumer dit aussi bonjour is it a kafka component issue ? best regards Bruno -- View this message in context: http://camel.465427.n5.nabble.com/kafka-inout-issue-tp5760294.html Sent from the Camel - Users mailing list archive at Nabble.com.