users@jersey.java.net

[Jersey] jersey-guice based on spring-guice

From: Kariem Hussein <kariem.hussein_at_gmail.com>
Date: Fri, 18 Oct 2013 11:13:18 +0200

Hi,

I tried the examples from JERSEY-1957 and another example [2] with limited
success. Especially for components that should be created by guice (proxies
for transactions) I could not find a good solution.

So I thought, I follow the implementation for Spring [3] and do the same
for Guice. I have forked the current jersey master on github and added the
following modules:

- jersey-guice – https://github.com/kariem/jersey/tree/master/ext/guice
- example webapp –
https://github.com/kariem/jersey/tree/master/examples/helloworld-guice-webapp

Still, I have a problem with registering providers (and probably other
things like Features), as can be seen, when you try to use the custom
exception mapper for IllegalArgumentException
on helloworld-guice-webapp/guice-singleton-hello?p1=foobar.

Any suggestions? I really don't know HK2, so there might be a few things I
have done wrong.

Thank you,
Kariem


[1] https://java.net/jira/browse/JERSEY-1950
[2] https://github.com/piersy/jersey2-guice-example-with-test
[3] https://java.net/jira/browse/JERSEY-1957,
https://github.com/jersey/jersey/tree/master/ext/spring3