Hi John

John Langley schrieb:
> Just FYI... 

Thanks very interesting, indeed.

> 
> I tried loading the launchpad webapp into glassfishv3-prelude this
> afternoon and it threw  exception stack included below. 
> My guess is that this is related to there being different versions of
> the org.apache.felix.framework.Felix because glassfishv3-prelude also
> uses felix. Perhaps there's a work around by specifying a different
> import version in a sling manifest? 
> 
> I haven't tried to dig around, but osgi ~should~ allow us to have
> multiple versions, but being a relative newbie I realize this may be on
> the hairy edge of 'system bundle' space, which could be a limitation
> that's hard to work around. 

I think, this has less to do with OSGi, than with how class loaders are
built for the web application and how the web application is shielded
from the environment.

Generally, Sling builds creates a "master" URLClassLoader whose parent
is the web app classloader. In this URLClassLoader we load the Sling
base (or launcher) JAR file, which contains the Felix framework as well
as the OSGi Core and Compendium libraries and launcher glue.

Now, this being a standard class loader, it always asks the parent first
for any classes to be loaded. If Glassfish is now providing the Felix
framework classes they are loaded from there instead of its own launcher
JAR file.

This all is outside of OSGi and plain old classloading mechanism. Only
bundles inside the framework are shielded from the environment by the
framework.

Now, of course there is a possible solution: Instead of just asking the
parent classloader first, we could check whether the load request is for
a class provided in the Launcher Jar and only revert to the parent class
loader if the this would not be the case.

WDYT ?

> 
> At any rate, I thought I'd let people know. 

Thanks. This is appreciated.

Regards
Felix

> 
> -- Langley 
> 
> 
> 
> 
> 
> Feb 20, 2009 4:27:56 PM org.apache.catalina.core.ApplicationContext log
> SEVERE:
> WebModule[/org.apache.sling.launchpad.webapp-4-incubator-SNAPSHOT]sling:
> Failed to start Sling in
> sling/_org.apache.sling.launchpad.webapp-4-incubator-SNAPSHOT
> java.lang.NoSuchMethodError:
> org.apache.felix.framework.Felix.<init>(Ljava/util/Map;)V
>         at
> org.apache.sling.launchpad.base.impl.SlingFelix.<init>(SlingFelix.java:39)
>         at
> org.apache.sling.launchpad.base.impl.Sling.<init>(Sling.java:234)
>         at
> org.apache.sling.launchpad.base.webapp.SlingBridge.<init>(SlingBridge.java:42)
>         at
> org.apache.sling.launchpad.base.webapp.SlingServletDelegate.init(SlingServletDelegate.java:202)
>         at javax.servlet.GenericServlet.init(GenericServlet.java:270)
>         at
> org.apache.sling.launchpad.webapp.SlingServlet.startSling(SlingServlet.java:317)
>         at
> org.apache.sling.launchpad.webapp.SlingServlet.startSling(SlingServlet.java:254)
>         at
> org.apache.sling.launchpad.webapp.SlingServlet.init(SlingServlet.java:90)
>         at javax.servlet.GenericServlet.init(GenericServlet.java:270)
>         at
> org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1198)
>         at
> org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1038)
>         at
> org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4953)
>         at
> org.apache.catalina.core.StandardContext.start(StandardContext.java:5350)
>         at com.sun.enterprise.web.WebModule.start(WebModule.java:456)
>         at
> org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:922)
>         at
> org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:906)
>         at
> org.apache.catalina.core.StandardHost.addChild(StandardHost.java:696)
>         at
> com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:2205)
>         at
> com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:1890)
>         at
> com.sun.enterprise.web.WebApplication.start(WebApplication.java:85)
>         at
> com.sun.enterprise.v3.server.ApplicationLifecycle.start(ApplicationLifecycle.java:560)
>         at
> com.sun.enterprise.v3.server.ApplicationLifecycle.start(ApplicationLifecycle.java:547)
>         at
> com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:189)
>         at
> com.sun.enterprise.v3.server.ApplicationLoaderService.processApplication(ApplicationLoaderService.java:260)
>         at
> com.sun.enterprise.v3.server.ApplicationLoaderService.postConstruct(ApplicationLoaderService.java:97)
>         at
> com.sun.enterprise.v3.server.ApplicationLoaderInjector.postConstruct(ApplicationLoaderInjector.java:61)
>         at
> com.sun.hk2.component.AbstractWombImpl.inject(AbstractWombImpl.java:150)
>         at com.sun.hk2.component.ConstructorWomb
> $1.run(ConstructorWomb.java:90)
>         at java.security.AccessController.doPrivileged(Native Method)
>         at
> com.sun.hk2.component.ConstructorWomb.initialize(ConstructorWomb.java:87)
>         at
> com.sun.hk2.component.AbstractWombImpl.get(AbstractWombImpl.java:75)
>         at
> com.sun.hk2.component.SingletonInhabitant.get(SingletonInhabitant.java:58)
>         at
> com.sun.hk2.component.LazyInhabitant.get(LazyInhabitant.java:107)
>         at
> com.sun.hk2.component.AbstractInhabitantImpl.get(AbstractInhabitantImpl.java:60)
>         at
> com.sun.enterprise.v3.server.AppServerStartup.run(AppServerStartup.java:203)
>         at com.sun.enterprise.v3.server.AppServerStartup
> $1.run(AppServerStartup.java:116)
> 
> 

Reply via email to