|
From: Kapil G. <kap...@gm...> - 2014-01-15 17:16:35
|
am trying to run the samples from the O'Reilly book (by Bill Burke) on Tomcat. Tried both for Tomcat 7 and 8. The ShoppingApplication deploys fine but when i try to POST a customer resource to /services/customers it gives me 404. I built the war from the Maven for Chapter 3 example (ex03_1) and deployed that war on Tomcat and the deployment (Tomcat startup console) shows messages of ShoppingApplication being deployed. What am i missing, dont see any error message or any clue around what could be going wrong. Thanks in anticipation, Kapil. |
|
From: Weinan Li <l.w...@gm...> - 2014-01-16 05:50:35
|
Hi Kapil, Are you using "oreilly-jaxrs-2.0-workbook/ex03_1” or "oreilly-workbook/ex03_1”? The former one can only be deployed in a JavaEE application server that supports JAX-RS 2.0 spec like WildFly, because it doesn’t have standalone settings in web.xml. Please add following settings you web.xml if you want to deploy it in tomcat: <servlet> <servlet-name>Resteasy</servlet-name> <servlet-class> org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher </servlet-class> <init-param> <param-name>javax.ws.rs.Application</param-name> <param-value> com.restfully.shop.services.ShoppingApplication </param-value> </init-param> </servlet> <servlet-mapping> <servlet-name>Resteasy</servlet-name> <url-pattern>/*</url-pattern> </servlet-mapping> In addition, if ex03_1.war is deployed into tomcat correctly you should see the following log in catalina.out: resteasy.spi.ResteasyDeployment. Deploying javax.ws.rs.core.Application: class com.restfully.shop.services.ShoppingApplication 16-Jan-2014 13:37:17.219 INFO [localhost-startStop-2] org.jboss.resteasy.spi.ResteasyDeployment. Adding singleton resource com.restfully.shop.services.CustomerResource from Application class com.restfully.shop.services.ShoppingApplication And then you can access it by http://127.0.0.1:8080/ex03_1/customers -- Weinan Li On Thursday, January 16, 2014 at 1:16 AM, Kapil Gambhir wrote: > am trying to run the samples from the O'Reilly book (by Bill Burke) on Tomcat. Tried both for Tomcat 7 and 8. The ShoppingApplication deploys fine but when i try to POST a customer resource to /services/customers it gives me 404. > I built the war from the Maven for Chapter 3 example (ex03_1) and deployed that war on Tomcat and the deployment (Tomcat startup console) shows messages of ShoppingApplication being deployed. What am i missing, dont see any error message or any clue around what could be going wrong. > > Thanks in anticipation, > Kapil. > ------------------------------------------------------------------------------ > CenturyLink Cloud: The Leader in Enterprise Cloud Services. > Learn Why More Businesses Are Choosing CenturyLink Cloud For > Critical Workloads, Development Environments & Everything In Between. > Get a Quote or Start a Free Trial Today. > http://pubads.g.doubleclick.net/gampad/clk?id=119420431&iu=/4140/ostg.clktrk > > _______________________________________________ > Resteasy-users mailing list > Res...@li... (mailto:Res...@li...) > https://lists.sourceforge.net/lists/listinfo/resteasy-users |
|
From: Weinan Li <l.w...@gm...> - 2014-01-16 08:09:34
|
I’ve tested ex03_1 after set it up properly and deployed it on Tomcat8. And it works without any problem: $ curl -X POST -H "Content-Type: application/xml" -d "<customer><first-name>Bill</first-name><last-name>Burke</last-name><street>256 Clarendon Street</street><city>Boston</city><state>MA</state><zip>02115</zip><country>USA</country></customer>" http://127.0.0.1:8080/ex03_1/customers From catalina.out: Created customer 1 $ curl http://127.0.0.1:8080/ex03_1/customers/1 <customer id="1"> <first-name>Bill</first-name> <last-name>Burke</last-name> <street>256 Clarendon Street</street> <city>Boston</city> <state>MA</state> <zip>02115</zip> <country>USA</country> </customer> -- Weinan Li On Thursday, January 16, 2014 at 1:50 PM, Weinan Li wrote: > Hi Kapil, > > Are you using "oreilly-jaxrs-2.0-workbook/ex03_1” or "oreilly-workbook/ex03_1”? The former one can only be deployed in a JavaEE application server that supports JAX-RS 2.0 spec like WildFly, because it doesn’t have standalone settings in web.xml (http://web.xml). Please add following settings you web.xml (http://web.xml) if you want to deploy it in tomcat: > > <servlet> > <servlet-name>Resteasy</servlet-name> > <servlet-class> > org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher > </servlet-class> > <init-param> > <param-name>javax.ws.rs.Application</param-name> > <param-value> > com.restfully.shop.services.ShoppingApplication > </param-value> > </init-param> > </servlet> > > <servlet-mapping> > <servlet-name>Resteasy</servlet-name> > <url-pattern>/*</url-pattern> > </servlet-mapping> > > > > In addition, if ex03_1.war is deployed into tomcat correctly you should see the following log in catalina.out: > > resteasy.spi.ResteasyDeployment. Deploying javax.ws.rs.core.Application: class com.restfully.shop.services.ShoppingApplication > 16-Jan-2014 13:37:17.219 INFO [localhost-startStop-2] org.jboss.resteasy.spi.ResteasyDeployment. Adding singleton resource com.restfully.shop.services.CustomerResource from Application class com.restfully.shop.services.ShoppingApplication > > > And then you can access it by http://127.0.0.1:8080/ex03_1/customers > > -- > Weinan Li > > > On Thursday, January 16, 2014 at 1:16 AM, Kapil Gambhir wrote: > > > am trying to run the samples from the O'Reilly book (by Bill Burke) on Tomcat. Tried both for Tomcat 7 and 8. The ShoppingApplication deploys fine but when i try to POST a customer resource to /services/customers it gives me 404. > > I built the war from the Maven for Chapter 3 example (ex03_1) and deployed that war on Tomcat and the deployment (Tomcat startup console) shows messages of ShoppingApplication being deployed. What am i missing, dont see any error message or any clue around what could be going wrong. > > > > Thanks in anticipation, > > Kapil. > > ------------------------------------------------------------------------------ > > CenturyLink Cloud: The Leader in Enterprise Cloud Services. > > Learn Why More Businesses Are Choosing CenturyLink Cloud For > > Critical Workloads, Development Environments & Everything In Between. > > Get a Quote or Start a Free Trial Today. > > http://pubads.g.doubleclick.net/gampad/clk?id=119420431&iu=/4140/ostg.clktrk > > > > _______________________________________________ > > Resteasy-users mailing list > > Res...@li... (mailto:Res...@li...) > > https://lists.sourceforge.net/lists/listinfo/resteasy-users > |
|
From: Kapil G. <kap...@gm...> - 2014-01-16 11:00:21
|
Hi, thanks for a prompt response, am using the JAX-RS v2, so the "oreilly-jaxrs-2.0-workbook/ex03_1”. I am able to run the example with the web.xml changes suggested by you, it made sense also but am wondering how the default example (shipped as a zip) worked on jetty (which is also a servlet container only, pretty much like Tomcat). The examples download has the Maven scripts which execute the test client using the Jetty and that works fine without the web.xml changes. Any idea on this one? my objective is to use a lightweight container to keep things simple and fast. On Thu, Jan 16, 2014 at 11:20 AM, Weinan Li <l.w...@gm...> wrote: > Hi Kapil, > > Are you using "oreilly-jaxrs-2.0-workbook/ex03_1” or > "oreilly-workbook/ex03_1”? The former one can only be deployed in a JavaEE > application server that supports JAX-RS 2.0 spec like WildFly, because it > doesn’t have standalone settings in web.xml. Please add following settings > you web.xml if you want to deploy it in tomcat: > > <servlet> > <servlet-name>Resteasy</servlet-name> > <servlet-class> > org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher > </servlet-class> > <init-param> > <param-name>javax.ws.rs.Application</param-name> > <param-value> > com.restfully.shop.services.ShoppingApplication > </param-value> > </init-param> > </servlet> > > <servlet-mapping> > <servlet-name>Resteasy</servlet-name> > <url-pattern>/*</url-pattern> > </servlet-mapping> > > > > In addition, if ex03_1.war is deployed into tomcat correctly you should > see the following log in catalina.out: > > resteasy.spi.ResteasyDeployment. Deploying javax.ws.rs.core.Application: > class com.restfully.shop.services.ShoppingApplication > 16-Jan-2014 13:37:17.219 INFO [localhost-startStop-2] > org.jboss.resteasy.spi.ResteasyDeployment. Adding singleton resource > com.restfully.shop.services.CustomerResource from Application class > com.restfully.shop.services.ShoppingApplication > > > And then you can access it by http://127.0.0.1:8080/ex03_1/customers > > -- > Weinan Li > > > On Thursday, January 16, 2014 at 1:16 AM, Kapil Gambhir wrote: > > > am trying to run the samples from the O'Reilly book (by Bill Burke) on > Tomcat. Tried both for Tomcat 7 and 8. The ShoppingApplication deploys fine > but when i try to POST a customer resource to /services/customers it gives > me 404. > > I built the war from the Maven for Chapter 3 example (ex03_1) and > deployed that war on Tomcat and the deployment (Tomcat startup console) > shows messages of ShoppingApplication being deployed. What am i missing, > dont see any error message or any clue around what could be going wrong. > > > > Thanks in anticipation, > > Kapil. > > > ------------------------------------------------------------------------------ > > CenturyLink Cloud: The Leader in Enterprise Cloud Services. > > Learn Why More Businesses Are Choosing CenturyLink Cloud For > > Critical Workloads, Development Environments & Everything In Between. > > Get a Quote or Start a Free Trial Today. > > > http://pubads.g.doubleclick.net/gampad/clk?id=119420431&iu=/4140/ostg.clktrk > > > > _______________________________________________ > > Resteasy-users mailing list > > Res...@li... (mailto: > Res...@li...) > > https://lists.sourceforge.net/lists/listinfo/resteasy-users > > > > |
|
From: Weinan Li <l.w...@gm...> - 2014-01-16 12:01:28
|
-- Weinan Li On Thursday, January 16, 2014 at 7:00 PM, Kapil Gambhir wrote: > Hi, > thanks for a prompt response, am using the JAX-RS v2, so the "oreilly-jaxrs-2.0-workbook/ex03_1”. > I am able to run the example with the web.xml (http://web.xml) changes suggested by you, it made sense also but am wondering how the default example (shipped as a zip) worked on jetty (which is also a servlet container only, pretty much like Tomcat). The examples download has the Maven scripts which execute the test client using the Jetty and that works fine without the web.xml (http://web.xml) changes. Any idea on this one? > my objective is to use a lightweight container to keep things simple and fast. I haven’t looked into details of Jetty, but the reason could only be that Jetty supports JAX-RS2.0 spec out of box. > > > On Thu, Jan 16, 2014 at 11:20 AM, Weinan Li <l.w...@gm... (mailto:l.w...@gm...)> wrote: > > Hi Kapil, > > > > Are you using "oreilly-jaxrs-2.0-workbook/ex03_1” or "oreilly-workbook/ex03_1”? The former one can only be deployed in a JavaEE application server that supports JAX-RS 2.0 spec like WildFly, because it doesn’t have standalone settings in web.xml (http://web.xml). Please add following settings you web.xml (http://web.xml) if you want to deploy it in tomcat: > > > > <servlet> > > <servlet-name>Resteasy</servlet-name> > > <servlet-class> > > org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher > > </servlet-class> > > <init-param> > > <param-name>javax.ws.rs.Application</param-name> > > <param-value> > > com.restfully.shop.services.ShoppingApplication > > </param-value> > > </init-param> > > </servlet> > > > > <servlet-mapping> > > <servlet-name>Resteasy</servlet-name> > > <url-pattern>/*</url-pattern> > > </servlet-mapping> > > > > > > > > In addition, if ex03_1.war is deployed into tomcat correctly you should see the following log in catalina.out: > > > > resteasy.spi.ResteasyDeployment. Deploying javax.ws.rs.core.Application: class com.restfully.shop.services.ShoppingApplication > > 16-Jan-2014 13:37:17.219 INFO [localhost-startStop-2] org.jboss.resteasy.spi.ResteasyDeployment. Adding singleton resource com.restfully.shop.services.CustomerResource from Application class com.restfully.shop.services.ShoppingApplication > > > > > > And then you can access it by http://127.0.0.1:8080/ex03_1/customers > > > > -- > > Weinan Li > > > > > > On Thursday, January 16, 2014 at 1:16 AM, Kapil Gambhir wrote: > > > > > am trying to run the samples from the O'Reilly book (by Bill Burke) on Tomcat. Tried both for Tomcat 7 and 8. The ShoppingApplication deploys fine but when i try to POST a customer resource to /services/customers it gives me 404. > > > I built the war from the Maven for Chapter 3 example (ex03_1) and deployed that war on Tomcat and the deployment (Tomcat startup console) shows messages of ShoppingApplication being deployed. What am i missing, dont see any error message or any clue around what could be going wrong. > > > > > > Thanks in anticipation, > > > Kapil. > > > ------------------------------------------------------------------------------ > > > CenturyLink Cloud: The Leader in Enterprise Cloud Services. > > > Learn Why More Businesses Are Choosing CenturyLink Cloud For > > > Critical Workloads, Development Environments & Everything In Between. > > > Get a Quote or Start a Free Trial Today. > > > http://pubads.g.doubleclick.net/gampad/clk?id=119420431&iu=/4140/ostg.clktrk > > > > > > _______________________________________________ > > > Resteasy-users mailing list > > > Res...@li... (mailto:Res...@li...) (mailto:Res...@li...) > > > https://lists.sourceforge.net/lists/listinfo/resteasy-users > > > |
|
From: Kapil G. <kap...@gm...> - 2014-02-01 10:33:24
|
I am using Tomcat 8.x which is a servlet 3.1 container, so the expectation was that the example application should not require web.xml (as per the documentation on http://docs.jboss.org/resteasy/docs/3.0.6.Final/userguide/html_single/#d4e111). The document seems to suggest that this is required for pre 3.0 servlet containers. My bigger concern is that the app Path(i.e @ApplicationPath("/services") ) annotation in the ShoppingApplication class (which is extending the Application class) is ignored. So this path seems to be ignored totally and the URL for Customer is (/ex03_1/customers)<http://127.0.0.1:8080/ex03_1/customers>there is no "services" in this URL. Does that mean that this annotation is not useful. Kapil. <http://127.0.0.1:8080/ex03_1/customers> ---------- Forwarded message ---------- From: Weinan Li <l.w...@gm...> Date: Thu, Jan 16, 2014 at 5:31 PM Subject: Re: [Resteasy-users] Running JAX-RS 2.0 O'Reilly book samples on Tomcat.. To: Kapil Gambhir <kap...@gm...> Cc: res...@li... -- Weinan Li On Thursday, January 16, 2014 at 7:00 PM, Kapil Gambhir wrote: > Hi, > thanks for a prompt response, am using the JAX-RS v2, so the "oreilly-jaxrs-2.0-workbook/ex03_1". > I am able to run the example with the web.xml (http://web.xml) changes suggested by you, it made sense also but am wondering how the default example (shipped as a zip) worked on jetty (which is also a servlet container only, pretty much like Tomcat). The examples download has the Maven scripts which execute the test client using the Jetty and that works fine without the web.xml (http://web.xml) changes. Any idea on this one? > my objective is to use a lightweight container to keep things simple and fast. I haven't looked into details of Jetty, but the reason could only be that Jetty supports JAX-RS2.0 spec out of box. > > > On Thu, Jan 16, 2014 at 11:20 AM, Weinan Li <l.w...@gm... (mailto: l.w...@gm...)> wrote: > > Hi Kapil, > > > > Are you using "oreilly-jaxrs-2.0-workbook/ex03_1" or "oreilly-workbook/ex03_1"? The former one can only be deployed in a JavaEE application server that supports JAX-RS 2.0 spec like WildFly, because it doesn't have standalone settings in web.xml (http://web.xml). Please add following settings you web.xml (http://web.xml) if you want to deploy it in tomcat: > > > > <servlet> > > <servlet-name>Resteasy</servlet-name> > > <servlet-class> > > org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher > > </servlet-class> > > <init-param> > > <param-name>javax.ws.rs.Application</param-name> > > <param-value> > > com.restfully.shop.services.ShoppingApplication > > </param-value> > > </init-param> > > </servlet> > > > > <servlet-mapping> > > <servlet-name>Resteasy</servlet-name> > > <url-pattern>/*</url-pattern> > > </servlet-mapping> > > > > > > > > In addition, if ex03_1.war is deployed into tomcat correctly you should see the following log in catalina.out: > > > > resteasy.spi.ResteasyDeployment. Deploying javax.ws.rs.core.Application: class com.restfully.shop.services.ShoppingApplication > > 16-Jan-2014 13:37:17.219 INFO [localhost-startStop-2] org.jboss.resteasy.spi.ResteasyDeployment. Adding singleton resource com.restfully.shop.services.CustomerResource from Application class com.restfully.shop.services.ShoppingApplication > > > > > > And then you can access it by http://127.0.0.1:8080/ex03_1/customers > > > > -- > > Weinan Li > > > > > > On Thursday, January 16, 2014 at 1:16 AM, Kapil Gambhir wrote: > > > > > am trying to run the samples from the O'Reilly book (by Bill Burke) on Tomcat. Tried both for Tomcat 7 and 8. The ShoppingApplication deploys fine but when i try to POST a customer resource to /services/customers it gives me 404. > > > I built the war from the Maven for Chapter 3 example (ex03_1) and deployed that war on Tomcat and the deployment (Tomcat startup console) shows messages of ShoppingApplication being deployed. What am i missing, dont see any error message or any clue around what could be going wrong. > > > > > > Thanks in anticipation, > > > Kapil. > > > ------------------------------------------------------------------------------ > > > CenturyLink Cloud: The Leader in Enterprise Cloud Services. > > > Learn Why More Businesses Are Choosing CenturyLink Cloud For > > > Critical Workloads, Development Environments & Everything In Between. > > > Get a Quote or Start a Free Trial Today. > > > http://pubads.g.doubleclick.net/gampad/clk?id=119420431&iu=/4140/ostg.clktrk > > > > > > _______________________________________________ > > > Resteasy-users mailing list > > > Res...@li... (mailto: Res...@li...) (mailto: Res...@li...) > > > https://lists.sourceforge.net/lists/listinfo/resteasy-users > > > |
|
From: Bill B. <bb...@re...> - 2014-02-01 12:22:20
|
Tomcat 8 should support ServletContainerInitializer. Please read the 3.5 documentation you linked. It works with Jetty, so I don't know why it wouldn't work with Tomcat. On 2/1/2014 5:33 AM, Kapil Gambhir wrote: > I am using Tomcat 8.x which is a servlet 3.1 container, so the > expectation was that the example application should not require web.xml > (as per the documentation on > http://docs.jboss.org/resteasy/docs/3.0.6.Final/userguide/html_single/#d4e111). > The document seems to suggest that this is required for pre 3.0 servlet > containers. > > My bigger concern is that the app Path(i.e @ApplicationPath("/services") > ) annotation in the ShoppingApplication class (which is extending the > Application class) is ignored. So this path seems to be ignored totally > and the URL for Customer is (/ex03_1/customers) > <http://127.0.0.1:8080/ex03_1/customers> there is no "services" in this > URL. Does that mean that this annotation is not useful. > > Kapil. > <http://127.0.0.1:8080/ex03_1/customers> > > ---------- Forwarded message ---------- > From: *Weinan Li* <l.w...@gm... <mailto:l.w...@gm...>> > Date: Thu, Jan 16, 2014 at 5:31 PM > Subject: Re: [Resteasy-users] Running JAX-RS 2.0 O'Reilly book samples > on Tomcat.. > To: Kapil Gambhir <kap...@gm... <mailto:kap...@gm...>> > Cc: res...@li... > <mailto:res...@li...> > > > > > -- > Weinan Li > > > On Thursday, January 16, 2014 at 7:00 PM, Kapil Gambhir wrote: > > > Hi, > > thanks for a prompt response, am using the JAX-RS v2, so the > "oreilly-jaxrs-2.0-workbook/ex03_1”. > > I am able to run the example with the web.xml (http://web.xml) > changes suggested by you, it made sense also but am wondering how the > default example (shipped as a zip) worked on jetty (which is also a > servlet container only, pretty much like Tomcat). The examples download > has the Maven scripts which execute the test client using the Jetty and > that works fine without the web.xml (http://web.xml) changes. Any idea > on this one? > > my objective is to use a lightweight container to keep things simple > and fast. > > > I haven’t looked into details of Jetty, but the reason could only be > that Jetty supports JAX-RS2.0 spec out of box. > > > > > > On Thu, Jan 16, 2014 at 11:20 AM, Weinan Li <l.w...@gm... > <mailto:l.w...@gm...> (mailto:l.w...@gm... > <mailto:l.w...@gm...>)> wrote: > > > Hi Kapil, > > > > > > Are you using "oreilly-jaxrs-2.0-workbook/ex03_1” or > "oreilly-workbook/ex03_1”? The former one can only be deployed in a > JavaEE application server that supports JAX-RS 2.0 spec like WildFly, > because it doesn’t have standalone settings in web.xml (http://web.xml). > Please add following settings you web.xml (http://web.xml) if you want > to deploy it in tomcat: > > > > > > <servlet> > > > <servlet-name>Resteasy</servlet-name> > > > <servlet-class> > > > org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher > > > </servlet-class> > > > <init-param> > > > <param-name>javax.ws.rs.Application</param-name> > > > <param-value> > > > com.restfully.shop.services.ShoppingApplication > > > </param-value> > > > </init-param> > > > </servlet> > > > > > > <servlet-mapping> > > > <servlet-name>Resteasy</servlet-name> > > > <url-pattern>/*</url-pattern> > > > </servlet-mapping> > > > > > > > > > > > > In addition, if ex03_1.war is deployed into tomcat correctly you > should see the following log in catalina.out: > > > > > > resteasy.spi.ResteasyDeployment. Deploying > javax.ws.rs.core.Application: class > com.restfully.shop.services.ShoppingApplication > > > 16-Jan-2014 13:37:17.219 INFO [localhost-startStop-2] > org.jboss.resteasy.spi.ResteasyDeployment. Adding singleton resource > com.restfully.shop.services.CustomerResource from Application class > com.restfully.shop.services.ShoppingApplication > > > > > > > > > And then you can access it by http://127.0.0.1:8080/ex03_1/customers > > > > > > -- > > > Weinan Li > > > > > > > > > On Thursday, January 16, 2014 at 1:16 AM, Kapil Gambhir wrote: > > > > > > > am trying to run the samples from the O'Reilly book (by Bill > Burke) on Tomcat. Tried both for Tomcat 7 and 8. The ShoppingApplication > deploys fine but when i try to POST a customer resource to > /services/customers it gives me 404. > > > > I built the war from the Maven for Chapter 3 example (ex03_1) and > deployed that war on Tomcat and the deployment (Tomcat startup console) > shows messages of ShoppingApplication being deployed. What am i missing, > dont see any error message or any clue around what could be going wrong. > > > > > > > > Thanks in anticipation, > > > > Kapil. > > > > > ------------------------------------------------------------------------------ > > > > CenturyLink Cloud: The Leader in Enterprise Cloud Services. > > > > Learn Why More Businesses Are Choosing CenturyLink Cloud For > > > > Critical Workloads, Development Environments & Everything In Between. > > > > Get a Quote or Start a Free Trial Today. > > > > > http://pubads.g.doubleclick.net/gampad/clk?id=119420431&iu=/4140/ostg.clktrk > > > > > > > > _______________________________________________ > > > > Resteasy-users mailing list > > > > Res...@li... > <mailto:Res...@li...> > (mailto:Res...@li... > <mailto:Res...@li...>) > (mailto:Res...@li... > <mailto:Res...@li...>) > > > > https://lists.sourceforge.net/lists/listinfo/resteasy-users > > > > > > > > > > > > ------------------------------------------------------------------------------ > WatchGuard Dimension instantly turns raw network data into actionable > security intelligence. It gives you real-time visual feedback on key > security issues and trends. Skip the complicated setup - simply import > a virtual appliance and go from zero to informed in seconds. > http://pubads.g.doubleclick.net/gampad/clk?id=123612991&iu=/4140/ostg.clktrk > > > > _______________________________________________ > Resteasy-users mailing list > Res...@li... > https://lists.sourceforge.net/lists/listinfo/resteasy-users > -- Bill Burke JBoss, a division of Red Hat http://bill.burkecentral.com |
|
From: Bill B. <bb...@re...> - 2014-01-16 13:24:08
|
The examples use Jetty. Its probably just a context path issue. On 1/16/2014 12:50 AM, Weinan Li wrote: > Hi Kapil, > > Are you using "oreilly-jaxrs-2.0-workbook/ex03_1” or "oreilly-workbook/ex03_1”? The former one can only be deployed in a JavaEE application server that supports JAX-RS 2.0 spec like WildFly, because it doesn’t have standalone settings in web.xml. Please add following settings you web.xml if you want to deploy it in tomcat: > > <servlet> > <servlet-name>Resteasy</servlet-name> > <servlet-class> > org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher > </servlet-class> > <init-param> > <param-name>javax.ws.rs.Application</param-name> > <param-value> > com.restfully.shop.services.ShoppingApplication > </param-value> > </init-param> > </servlet> > > <servlet-mapping> > <servlet-name>Resteasy</servlet-name> > <url-pattern>/*</url-pattern> > </servlet-mapping> > > > > In addition, if ex03_1.war is deployed into tomcat correctly you should see the following log in catalina.out: > > resteasy.spi.ResteasyDeployment. Deploying javax.ws.rs.core.Application: class com.restfully.shop.services.ShoppingApplication > 16-Jan-2014 13:37:17.219 INFO [localhost-startStop-2] org.jboss.resteasy.spi.ResteasyDeployment. Adding singleton resource com.restfully.shop.services.CustomerResource from Application class com.restfully.shop.services.ShoppingApplication > > > And then you can access it by http://127.0.0.1:8080/ex03_1/customers > > -- > Weinan Li > > > On Thursday, January 16, 2014 at 1:16 AM, Kapil Gambhir wrote: > >> am trying to run the samples from the O'Reilly book (by Bill Burke) on Tomcat. Tried both for Tomcat 7 and 8. The ShoppingApplication deploys fine but when i try to POST a customer resource to /services/customers it gives me 404. >> I built the war from the Maven for Chapter 3 example (ex03_1) and deployed that war on Tomcat and the deployment (Tomcat startup console) shows messages of ShoppingApplication being deployed. What am i missing, dont see any error message or any clue around what could be going wrong. >> >> Thanks in anticipation, >> Kapil. >> ------------------------------------------------------------------------------ >> CenturyLink Cloud: The Leader in Enterprise Cloud Services. >> Learn Why More Businesses Are Choosing CenturyLink Cloud For >> Critical Workloads, Development Environments & Everything In Between. >> Get a Quote or Start a Free Trial Today. >> http://pubads.g.doubleclick.net/gampad/clk?id=119420431&iu=/4140/ostg.clktrk >> >> _______________________________________________ >> Resteasy-users mailing list >> Res...@li... (mailto:Res...@li...) >> https://lists.sourceforge.net/lists/listinfo/resteasy-users > > > > > ------------------------------------------------------------------------------ > CenturyLink Cloud: The Leader in Enterprise Cloud Services. > Learn Why More Businesses Are Choosing CenturyLink Cloud For > Critical Workloads, Development Environments & Everything In Between. > Get a Quote or Start a Free Trial Today. > http://pubads.g.doubleclick.net/gampad/clk?id=119420431&iu=/4140/ostg.clktrk > _______________________________________________ > Resteasy-users mailing list > Res...@li... > https://lists.sourceforge.net/lists/listinfo/resteasy-users > -- Bill Burke JBoss, a division of Red Hat http://bill.burkecentral.com |