Hi Neha,

I send a sample war to deploy inside servlet container such as Tomcat.
Just a few words about the key points :
Here is the content of the WEB-INF directory:
 - lib/
      - Java archives (Restlet API and Reference implementation, Servlet 
extension for Restlet, Json extension, RestletGWTSimpleExample.jar that 
contains the web files)
 - web.xml
Note that the RestletGWTSimpleExample.jar could be expanded inside the 
WEB-INF directory.

Here is the content of the web.xml file.
There is no reference to GWT Servlet, since we simply use the Restlet's 
adapter to serve GWT files and resources.
Note also that we define CLAP as a client protocol since CLAP is used to 
serve the static files generated by GWT:
Here is an excerpt of the TestServerApplication class =>
router.attach(
                        "/",
                        new Directory(getContext(), 
"clap://thread/org/restlet/example/gwt/org.restlet.example.gwt.SimpleExample"));
 


****

 <?xml version="1.0" encoding="ISO-8859-1"?>
<web-app>
   <context-param>
      <param-name>org.restlet.application</param-name> 
      
<param-value>org.restlet.example.gwt.server.TestServerApplication</param-value> 
 

   </context-param>
   <context-param>
      <param-name>org.restlet.clients</param-name>
      <param-value>HTTP CLAP</param-value>
   </context-param>
   <servlet>
      <servlet-name>adapter</servlet-name>
      
<servlet-class>com.noelios.restlet.ext.servlet.ServerServlet</servlet-class>
   </servlet>
   <servlet-mapping>
      <servlet-name>adapter</servlet-name>
      <url-pattern>/*</url-pattern>
   </servlet-mapping>
</web-app>
***

best regards,
Thierry Boileau

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

Reply via email to