users@glassfish.java.net

Re: JSF 2 pages spread over multiple OSGi bundles

From: Robert Anderson <ranomail_at_gmail.com>
Date: Thu, 4 Aug 2011 15:48:12 -0300

"GlassFish has a number of OSGi features exposed to the end user which are
all nicely documented in the official documentation."

Surely! I'm liking very much. Obviously a lot can still be improved, but
that's why we're here. Long life open source! ;)

So...

I'm trying to use CDI events but I'm receiving the exception below:

java.lang.IllegalStateException: Singleton not set for WebappClassLoader
(delegate=false; repositories=)
    at
org.glassfish.weld.ACLSingletonProvider$ACLSingleton.get(ACLSingletonProvider.java:110)
    at org.jboss.weld.Container.instance(Container.java:58)
    at
org.jboss.weld.resolution.ResolvableBuilder.checkQualifier(ResolvableBuilder.java:209)
    at
org.jboss.weld.resolution.ResolvableBuilder.addQualifier(ResolvableBuilder.java:174)
    at
org.jboss.weld.resolution.ResolvableBuilder.addQualifiers(ResolvableBuilder.java:202)
    at
org.jboss.weld.manager.BeanManagerImpl.resolveObserverMethods(BeanManagerImpl.java:474)
    at
org.jboss.weld.manager.BeanManagerImpl.fireEvent(BeanManagerImpl.java:625)
    at org.jboss.weld.event.EventImpl.fire(EventImpl.java:75)
    at
ranophoenix.osgijee.webclient.impl.cdi.ModuleExtensionListener.serviceChanged(ModuleExtensionListener.java:45)
    at
org.apache.felix.framework.util.EventDispatcher.invokeServiceListenerCallback(EventDispatcher.java:871)
    at
org.apache.felix.framework.util.EventDispatcher.fireEventImmediately(EventDispatcher.java:733)
    at
org.apache.felix.framework.util.EventDispatcher.fireServiceEvent(EventDispatcher.java:662)
    at org.apache.felix.framework.Felix.fireServiceEvent(Felix.java:3769)
    at org.apache.felix.framework.Felix.access$000(Felix.java:80)
    at org.apache.felix.framework.Felix$2.serviceChanged(Felix.java:722)
    at
org.apache.felix.framework.ServiceRegistry.unregisterService(ServiceRegistry.java:135)
    at
org.apache.felix.framework.ServiceRegistrationImpl.unregister(ServiceRegistrationImpl.java:129)
    at
org.apache.felix.framework.ServiceRegistry.unregisterServices(ServiceRegistry.java:178)
    at org.apache.felix.framework.Felix.stopBundle(Felix.java:2227)
    at org.apache.felix.framework.BundleImpl.stop(BundleImpl.java:958)
    at
org.apache.felix.shell.impl.StopCommandImpl.execute(StopCommandImpl.java:93)
    at
org.apache.felix.shell.impl.Activator$ShellServiceImpl.executeCommand(Activator.java:286)
    at
org.apache.felix.webconsole.internal.misc.ShellServlet.doPost(ShellServlet.java:93)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:755)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:848)
    at
org.apache.felix.webconsole.internal.servlet.OsgiManager.service(OsgiManager.java:428)
    at
org.apache.felix.webconsole.internal.servlet.OsgiManager.service(OsgiManager.java:375)
    at
org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1534)
    at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:281)
    at
org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:655)
    at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:595)
    at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:171)
    at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164)
    at
org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:326)
    at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:227)
    at
com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:170)
    at
com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:822)
    at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:719)
    at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1013)
    at
com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:225)
    at
com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137)
    at
com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104)
    at
com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90)
    at
com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79)
    at
com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54)
    at
com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59)
    at com.sun.grizzly.ContextTask.run(ContextTask.java:71)
    at
com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532)
    at
com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513)
    at java.lang.Thread.run(Thread.java:662)



Source code:
http://code.google.com/p/osgijee/source/browse/webclient/src/main/java/ranophoenix/osgijee/webclient/impl/cdi/ModuleExtensionListener.java


Suggestions?


Thanks in advance,

Robert

On Thu, Aug 4, 2011 at 11:32 AM, Jason Lee <jason.d.lee_at_oracle.com> wrote:

> While not perfect, GlassFish has a number of OSGi features exposed to the
> end user which are all nicely documented in the official documentation.
> What this user is trying to do is a pretty specific use case, so it's not
> something we have had to investigate yet. Oddly enough, though, I was
> recently requested to do exactly this same thing, so I'll be looking into
> this as well.
>
> We can't cover every use case a user might have, but we try to cover the
> big ones. The others we'll fill in as we can when the need arises. This
> is, though, an open source effort, so there's always room for someone to
> jump in and help, as is the case here. :)
>
>
> On 8/4/11 6:48 AM, Martin Gainty wrote:
>
> your product is suffering mr ellison...
> why doesnt larry open his wallet and hire some of the millions of unpaid
> engineers that support this product?
> JBoss is no picnic but at least RH PAYS their engineers to put OSGI
> features in JBoss
>
> 'Nuf said
> Martin Gainty
>
> --
> Jason Lee
> Senior Member of Technical Staff
> GlassFish REST API / Administration Console
>
> Oracle Corporation
> Phone +1 405-216-3193
> Blog http://blogs.steeplesoft.com
>
>