Your problem is due to the fact that Spring is expecting a custom
session property which is the bundle context. This is not specified by
the HttpService specs so it is not a Pax Web or Pax Web Extender
problem. But because I had been asked by somebody else about the same
problem I will do something related and let you know this days.

On Thu, Apr 9, 2009 at 6:21 PM, Olga Kudryavtseva
<okudryavts...@griddynamics.com> wrote:
> Hi All,
> I use Pax Web and Pax Web War Extender to deploy my small Spring application
> in Equinox framework.
> The problem is that when I try to start my servlet bundle I have the
> exception:
> INFO  (org.springframework.web.context.ContextLoader) - Root
> WebApplicationContext: initialization started
>  ERROR (org.springframework.web.context.ContextLoader) - Context
> initialization failed
> java.lang.IllegalArgumentException: bundle context should be set before
> refreshing the application context
> at org.springframework.util.Assert.notNull(Assert.java:112)
> at
> org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.normalRefresh(AbstractDelegatedExecutionApplicationContext.java:140)
> at
> org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext$NoDependenciesWaitRefreshExecutor.refresh(AbstractDelegatedExecutionApplicationContext.java:73)
> at
> org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.refresh(AbstractDelegatedExecutionApplicationContext.java:136)
> at
> org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:255)
> at
> org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:199)
> at
> org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:45)
> at
> org.ops4j.pax.web.service.internal.HttpServiceContext$1.call(HttpServiceContext.java:160)
> at
> org.ops4j.pax.web.service.internal.HttpServiceContext$1.call(HttpServiceContext.java:158)
> at
> org.ops4j.pax.swissbox.core.ContextClassLoaderUtils.doWithClassLoader(ContextClassLoaderUtils.java:60)
> at
> org.ops4j.pax.web.service.internal.HttpServiceContext.addEventListener(HttpServiceContext.java:153)
> at
> org.ops4j.pax.web.service.internal.JettyServerImpl.addEventListener(JettyServerImpl.java:233)
> at
> org.ops4j.pax.web.service.internal.ServerControllerImpl$Started.addEventListener(ServerControllerImpl.java:224)
> at
> org.ops4j.pax.web.service.internal.ServerControllerImpl.addEventListener(ServerControllerImpl.java:110)
> at
> org.ops4j.pax.web.service.internal.HttpServiceStarted.registerEventListener(HttpServiceStarted.java:336)
> at
> org.ops4j.pax.web.service.internal.HttpServiceProxy.registerEventListener(HttpServiceProxy.java:130)
> at
> org.ops4j.pax.web.extender.war.internal.RegisterWebAppVisitorWC.visit(RegisterWebAppVisitorWC.java:264)
> at
> org.ops4j.pax.web.extender.war.internal.model.WebApp.accept(WebApp.java:513)
> at
> org.ops4j.pax.web.extender.war.internal.WebAppPublisher$HttpServiceListener.register(WebAppPublisher.java:170)
> at
> org.ops4j.pax.web.extender.war.internal.WebAppPublisher$HttpServiceListener.serviceChanged(WebAppPublisher.java:155)
> at
> org.ops4j.pax.web.extender.war.internal.WebAppPublisher$HttpServiceListener.serviceChanged(WebAppPublisher.java:119)
> ...
> This exception didn't occur when I
> used org.springframework.osgi.web.extender bundle. So, I think that the
> source of the problem maybe in
>  org.ops4j.pax.web.extender.war.internal.WebAppHttpContext , which
> registered instead
> of org.springframework.osgi.web.context.support.OsgiBundleXmlWebApplicationContext
> This is a fragment of my web.xml file:
>     <servlet>
>         <servlet-name>myServlet</servlet-name>
>
>  <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
>         <init-param>
>             <param-name>contextClass</param-name>
>
>  <param-value>org.springframework.osgi.web.context.support.OsgiBundleXmlWebApplicationContext</param-value>
>         </init-param>
>         <load-on-startup>1</load-on-startup>
>     </servlet>
>     <!-- Map URL pattern to a servlet-->
>     <servlet-mapping>
>         <servlet-name>myServlet</servlet-name>
>         <url-pattern>/services/*</url-pattern>
>     </servlet-mapping>
>     <context-param>
>         <param-name>contextClass</param-name>
>
>  <param-value>org.springframework.osgi.web.context.support.OsgiBundleXmlWebApplicationContext</param-value>
>     </context-param>
>     <listener>
>
> <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
>     </listener>
> This is a list of bundles:
> id      State       Bundle
> 0       ACTIVE      org.eclipse.osgi_3.4.0.v20080605-1900
> 1       ACTIVE      org.eclipse.equinox.common_3.4.0.v20080421-2006
> 2       ACTIVE      org.eclipse.osgi.services_3.1.200.v20070605
> 3       ACTIVE      org.eclipse.update.configurator_3.2.100.v20070615
> 4       ACTIVE      org.apache.felix.configadmin_1.0.10
> 5       ACTIVE      org.ops4j.pax.configmanager_0.2.2
> 6       ACTIVE      org.ops4j.pax.logging.pax-logging-api_1.3.0
> 7       ACTIVE      org.ops4j.pax.logging.pax-logging-service_1.3.0
> 8       RESOLVED    com.springsource.net.sf.cglib_2.1.3
> 9       RESOLVED    com.springsource.org.aopalliance_1.0.0
> 10      RESOLVED    com.springsource.org.apache.commons.codec_1.3.0
> 11      RESOLVED    com.springsource.org.apache.commons.collections_3.2.0
> 12      RESOLVED    com.springsource.org.apache.commons.lang_2.1.0
> 13      RESOLVED    com.springsource.org.apache.commons.logging_1.1.1
> 14      RESOLVED    org.apache.felix.javax.servlet_1.0.0
> 15      RESOLVED    org.ops4j.base.lang_0.5.0
> 16      RESOLVED    org.ops4j.base.util.collections_0.5.0
> 17      RESOLVED    org.ops4j.base.util.xml_0.5.0
> 19      RESOLVED    org.apache.servicemix.bundles.cglib-2.1_3_1.0.0.m3
> 20      RESOLVED    org.osgi.compendium_4.0.0
> 21      RESOLVED    org.osgi.core_4.0.0
> 22      RESOLVED    org.springframework.aop_2.5.6.A
> 23      RESOLVED    org.springframework.beans_2.5.6.A
> 24      RESOLVED    org.springframework.context_2.5.6.A
> 25      RESOLVED    org.springframework.core_2.5.6.A
> 26      RESOLVED    org.springframework.osgi.core_1.1.2.B
> 27      RESOLVED    org.springframework.osgi.extender_1.1.2.B
> 28      RESOLVED    org.springframework.osgi.io_1.1.2.B
> 29      RESOLVED    org.springframework.osgi.web_1.1.2.B
> 30      RESOLVED    org.springframework.security_2.0.4.A
> 31      RESOLVED    org.springframework.transaction_2.5.6.A
> 32      RESOLVED    org.springframework.web_2.5.6.A
> 33      RESOLVED    org.springframework.web.servlet_2.5.6.A
> 37      RESOLVED    org.ops4j.pax.swissbox.core_0.2.0
> 38      RESOLVED    org.ops4j.pax.swissbox.extender_0.2.0
> 39      RESOLVED    org.ops4j.pax.swissbox.lifecycle_0.2.0
> 40      RESOLVED    org.ops4j.pax.swissbox.optional.jcl_0.2.0
> 41      RESOLVED    org.ops4j.pax.swissbox.tracker_0.2.0
> 42      ACTIVE      org.ops4j.pax.web.extender.war_0.5.0
> 43      ACTIVE      org.ops4j.pax.web.service_0.5.2
> 44      RESOLVED    org.mortbay.jetty.servlet-api-2.5_2.5.0
> 45      ACTIVE      com.griddynamics.servlet_2.0.0.SNAPSHOT
>
> I will be very grateful for any help.
> Best regards,
> Olga Kudryavtseva,
> www.griddynamics.com
>
>
> _______________________________________________
> general mailing list
> general@lists.ops4j.org
> http://lists.ops4j.org/mailman/listinfo/general
>
>



-- 
Alin Dreghiciu
http://www.ops4j.org - New Energy for OSS Communities - Open
Participation Software.
http://www.qi4j.org - New Energy for Java - Domain Driven Development.
Looking for a job.
Sent from Cluj-Napoca, CJ, Romania

_______________________________________________
general mailing list
general@lists.ops4j.org
http://lists.ops4j.org/mailman/listinfo/general

Reply via email to