--
You received this message because you are subscribed to the Google Groups "google-guice" group.
To post to this group, send email to google...@googlegroups.com.
To unsubscribe from this group, send email to google-guice...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-guice?hl=en.
On github there is a minimal working Jersey + Guice application that
might serve as a starting point for modification for your service.
https://github.com/sunnygleason/j4-minimal
In particular, I think that the reason your Resource class isn't
getting injected is because you are using the Jersey ServletContainer
as your servlet in your web.xml. Guice servlet is different; the
request is handled at the filter level, and any servlets configured in
the web.xml should (ideally) never be called.
I think you will need, at the end of EventosModule, after the "filter"
line, to add:
Map<String,String> jerseyParams = new HashMap<String,String>();
jerseyParams.put("com.sun.jersey.config.property.packages",
"br.impa.apps.eventos.ws");
serve("/ws/*").with(GuiceContainer.class, jerseyParams);
Also note that if you declare all of your Resource classes with
"bind()" calls as Mischa suggests, then you don't need the
jerseyParams argument.
Please carefully read the docs on Guice Servlet:
http://code.google.com/p/google-guice/wiki/ServletModule
Good luck,
Christopher
C
On 6/21/11, Gabriel Cardelli <gabrielcasti...@gmail.com> wrote:
> Ok Chris, sorry.
>
> I'm configuring.
> *-----------------------------------*
> * Gabriel Cardelli
> ** Software Developer
> ** **gabrcardelli.appspot.com*
> *
> -----------------------------------
> *
> *
>
>
> *
--
Sent from my mobile device
At this point I don't know what might be causing your startup errors.
I recommend starting with a working example such as the j4-minimal
sample, and slowly replacing it with your own code.
Good luck,
Christopher