users@jersey.java.net

Jersey and Spring

From: Lars Tackmann <lars_at_randompage.org>
Date: Sun, 6 Jul 2008 16:05:52 +0200

Hi

I recently tried out the jersey-spring integration. Unfortunately I
have yet to get it working.
My web.xml looks like this:

http://svn.randompage.org/java/samples/jax-rs/acegi/src/main/webapp/WEB-INF/web.xml

a example resource is available here:

http://svn.randompage.org/java/sampales/jax-rs/acegi/src/main/java/org/randompage/samples/jaxrs/acegi/resources/UsersResource.java

this resource works fine if I autowire it by hand (i.e use the
standard Jersey servlet and start spring myself) but when I run it
with the Jersey Spring servlet
then something goes completely wrong. The resource still gets
autowired, but my responses are not working out anymore i.e.

--
return Response.created(uri).entity(user).build();
--
does not result in my client getting a 201 response code, instead it
always recives 200. This happens regardless of what I do in my
resource code i.e. adding:
--
if(true)
	new WebApplicationException(Status.INTERNAL_SERVER_ERROR);
--
still results in 200 OK. It is properly me who have missed something
obvious so any help is welcome. A working
Jersey/Spring example (suing the new jersey-spring module) would be
top notch (especially if I can see the full
web.xml/applicationContext.xml files).
Thanks in advance
-- 
Yours sincerely
Lars Tackmann
1) pom.xml http://svn.randompage.org/java/samples/jax-rs/acegi/pom.xml
2) applicationContext.xml
http://svn.randompage.org/java/samples/jax-rs/acegi/src/main/resources/applicationContext.xml
3) security config:
http://svn.randompage.org/java/samples/jax-rs/acegi/src/main/resources/springSecurity.xml