0 Replies Latest reply: Jun 24, 2011 8:11 PM by susmit Shukla RSS

ShrinkWrap in OSGi container not working

susmit Shukla Newbie

I'm trying to use shrinkwrap as a OSGi bundle, basically to create and deploy bundles in a JUnit test case running inside geronimo 3 container.


When I created bundles out of spi, impl and api.jar for ShrinkWrap version Beta 3, there were classloading issues in OSGi container since SW uses thread context loader.

Then I bundled all jars into a single bundle, It runs fine when the bundle using SW is first started but fails when bundle is restarted with this error:


Caused by: java.lang.ClassCastException: Incorrect expected type, org.jboss.shrinkwrap.api.ExtensionLoader, defined for org.jboss.shrinkwrap.impl.base.ServiceExtensionLoader

    at org.jboss.shrinkwrap.api.SecurityActions.newInstance(SecurityActions.java:169)

    at org.jboss.shrinkwrap.api.ConfigurationBuilder.createDefaultExtensionLoader(ConfigurationBuilder.java:251)

    at org.jboss.shrinkwrap.api.ConfigurationBuilder.setDefaults(ConfigurationBuilder.java:220)

    at org.jboss.shrinkwrap.api.Configuration.<init>(Configuration.java:85)

    at org.jboss.shrinkwrap.api.ConfigurationBuilder.build(ConfigurationBuilder.java:163)

    at org.jboss.shrinkwrap.api.ShrinkWrap.createDomain(ShrinkWrap.java:93)

    at org.jboss.shrinkwrap.api.ShrinkWrap.createDomain(ShrinkWrap.java:71)

    at org.jboss.shrinkwrap.api.ShrinkWrap$DefaultDomainWrapper.<init>(ShrinkWrap.java:227)

    at org.jboss.shrinkwrap.api.ShrinkWrap$DefaultDomainWrapper.<clinit>(ShrinkWrap.java:222)


Is there is working version of SW OSGi bundle?

I went through a jira task ShrinkWrap-242 ,it says this issue is fixed in Beta 1, but still the jars are not OSGi bundles when I look in the manifests.