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