firstResource 404 problem

4 messages Options
Embed this post
Permalink
Bedwyr Humphreys

firstResource 404 problem

Reply Threaded More More options
Print post
Permalink
Hi,

I'm trying to run the firstResource example as a servlet but keep getting a 404.  The example runs fine using a Component on localhost using

        Reference itemsUri = new Reference("http://localhost:8182/firstResource/items");


but when I deploy it to Glassfish2.1 and change itemsUri to "http://myHost:8080/firstResource/items" I get a 404 not found. Viewing myHost:8080/firstResource gives me a directory listing.

I was able to deploy the first steps aplication to glassfish without a  problem. I can only assume there's something wrong with my web.xml file?

Here it is:

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID" version="2.5">
        <display-name>firstResourceservlet</display-name>

    <context-param>
        <param-name>org.restlet.application</param-name>
        <param-value>firstResource.FirstResourceApplication</param-value>
    </context-param>
    <servlet>
        <servlet-name>RestletServlet</servlet-name>
        <servlet-class>com.noelios.restlet.ext.servlet.ServerServlet</servlet-class>
    </servlet>
    <servlet-mapping>
        <servlet-name>RestletServlet</servlet-name>
        <url-pattern>/items/*</url-pattern>
    </servlet-mapping>
</web-app>

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

Re: firstResource 404 problem

Reply Threaded More More options
Print post
Permalink
Hello,

I've runned the code with tomcat (6.0.18), it works fine also. I'm
downloading Glassfish 2.1 in order to test.
I'll keep you informed.

best regards,
Thierry Boileau

> Hi,
>
> I'm trying to run the firstResource example as a servlet but keep getting a 404.  The example runs fine using a Component on localhost using
>
>         Reference itemsUri = new Reference("http://localhost:8182/firstResource/items");
>
>
> but when I deploy it to Glassfish2.1 and change itemsUri to "http://myHost:8080/firstResource/items" I get a 404 not found. Viewing myHost:8080/firstResource gives me a directory listing.
>
> I was able to deploy the first steps aplication to glassfish without a  problem. I can only assume there's something wrong with my web.xml file?
>
> Here it is:
>
> <?xml version="1.0" encoding="UTF-8"?>
> <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID" version="2.5">
> <display-name>firstResourceservlet</display-name>
>
>     <context-param>
>         <param-name>org.restlet.application</param-name>
>         <param-value>firstResource.FirstResourceApplication</param-value>
>     </context-param>
>     <servlet>
>         <servlet-name>RestletServlet</servlet-name>
>         <servlet-class>com.noelios.restlet.ext.servlet.ServerServlet</servlet-class>
>     </servlet>
>     <servlet-mapping>
>         <servlet-name>RestletServlet</servlet-name>
>         <url-pattern>/items/*</url-pattern>
>     </servlet-mapping>
> </web-app>
>
> ------------------------------------------------------
> http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2413453
>
>

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

Re: firstResource 404 problem

Reply Threaded More More options
Print post
Permalink
In reply to this post by Bedwyr Humphreys
Hello,

I may have an idea, could you try with this war (updated with the
current snapshot of Restlet 1.1)?

Best regards,
Thierry Boileau



> Hi,
>
> I'm trying to run the firstResource example as a servlet but keep getting a 404.  The example runs fine using a Component on localhost using
>
>         Reference itemsUri = new Reference("http://localhost:8182/firstResource/items");
>
>
> but when I deploy it to Glassfish2.1 and change itemsUri to "http://myHost:8080/firstResource/items" I get a 404 not found. Viewing myHost:8080/firstResource gives me a directory listing.
>
> I was able to deploy the first steps aplication to glassfish without a  problem. I can only assume there's something wrong with my web.xml file?
>
> Here it is:
>
> <?xml version="1.0" encoding="UTF-8"?>
> <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID" version="2.5">
> <display-name>firstResourceservlet</display-name>
>
>     <context-param>
>         <param-name>org.restlet.application</param-name>
>         <param-value>firstResource.FirstResourceApplication</param-value>
>     </context-param>
>     <servlet>
>         <servlet-name>RestletServlet</servlet-name>
>         <servlet-class>com.noelios.restlet.ext.servlet.ServerServlet</servlet-class>
>     </servlet>
>     <servlet-mapping>
>         <servlet-name>RestletServlet</servlet-name>
>         <url-pattern>/items/*</url-pattern>
>     </servlet-mapping>
> </web-app>
>
> ------------------------------------------------------
> http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2413453
>
>
------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2414157

firstResourceServlet.war (615K) Download Attachment
Bedwyr Humphreys

RE: Re: firstResource 404 problem

Reply Threaded More More options
Print post
Permalink
Hi,

Thanks for this I will try it out later.

After looking at the .war for the restlet2.0 example I was able to get the .war for the 1.1 example to work by changing the web.xml url-pattern to /* instead of /items/*.

Kind regards,
Bedwyr

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