You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by John Langley <Jo...@mathworks.com> on 2009/02/20 22:36:18 UTC

glassfishv3-prelude & sling incubator-4

Just FYI... 

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. 

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

-- 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)


Re: glassfishv3-prelude & sling incubator-4

Posted by Felix Meschberger <fm...@gmail.com>.
Hi John,

John Langley schrieb:
> Thanks Felix, I haven't tried it yet, but that sounds great! 
> I hope to experiment with it later in the week. Thanks again!

You are welcome.

Regards
Felix

> 
> -- Langley 
> 
> On Sun, 2009-02-22 at 13:38 -0500, Felix Meschberger wrote:
> 
>> Hi John,
>>
>> Yet another reply ;-)
>>
>> In Rev. 746794 I have added a LauncherClassLoader which helps using
>> Sling inside Glassfish (at least in my simple setup here).
>>
>> Regards
>> Felix
>>
>> John Langley schrieb:
>>> Just FYI... 
>>>
>>> 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. 
>>>
>>> At any rate, I thought I'd let people know. 
>>>
>>> -- 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)
>>>
>>>
> 

Re: glassfishv3-prelude & sling incubator-4

Posted by John Langley <Jo...@mathworks.com>.
Thanks Felix, I haven't tried it yet, but that sounds great! 
I hope to experiment with it later in the week. Thanks again!

-- Langley 

On Sun, 2009-02-22 at 13:38 -0500, Felix Meschberger wrote:

> Hi John,
> 
> Yet another reply ;-)
> 
> In Rev. 746794 I have added a LauncherClassLoader which helps using
> Sling inside Glassfish (at least in my simple setup here).
> 
> Regards
> Felix
> 
> John Langley schrieb:
> > Just FYI... 
> > 
> > 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. 
> > 
> > At any rate, I thought I'd let people know. 
> > 
> > -- 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)
> > 
> > 

Re: glassfishv3-prelude & sling incubator-4

Posted by Felix Meschberger <fm...@gmail.com>.
Hi John,

Yet another reply ;-)

In Rev. 746794 I have added a LauncherClassLoader which helps using
Sling inside Glassfish (at least in my simple setup here).

Regards
Felix

John Langley schrieb:
> Just FYI... 
> 
> 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. 
> 
> At any rate, I thought I'd let people know. 
> 
> -- 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)
> 
> 

Re: glassfishv3-prelude & sling incubator-4

Posted by Felix Meschberger <fm...@gmail.com>.
Hi John,

John Langley schrieb:
> Just FYI... 
> 
> 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. 

OSGi in fact allows for running framework inside frameworks. Since there
are issues with this regarding the integration with the JVM, the R4.2
draft even contains RFC138 on this matter.

The problem IIRC with glassfish is, that the
org.osgi.framework.bootdelegation framework property is set to "*" (as I
said IIRC), which causes all classes from outside the framework are
visible inside the framework. I think they did this for backwards
compatibility for non-OSGi glassfish 2.

Regards
Felix

> 
> At any rate, I thought I'd let people know. 
> 
> -- 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)
> 
> 

Re: glassfishv3-prelude & sling incubator-4

Posted by Felix Meschberger <fm...@gmail.com>.
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)
> 
>