Think of it this way: the Application's router is routing traffic to
relative paths from the root of wherever the Application is mounted.
When you are running in hosted mode, the Application is being mounted
at http://localhost:8888, so http://localhost:8888/ping goes to the
ping resource.

In the deployed example you gave below, you mounted the application at
http://localhost:8080/RestletGWTSimpleExample instead, so
http://localhost:8080/RestletGWTSimpleExample/ping goes to the ping
resource.  If you used the ROOT webapp instead of the
RestletGWTSimpleExample webapp (as you are doing in hosted mode) then
http://localhost:8080/ping would go to the ping resource.

- Rob

On Fri, Feb 20, 2009 at 10:37 AM, Neha Verma <[email protected]> wrote:
> I just tried deploy the SimpleExample(from the restlet docs) to Tomcat and 
> faced the same issue.
>
> In the hosted mode, the web.xml is
>        <servlet>
>                <servlet-name>adapter</servlet-name>
>                
> <servlet-class>com.noelios.restlet.ext.gwt.GwtShellServletWrapper</servlet-class>
>                <init-param>
>                  <param-name>org.restlet.application</param-name>
>                  
> <param-value>org.restlet.example.gwt.server.TestServerApplication</param-value>
>                </init-param>
>                <init-param>
>                  <param-name>module</param-name>
>                  
> <param-value>org.restlet.example.gwt.SimpleExample</param-value>
>                </init-param>
>        </servlet>
>
>        <servlet-mapping>
>                <servlet-name>adapter</servlet-name>
>                <url-pattern>/*</url-pattern>
>        </servlet-mapping>
>
>
> and it works like a charm.
> However, when I deploy the app to tomcat by the following method
> (a) copy all the files from www\org.restlet.example.gwt.SimpleExample to 
> <<tomcat webapps>>\RestletGWTSimpleExample
> (b) create <<tomcat webapps>>\RestletGWTSimpleExample\WEB-INF\classes (with 
> all files from bin) and lib
> c) change web.xml to
> <web-app>
> <display-name>Test servlet</display-name>
> <context-param>
>            <param-name>org.restlet.application</param-name>
>            <param-value>
>               org.restlet.example.gwt.server.TestServerApplication
>            </param-value>
>    </context-param>
>
>    <!-- Restlet adapter -->
>    <servlet>
>            <servlet-name>ServerServlet</servlet-name>
>            <servlet-class>
>               com.noelios.restlet.ext.servlet.ServerServlet
>            </servlet-class>
>    </servlet>
>
>    <!-- Catch all requests -->
>    <servlet-mapping>
>            <servlet-name>ServerServlet</servlet-name>
>            <url-pattern>/*</url-pattern>
>    </servlet-mapping>
>
>  <welcome-file-list>
>        <welcome-file>SimpleExample.html</welcome-file>
>  </welcome-file-list>
>
>
> </web-app>
>
>
> When I try to access 
> http://localhost:8080/RestletGWTSimpleExample/SimpleExample.html , I get 404. 
> And the following in the log
> Feb 20, 2009 10:35:09 AM org.apache.catalina.core.ApplicationContext log
> SEVERE: Getting variants for : 
> clap://thread/org/restlet/example/gwt/org.restlet.example.gwt.SimpleExample/SimpleExample.html
> Feb 20, 2009 10:35:09 AM org.apache.catalina.core.ApplicationContext log
> SEVERE: Converted target URI: 
> clap://thread/org/restlet/example/gwt/org.restlet.example.gwt.SimpleExample/SimpleExample.html
>
> http://localhost:8080/RestletGWTSimpleExample/ping
> returns Restlet server alive. Method: GET
> which is fine.
>
> I think I am missing something here.
>
> ------------------------------------------------------
> http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=1198923
>

------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=1199034

Reply via email to