Shindig Bundle Status

28 views
Skip to first unread message

Carl Hall

unread,
May 4, 2009, 4:06:56 PM5/4/09
to sakai-...@googlegroups.com
I have a Shindig bundle building and installing but it is missing a
lot of dependencies. I've tried the following and am open to any
suggestions.

BND plugin:
<Bundle-Category>sakai-kernel</Bundle-Category>
<Bundle-Activator>${pom.artifactId}.Activator</Bundle-Activator>
<Export-Package>org.apache.shindig.*</Export-Package>
<Import-Package>*</Import-Package>

I've also tried w/ and w/o Embed-Dependency listing all the missing
packages stated by felix which is a quite sizable list. Nothing seems
to clear up my missing dependencies. Any suggestions?

Josh Holtzman

unread,
May 4, 2009, 4:46:04 PM5/4/09
to sakai-...@googlegroups.com
Carl,
Are you embedding package names, or dependency names? Embed dependency
should look something like:

<Embed-Dependency>derby</Embed-Dependency>

Josh

Ian Boston

unread,
May 4, 2009, 5:28:23 PM5/4/09
to sakai-...@googlegroups.com

Carl
Have a look at the jaxrs bundle. This embeds a lot of dependencies.
Ian

Carl Hall

unread,
May 5, 2009, 9:00:32 AM5/5/09
to sakai-...@googlegroups.com
I've been listing package names in embed-dependency. Any suggestions
as to what to use for a dependency name for a given package name? Is
it the maven artifact name?

Josh Holtzman

unread,
May 5, 2009, 9:10:42 AM5/5/09
to sakai-...@googlegroups.com
Is
it the maven artifact name?
Yes it is.

Carl Hall

unread,
May 5, 2009, 5:34:10 PM5/5/09
to sakai-...@googlegroups.com
End of day status: we now have a Shindig bundle that will go "Active"
when deployed to OSGi.

If anybody wants to give this a test drive, my git repo is
git://github.com/thecarlhall/open-experiments.git. It's in the master
branch.

I can't access any of the /gadgets URLs yet (404 error) but the
/social URLs give the exception below [2]. Aaron suggested I need to
use Pax Web [1] to fix this so I'll give that a gander tomorrow.

[1] http://wiki.ops4j.org/display/paxweb/Http+Service+Extensions

[2] Problem accessing /social/rest. Reason:
Guice Injector not found! Make sure you registered
org.apache.shindig.common.servlet.GuiceServletContextListener as a
listener

Caused by:
javax.servlet.UnavailableException: Guice Injector not found! Make
sure you registered
org.apache.shindig.common.servlet.GuiceServletContextListener as a
listener
at org.apache.shindig.common.servlet.InjectedServlet.init(InjectedServlet.java:42)
at org.mortbay.jetty.servlet.ServletHolder.initServlet(ServletHolder.java:431)
at org.mortbay.jetty.servlet.ServletHolder.doStart(ServletHolder.java:263)
at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)

Ian Boston

unread,
May 6, 2009, 1:30:47 AM5/6/09
to sakai-...@googlegroups.com
Hey carl, very cool.... party :)

The exception is becuase you will need to pretend that the
GuiceServletContextListener has started in the context when the bundle
comes up.
That context needs to be the same as a the context you give the
servlets. I think you have this when you inject the servlets into the
http service ?
Ian

Carl Hall

unread,
May 6, 2009, 1:30:45 PM5/6/09
to sakai-...@googlegroups.com
I have everything wired up now using Pax Web but am getting the
following exception when the listener tries to initialize. Any
thoughts?

Caused by: java.lang.NoClassDefFoundError:
com/google/inject/cglib/reflect/FastClass
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:621)
... 56 more
Caused by: java.lang.ClassNotFoundException:
com.google.inject.cglib.reflect.FastClass
at org.apache.felix.framework.searchpolicy.ModuleImpl.findClassOrResourceByDelegation(ModuleImpl.java:565)
at org.apache.felix.framework.searchpolicy.ModuleImpl.access$100(ModuleImpl.java:59)
at org.apache.felix.framework.searchpolicy.ModuleImpl$ModuleClassLoader.loadClass(ModuleImpl.java:1434)
at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
... 58 more

