Thank you.

-Anthony

On Mar 17, 2009, at 10:36 AM, Andy Pahne wrote:


I think the reason is: the context is iniitialized twice. Once by the filter you defined in your web.xml and once by tapestry-spring.

If you prefer tapestry-spring NOT initializing your context, then add this to your web.xml

<!-- tapestry-spring should not initialize spring context, we have a filter for that -->
  <context-param>
     <param-name>tapestry.use-external-spring-context</param-name>
     <param-value>true</param-value>
  </context-param>




Anthony Schexnaildre schrieb:
From my reading it seems Tap 5.1 is supposed to be backwards compatible with 5.0.18 but not quite there yet. I am running Tapestry in the same webapp as RestEasy. I am creating a root spring context that both resteasy and tapestry share. I just added 5.1 to try it out and I get an exception on jetty start up.

Caused by: org.apache.tapestry5.ioc.internal.OperationException: Cannot initialize context because there is already a root application context present - check whether you have multiple ContextLoader* definitions in your web.xml! at org .apache .tapestry5 .ioc.internal.OperationTrackerImpl.invoke(OperationTrackerImpl.java: 90) at org .apache .tapestry5 .ioc .internal .PerThreadOperationTracker.invoke(PerThreadOperationTracker.java:68) at org .apache .tapestry5.ioc.internal.RegistryImpl.invoke(RegistryImpl.java:939) at org.apache.tapestry5.internal.spring.SpringModuleDef $3.createObject(SpringModuleDef.java:166) at org.apache.tapestry5.ioc.internal.OperationTrackingObjectCreator $1.invoke(OperationTrackingObjectCreator.java:45) at org .apache .tapestry5 .ioc.internal.OperationTrackerImpl.invoke(OperationTrackerImpl.java: 68) at org .apache .tapestry5 .ioc .internal .PerThreadOperationTracker.invoke(PerThreadOperationTracker.java:68) at org .apache .tapestry5.ioc.internal.RegistryImpl.invoke(RegistryImpl.java:939) at org .apache .tapestry5 .ioc .internal .OperationTrackingObjectCreator .createObject(OperationTrackingObjectCreator.java:49) at org .apache .tapestry5 .ioc .internal .SingletonServiceLifecycle .createService(SingletonServiceLifecycle.java:29) at org .apache .tapestry5 .ioc .internal .LifecycleWrappedServiceCreator .createObject(LifecycleWrappedServiceCreator.java:52) at org .apache .tapestry5 .ioc .internal.AdvisorStackBuilder.createObject(AdvisorStackBuilder.java: 60) at org .apache .tapestry5 .ioc .internal .InterceptorStackBuilder.createObject(InterceptorStackBuilder.java: 52) at org .apache .tapestry5 .ioc .internal .RecursiveServiceCreationCheckWrapper .createObject(RecursiveServiceCreationCheckWrapper.java:60) at org.apache.tapestry5.ioc.internal.OperationTrackingObjectCreator $1.invoke(OperationTrackingObjectCreator.java:45) at org .apache .tapestry5 .ioc.internal.OperationTrackerImpl.invoke(OperationTrackerImpl.java: 68) at org .apache .tapestry5 .ioc .internal .PerThreadOperationTracker.invoke(PerThreadOperationTracker.java:68) at org .apache .tapestry5.ioc.internal.RegistryImpl.invoke(RegistryImpl.java:939) at org .apache .tapestry5 .ioc .internal .OperationTrackingObjectCreator .createObject(OperationTrackingObjectCreator.java:49) at org .apache .tapestry5 .ioc .internal .services .JustInTimeObjectCreator.createObject(JustInTimeObjectCreator.java: 65)
   ... 54 more
Caused by: java.lang.IllegalStateException: Cannot initialize context because there is already a root application context present - check whether you have multiple ContextLoader* definitions in your web.xml! at org.springframework.web.context.ContextLoader.initWebApplicationContext (ContextLoader.java:182) at org.apache.tapestry5.internal.spring.SpringModuleDef $3$1.invoke(SpringModuleDef.java:176) at org .apache .tapestry5 .ioc.internal.OperationTrackerImpl.invoke(OperationTrackerImpl.java: 68)
   ... 73 more
2009-03-17 10:15:13.154::INFO: Started selectchannelconnec...@0.0.0.0 :8080


web.xml:


<web-app>

   <display-name>PaymentObjects Webservices</display-name>
       <context-param>
       <param-name>resteasy.servlet.mapping.prefix</param-name>
       <param-value>/ws</param-value>
   </context-param>

   <context-param>
       <!--
The only significant configuration for Tapestry 5, this informs Tapestry of where to look for pages, components and mixins.
       -->
       <param-name>tapestry.app-package</param-name>
       <param-value>com.paymentobjects.webservices.site</param-value>
   </context-param>

   <context-param>
       <param-name>contextConfigLocation</param-name>
<param-value>classpath:webservices-client-context.xml classpath:webservices-context.xml</param-value>
   </context-param>

   <context-param>
       <param-name>locatorFactorySelector</param-name>
       <param-value>classpath:rootContext.xml</param-value>
   </context-param>

   <context-param>
       <param-name>parentContextKey</param-name>
       <param-value>ROOT_CONTEXT_KEY</param-value>
   </context-param>

   <filter>
       <filter-name>springSecurityFilterChain</filter-name>
<filter-class>org.springframework.web.filter.DelegatingFilterProxy </filter-class>
   </filter>

   <filter>
       <filter-name>app</filter-name>
<filter- class>org.apache.tapestry5.spring.TapestrySpringFilter</filter-class>
   </filter>

   <filter-mapping>
       <filter-name>springSecurityFilterChain</filter-name>
       <url-pattern>/*</url-pattern>
   </filter-mapping>

   <filter-mapping>
       <filter-name>app</filter-name>
       <url-pattern>/*</url-pattern>
   </filter-mapping>

   <listener>
<listener- class>org.jboss.resteasy.plugins.server.servlet.ResteasyBootstrap</ listener-class>
   </listener>

   <listener>
<listener- class >org.jboss.resteasy.plugins.spring.SpringContextLoaderListener</ listener-class>
   </listener>

   <listener>
<listener- class >org.springframework.security.ui.session.HttpSessionEventPublisher</ listener-class>
   </listener>

   <servlet>
       <servlet-name>webservices</servlet-name>
<servlet- class >org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher</ servlet-class>
   </servlet>

   <servlet-mapping>
       <servlet-name>webservices</servlet-name>
       <url-pattern>/ws/*</url-pattern>
   </servlet-mapping>

</web-app>




-Anthony


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org


Attachment: smime.p7s
Description: S/MIME cryptographic signature

Reply via email to