I think I'm pretty close. Here's the GuiceConfig I'm using:
public class GuiceServletConfig extends JerseyGuiceServletContextListener {
@Override
protected List<? extends Module> modules() {
AbstractModule module = new ServletModule() {
@Override
protected void configureServlets() {
// bind the rest resource.
bind(EngineResource.class);
/* bind jackson converters for JAXB/JSON serialization */
bind(MessageBodyReader.class).to(JacksonJaxbJsonProvider.class);
bind(MessageBodyWriter.class).to(JacksonJaxbJsonProvider.class);
// general use bindings.
bind(EngineInvoker.class).to(GroovyEngine.class);
bind(ResourceLoader.class).to(ActivititiResourceProvider.class);
serve("/rest/*").with(JerseySingletonServlet.class);
}
@Provides
@Singleton
ProcessEngine getProcessEngine() {
return ProcessEngines.getDefaultProcessEngine();
}
};
return Lists.newArrayList(module);
}
}
JerseySingletonServlet is just an extension of ServletContainer tagged as a
Singleton. The problem is that the binding for the resource doesn't seem to
be picked up. I get 404's for all the jersey paths.
On Wednesday, September 17, 2014 9:26:44 AM UTC-5, opn wrote:
>
> +1 for a working sample webapp, please!
>
> On Wed, Sep 17, 2014 at 4:04 PM, David Parish <[email protected]
> <javascript:>> wrote:
>
>> This really is terrific and very helpful. Can you add a working sample
>> webapp to help folks get started quickly?
>>
>> On Monday, August 4, 2014 11:25:39 AM UTC-5, Roger Kapsi wrote:
>>>
>>> We're using Guice at Squarespace and a different project we depend on is
>>> about to switch to Jersey 2.0. We've therefore taken a dive into HK2 and
>>> figured out why it didn't play nice with Guice (see JERSEY-2551). They
>>> fixed it in Jersey 2.11+ and the library is backwards compatible to Jersey
>>> 2.9.x.
>>>
>>> https://github.com/Squarespace/jersey2-guice
>>>
>>> We hope it's useful for other Guice users and contributions and feedback
>>> are very welcome.
>>>
>>> Thanks,
>>> Roger
>>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "google-guice" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to [email protected] <javascript:>.
>> To post to this group, send email to [email protected]
>> <javascript:>.
>> Visit this group at http://groups.google.com/group/google-guice.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/google-guice/07ec2e6e-d838-491a-9838-3342e7896bc4%40googlegroups.com
>>
>> <https://groups.google.com/d/msgid/google-guice/07ec2e6e-d838-491a-9838-3342e7896bc4%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
--
You received this message because you are subscribed to the Google Groups
"google-guice" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/google-guice.
To view this discussion on the web visit
https://groups.google.com/d/msgid/google-guice/fa7bfd5c-295f-4a2b-884c-293e05306a84%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.