2018

July

2017

September

May

2016

September

August

June

2015

September

August

June

January

2014

December

July

April

March

February

2013

December

August

July

March

2012

December

August

Using Guice with Jersey (2.6) 25 Mar 2014

Hi everyone,

In my company we love 2 things (among others), JAX-RS (Jersey) and dependency injection (Guice). We are used to those 2 implementations and we want to keep using them. But unfortunatly they do not really like each other … But things are getting better. The guys from Jersey have implemented a great feature (even if still far from being perfect) which is a kind of injection bridge.

Basically it lets you use your own dependency injection framework within Jersey. You are not forced to use HK2. In our case we want to use Guice.

But the setup of this bridge can be tricky, so one of my collegue from MYCOM decided to share the way we are able to make it work.

Please have a look to our repository where we share the code to make Jersey 2.6 and Guice work together. Do not hesitate to comment the code here.

comments powered by Disqus
This site was designed using jekyll, bootstrap, fontawesome, google analytics, disqus and is hosted on github. All for free so thank you!