camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Willem Jiang <willem.ji...@gmail.com>
Subject Re: Restlet in a webapp
Date Wed, 10 Feb 2010 02:03:07 GMT
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
> 
> 	<repositories>
> 		<repository>
> 			<id>maven-restlet</id>
> 			<name>Public online Restlet repository</name>
> 			<url>http://maven.restlet.org</url>
> 		</repository>
> 	</repositories>
> 	<dependencies>
> 		<dependency>
> 			<groupId>javax.xml.bind</groupId>
> 			<artifactId>jaxb-api</artifactId>
> 			<version>${jaxb-api.version}</version>
> 		</dependency>
> 		<dependency>
> 			<groupId>com.sun.xml.bind</groupId>
> 			<artifactId>jaxb-impl</artifactId>
> 			<version>${jaxb-impl.version}</version>
> 		</dependency>
> 		<dependency>
> 			<groupId>org.apache.camel</groupId>
> 			<artifactId>camel-core</artifactId>
> 			<version>${camel-version}</version>
> 		</dependency>
> 		<dependency>
> 			<groupId>org.apache.camel</groupId>
> 			<artifactId>camel-restlet</artifactId>
> 			<version>${camel-version}</version>
> 		</dependency>
> 		<dependency>
> 			<groupId>org.restlet.jee</groupId>
> 			<artifactId>org.restlet</artifactId>
> 			<version>2.0-M7</version>
> 		</dependency>
> 		<dependency>
> 			<groupId>org.restlet.jee</groupId>
> 			<artifactId>org.restlet.ext.servlet</artifactId>
> 			<version>2.0-M7</version>
> 		</dependency>
> 		<dependency>
> 			<groupId>org.restlet.jee</groupId>
> 			<artifactId>org.restlet.ext.spring</artifactId>
> 			<version>2.0-M7</version>
> 		</dependency>
> 		<dependency>
> 			<groupId>com.noelios.restlet</groupId>
> 			<artifactId>com.noelios.restlet</artifactId>
> 			<version>1.1.8</version>
> 		</dependency>
> 		<dependency>
> 			<groupId>com.noelios.restlet</groupId>
> 			<artifactId>com.noelios.restlet.ext.spring</artifactId>
> 			<version>1.1.8</version>
> 		</dependency>
> 		<dependency>
> 			<groupId>com.noelios.restlet</groupId>
> 			<artifactId>com.noelios.restlet.ext.servlet</artifactId>
> 			<version>1.1.8</version>
> 		</dependency>		
> 		<dependency>
> 			<groupId>poc.camel.greeting</groupId>
> 			<artifactId>poc.camel.greeting</artifactId>
> 			<version>0.0.1-SNAPSHOT</version>
> 		</dependency>
> 	</dependencies>
> 
> and the WEB-INF/web.xml :
> 
>     <servlet>  
>        <servlet-name>RestletServlet</servlet-name>  
>        <servlet-class>  
>           org.restlet.ext.servlet.ServerServlet  
>        </servlet-class>  
>     </servlet>  
>    
>     <servlet-mapping>  
>        <servlet-name>RestletServlet</servlet-name>  
>        <url-pattern>/*</url-pattern>  
>     </servlet-mapping>  
> 
> 
> and it works.
> 
> back to camel :
> i declare in the spring-beans.xml :
> 
> 
> 	<camelContext id="camel" xmlns="http://camel.apache.org/schema/spring">
> 	  <route>
> 	    <from
> uri="restlet:http://localhost:9090/poc.camel.enabler-0.0.1-SNAPSHOT?restletMethod=post"/>
> 	    	<to uri="file://c:/camellogs/logs.txt" />
> 	  </route>
> 	</camelContext>
> 
> 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
> <user>
>    <name>Tapdur</name>
> </user>
> 
> 
> 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-09	17:53:54
> 127.0.0.1	-	-	9090	POST	/	-	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
>>>
>>
>>
> 


Mime
View raw message