no pb ;)

*Romain Manni-Bucau*
*Twitter: @rmannibucau*
*Blog: http://rmannibucau.wordpress.com*




2012/8/21 Todd Deshane <todd.deshane.excels...@gmail.com>

> Awesome. It works! Thanks so much for the help with this!
>
> On Tue, Aug 21, 2012 at 10:07 AM, Romain Manni-Bucau
> <rmannibu...@gmail.com> wrote:
> > you simply need to define the jaxrs application in your server.xml with
> the
> > application as class or with the annotation @ApplicationConfig
> >
> > you can have a look to
> >
> http://svn.apache.org/repos/asf/openejb/trunk/openejb/examples/rest-example-with-application/
> >
> > *Romain Manni-Bucau*
> > *Twitter: @rmannibucau*
> > *Blog: http://rmannibucau.wordpress.com*
> >
> >
> >
> >
> > 2012/8/21 Todd Deshane <todd.deshane.excels...@gmail.com>
> >
> >> On Tue, Aug 21, 2012 at 8:41 AM, Romain Manni-Bucau
> >> <rmannibu...@gmail.com> wrote:
> >> > location?
> >> >
> >>
> >> I do mean location, location is in the HTTP response header.
> >>
> >> > id you mean?
> >>
> >> The id is included in that path as well yes.
> >>
> >> > you can probably activate cxf logs adding
> *faultStackTraceEnabled=true*
> >> > *
> >> > *
> >> > you should be able to do so adding a file META-INF/resources.xml
> >> containing:
> >> >
> >> > <?xml version="1.0" encoding="UTF-8"?>
> >> > <resources>
> >> >   <Service class-name="org.foo.YourresourceBean">
> >> >     cxf.jaxrs.properties = config
> >> >   </Service>
> >> >
> >> >   <Service id="config" class-name="java.util.Properties">
> >> > faultStackTraceEnabled=true
> >> >   </Service>
> >> > </resources>
> >> >
> >>
> >> Cool. I added some debug code and figured out that the issue is with
> >> the customerDB object.
> >>
> >>
> >> Aug 21, 2012 9:14:14 AM org.apache.openejb.server.rest.RESTService
> >> deployPojo
> >> INFO: REST Service:
> http://localhost:8080/workbook-ex03_1-1.0/customers/.* -> P
> >> ojo com.restfully.shop.services.CustomerResource
> >> reading customer
> >> customerDB size: 1 (in POST)
> >> Created customer 1 (in POST)
> >> customerDB size: 0 (in GET)
> >> Aug 21, 2012 9:14:19 AM
> >> org.apache.cxf.jaxrs.impl.WebApplicationExceptionMapper
> >> toResponse
> >> WARNING: WebApplicationException has been caught : no cause is available
> >>
> >> I think what is happening is that the code assumes JAX-RS singleton
> >> mode (one and only one Java object services the HTTP requests), but I
> >> think that the JAX-RS in TomEE is probably set to per-request (a Java
> >> object is created to process each incoming request and is thrown away
> >> at the end of the request) [1]
> >>
> >> Is there a way to switch the JAX-RS with a configuration setting
> perhaps?
> >>
> >> Thanks,
> >> Todd
> >>
> >> [1] Concepts from RESTful Java with JAX-RS by Bill Burke
> >>
>

Reply via email to