users@glassfish.java.net

Re: OSGI Web bundle

From: Sahoo <Sahoo_at_Sun.COM>
Date: Tue, 20 Oct 2009 17:08:40 +0530

Pavel Kuzin wrote:
> Hello!
>
> In this time glassfish do this:
>
>
> 1. Catching new bundle by autodeploy (autodeploy/bundles)
> INFO: Installed
> /usr/local/glassfish/glassfish/domains/domain1/autodeploy/bundles/RemotePayments-0.0.2.jar
>
> 2. Resolving it. -> RESOLVED STATE
> 3. bundle->start -> STARTING STATE
> 4. osgi-web-container installing webapp to container and tries
> initialise ServletContext.
> Webapp initialise Spring WebApplication context without OSGI.
> 5. get error because webapp needs OsgiBundleXmlWebApplicationContext
> java.lang.Exception: java.lang.IllegalStateException:
> ContainerBase.addChild: start: org.apache.catalina.LifecycleException:
> java.lang.IllegalArgumentException: bundle context should be set
> before refreshing the application context
Is there no stacktrace associated with the above
IllegalArgumentException? See if the server.log contains a WARNING
message with stacktrace or not. If you find it, send it as well. I guess
the exception is coming because you are accessing some Spring code in
the initialization path. Can you delay that till bundle.started event or
appropriate event sent by Spring extender?

Thanks,
Sahoo