Carl Hall

unread,
May 6, 2009, 2:33:57 PM5/6/09
to sakai-...@googlegroups.com
I was able to fix the exception below by adding
"com.google.inject.cglib.reflect" to the Import-Package list.

I can go to /social/rest/* and /social/rpc/* as noted in the Shidig
docs [1] and get back real json data! Yippee!
However, I get Guice exceptions when I try to access things at the
/gadgets/* URLs. See below for example of exception and all
suggestions welcome.

HTTP ERROR 503

Problem accessing /gadgets/metadata. Reason:

java.lang.RuntimeException: com.google.inject.ProvisionException:
Error while locating instance
bound to org.apache.shindig.gadgets.servlet.JsonRpcHandler
for member at
org.apache.shindig.gadgets.servlet.RpcServlet.setJsonRpcHandler(RpcServlet.java:54)

Caused by:

javax.servlet.UnavailableException: java.lang.RuntimeException:
com.google.inject.ProvisionException: Error while locating instance
bound to org.apache.shindig.gadgets.servlet.JsonRpcHandler
for member at
org.apache.shindig.gadgets.servlet.RpcServlet.setJsonRpcHandler(RpcServlet.java:54)
at org.mortbay.jetty.servlet.ServletHolder.makeUnavailable(ServletHolder.java:406)
at org.mortbay.jetty.servlet.ServletHolder.initServlet(ServletHolder.java:449)
at org.mortbay.jetty.servlet.ServletHolder.doStart(ServletHolder.java:263)
at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
at org.mortbay.jetty.servlet.ServletHandler.initialize(ServletHandler.java:676)
at org.mortbay.jetty.servlet.ServletHandler.updateMappings(ServletHandler.java:1044)
at org.mortbay.jetty.servlet.ServletHandler.setServletMappings(ServletHandler.java:1101)
at org.mortbay.jetty.servlet.ServletHandler.addServletMapping(ServletHandler.java:800)
at org.ops4j.pax.web.service.internal.JettyServerImpl$1.call(JettyServerImpl.java:139)
at org.ops4j.pax.web.service.internal.JettyServerImpl$1.call(JettyServerImpl.java:136)

Carl Hall

unread,
May 6, 2009, 2:34:26 PM5/6/09
to sakai-...@googlegroups.com

Ian Boston

unread,
May 6, 2009, 4:15:54 PM5/6/09
to sakai-...@googlegroups.com
Are you packaging the guice and google collections ?

If you are, you should not be ,as these are in the guice bundle and
having them local might mask other issues.

Just a thought.
Ian

Carl Hall

unread,
May 6, 2009, 4:50:12 PM5/6/09
to sakai-...@googlegroups.com
I'm not embedding guice but I was embedding google collections. I've
now removed it and rebuilt with the same results.

BTW, I've replaced
<Embed-Dependency>*;scope=compile|runtime</Embed-Dependency> with an
explicit list of what artifacts to bring in. This has made it
possible for me to pick and choose exactly what I want in the build
with less alchemy. I plan on writing up somewhere the process I
followed to create the shindig bundle.

Ian Boston

unread,
May 6, 2009, 4:59:21 PM5/6/09
to sakai-...@googlegroups.com

On 6 May 2009, at 21:50, Carl Hall wrote:

>
> I'm not embedding guice but I was embedding google collections. I've
> now removed it and rebuilt with the same results.

Ok cool.

>
>
> BTW, I've replaced
> <Embed-Dependency>*;scope=compile|runtime</Embed-Dependency> with an
> explicit list of what artifacts to bring in. This has made it
> possible for me to pick and choose exactly what I want in the build
> with less alchemy. I plan on writing up somewhere the process I
> followed to create the shindig bundle.

That would be really good for those that follow. Its hard enough to
make this bit work so every little helps (oops that a (tm) in the uk :))

Ian
Reply all
Reply to author
Forward
0 new messages