You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Tapdur <ta...@gmail.com> on 2010/02/08 17:06:34 UTC

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

Posted by Tapdur <ta...@gmail.com>.
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

Posted by Tapdur <ta...@gmail.com>.
YESSSSSSSSSSSS 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
>> 
>> <camelContext id="camel"
>> xmlns="http://camel.apache.org/schema/spring">-->
>> 	  <route>
>> 	    <from
>> uri="restlet:http://127.0.0.1:9090/?restletMethods=POST,GET"/>-->
>> 	    	<process ref="greeting"></process>
>> 	  </route>-->
>> 	</camelContext>
>> 
>> it works VERY VERY WELL
>> 2010-02-10 13:37:25,334 : LogFilter.afterHandle : 2010-02-10	13:37:25
>> 127.0.0.1	-	-	9090	POST	/	-	200	35	35	0	http://127.0.0.1:9090	Jakarta
>> Commons-HttpClient/3.1	-
>> 
>> 
>> 
>> 
>> BUT if i declare like that :
>> 
>> <camelContext id="camel"
>> xmlns="http://camel.apache.org/schema/spring">-->
>> 	  <route>
>> 	    <from
>> uri="restlet:http://127.0.0.1:9090/greeting?restletMethods=POST,GET"/>-->
>> 	    	<process ref="greeting"></process>
>> 	  </route>-->
>> 	</camelContext>
>> 
>> it FAILS
>> 2010-02-10 13:39:02,467 : LogFilter.afterHandle : 2010-02-10	13:39:02
>> 127.0.0.1	-	-	9090	POST	/	-	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     <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>  	
>> )
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> 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
>>>>
>>>> 	<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
>>>>>>
>>>>>
>>>
>>>
>> 
> 
> 
> 

-- 
View this message in context: http://old.nabble.com/Restlet-in-a-webapp-tp27502117p27534458.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Restlet in a webapp

Posted by Willem Jiang <wi...@gmail.com>.
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
> 
> <camelContext id="camel" xmlns="http://camel.apache.org/schema/spring">-->
> 	  <route>
> 	    <from uri="restlet:http://127.0.0.1:9090/?restletMethods=POST,GET"/>-->
> 	    	<process ref="greeting"></process>
> 	  </route>-->
> 	</camelContext>
> 
> it works VERY VERY WELL
> 2010-02-10 13:37:25,334 : LogFilter.afterHandle : 2010-02-10	13:37:25
> 127.0.0.1	-	-	9090	POST	/	-	200	35	35	0	http://127.0.0.1:9090	Jakarta
> Commons-HttpClient/3.1	-
> 
> 
> 
> 
> BUT if i declare like that :
> 
> <camelContext id="camel" xmlns="http://camel.apache.org/schema/spring">-->
> 	  <route>
> 	    <from
> uri="restlet:http://127.0.0.1:9090/greeting?restletMethods=POST,GET"/>-->
> 	    	<process ref="greeting"></process>
> 	  </route>-->
> 	</camelContext>
> 
> it FAILS
> 2010-02-10 13:39:02,467 : LogFilter.afterHandle : 2010-02-10	13:39:02
> 127.0.0.1	-	-	9090	POST	/	-	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     <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>  	
> )
> 
> 
> 
> 
> 
> 
> 
> 
> 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
>>>
>>> 	<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
>>>>>
>>>>
>>
>>
> 


Re: Restlet in a webapp

Posted by Tapdur <ta...@gmail.com>.
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

<camelContext id="camel" xmlns="http://camel.apache.org/schema/spring">-->
	  <route>
	    <from uri="restlet:http://127.0.0.1:9090/?restletMethods=POST,GET"/>-->
	    	<process ref="greeting"></process>
	  </route>-->
	</camelContext>

it works VERY VERY WELL
2010-02-10 13:37:25,334 : LogFilter.afterHandle : 2010-02-10	13:37:25
127.0.0.1	-	-	9090	POST	/	-	200	35	35	0	http://127.0.0.1:9090	Jakarta
Commons-HttpClient/3.1	-




BUT if i declare like that :

<camelContext id="camel" xmlns="http://camel.apache.org/schema/spring">-->
	  <route>
	    <from
uri="restlet:http://127.0.0.1:9090/greeting?restletMethods=POST,GET"/>-->
	    	<process ref="greeting"></process>
	  </route>-->
	</camelContext>

it FAILS
2010-02-10 13:39:02,467 : LogFilter.afterHandle : 2010-02-10	13:39:02
127.0.0.1	-	-	9090	POST	/	-	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     <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>  	
)








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
>> 
>> 	<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
>>>>
>>>
>>>
>> 
> 
> 
> 

-- 
View this message in context: http://old.nabble.com/Restlet-in-a-webapp-tp27502117p27530675.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Restlet in a webapp

Posted by Willem Jiang <wi...@gmail.com>.
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
>>>
>>
>>
> 


Re: Restlet in a webapp

Posted by Tapdur <ta...@gmail.com>.
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
>> 
> 
> 
> 

-- 
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

Posted by Willem Jiang <wi...@gmail.com>.
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
>