Hello Neha,
for sure, if your servlet (the Restlets servlet in your case) is
listening on "/items", it can't handle and a fortiori respond to
http://localhost:8080/CaseManager/CaseManager.html.
What happens if you ask for /CaseManager/items/items?
Could you test with the following configuration (in web.xml)?
<servlet-mapping>
<servlet-name>ServerServlet</servlet-name>
<url-pattern>/*</url-pattern>
</servlet-mapping>
In this case, what happens if you ask for /CaseManager/items?
best regards,
Thierry Boileau
> I am having problems deploying my application on tomcat. I am using the
> Restlet GWT extension and while the application works on the hosted mode, it
> doesn't work when I deploy it on Tomcat.
>
> My Application file (snippet)
> -----------------------
> ...
> @Override
> public synchronized Restlet createRoot() {
> Router router = new Router(getContext());
> router.attach("/items",ItemsResource.class);
> router.attach("/items/{itemName}", ItemResource.class);
> return router;
> }
> ...
>
>
> On the client,
> -------------------
> grid.addRecordClickHandler(new RecordClickHandler() {
> public void onRecordClick(RecordClickEvent event) {
> final Client client = new Client(Protocol.HTTP);
> client.get("http://localhost:8080/CaseManager/items", new Callback(){
> @Override
> public void onEvent(Request request, Response response) {
> try{
> com.google.gwt.user.client.Window.alert( response.getEntity().getText() );
> }
> catch(Exception e){
> e.printStackTrace();
> }
> }
> });
> }
> });
>
> -----
> My web.xml when deployed on tomcat is
> ------------------------------------
> <?xml version="1.0" encoding="UTF-8"?>
> <web-app>
> <display-name>Test servlet</display-name>
> <context-param>
> <param-name>org.restlet.application</param-name>
> <param-value>
> com.test.server.FirstResourceApplication
> </param-value>
> </context-param>
>
> <!-- Restlet adapter -->
> <servlet>
> <servlet-name>ServerServlet</servlet-name>
> <servlet-class>
> org.restlet.ext.servlet.ServerServlet
> </servlet-class>
> </servlet>
>
> <!-- Catch all requests -->
> <servlet-mapping>
> <servlet-name>ServerServlet</servlet-name>
> <url-pattern>/items</url-pattern>
> </servlet-mapping>
>
> <servlet-mapping>
> <servlet-name>ServerServlet</servlet-name>
> <url-pattern>/items/*</url-pattern>
> </servlet-mapping>
>
> <welcome-file-list>
> <welcome-file>CaseManager.html</welcome-file>
> </welcome-file-list>
>
>
> </web-app>
>
> When I access the URL
> http://localhost:8080/CaseManager/CaseManager.html
> the call in the client fails with a 404 error.
>
> Feb 19, 2009 5:26:38 PM org.apache.catalina.core.ApplicationContext log
> INFO: ServerServlet: [Noelios Restlet Engine] - Attaching application:
> com.testapp.server.firstresourceapplicat...@dec8b3 to URI:
> /CaseManager/items
>
> Feb 19, 2009 5:26:38 PM org.restlet.engine.LogFilter afterHandle
> INFO: 2009-02-19 17:26:38 127.0.0.1 - 127.0.0.1
> 8080 GET /CaseManager/items - 404 330 - 31
> http://localhost:8080 Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1;
> SV1; .NET CLR 1.1.4322; InfoPath.1; .NET CLR 2.0.50727) -
> Feb 19, 2009 5:26:42 PM org.restlet.engine.LogFilter afterHandle
> INFO: 2009-02-19 17:26:42 127.0.0.1 - 127.0.0.1
> 8080 GET /CaseManager/items - 404 330 - 0
> http://localhost:8080 Noelios-Restlet-Engine/1.2.m1
> http://localhost:8080/CaseManager/782D6C746CFC4EFC288789EE2C72C8F3.cache.html
>
>
> >From this it looks like the request is going to FirstResourceApplication,
> >but its unable to find the appropriate router. I know that the issue is in
> >the web.xml (as that's the only thing that changed between the hosted mode
> >and the tomcat deplopyment).
> Has anyone faced this issue??
>
> ------------------------------------------------------
> http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=1194885
>
>
------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=1198612