On Thu, May 14, 2009 at 11:44 AM, Carl Hall <[email protected]> wrote:
> I'm working to create an OSGi bundle for Shindig.  I have almost
> everything loading up but can't get Guice to find the dependencies on
> servlets.  I get exceptions like below [1].  Has anyone else attempted
> to create a bundle like this?  Anyone know how to get around the Guice
> issues?  Something to note, Guice is coming from another package so I
> suspect that has something to do with it.

This is the key bit of information.  Guice 1.0 is not capable of
running in an OSGi environment in the is way.  Guice 2 is, so you
could try that since it is API compatible with Guice 1.0.

> I've also tried embedding
> Guice into my Shindig bundle and get the same results.
>
> [1] Problem accessing /gadgets/makeRequest. Reason:
>
>    java.lang.RuntimeException: com.google.inject.ProvisionException:
> Error while locating instance
>  bound to org.apache.shindig.gadgets.servlet.MakeRequestHandler
>  for member at
> org.apache.shindig.gadgets.servlet.MakeRequestServlet.setMakeRequestHandler(MakeRequestServlet.java:48)
>

When you create the Guice injector in this situation are you trying to
do it from another bundle or in the Activator of the bundle containing
Shindig and Guice.  Kicking everything off in an Activator in the same
bundle as Guice and Shindig "should" work.  But if you're trying from
a different bundle then you're going to have problems with Guice
unless you can get Guice 2.0 going.

Rich

Reply via email to