cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thorsten Scherler <thorsten.scherler....@juntadeandalucia.es>
Subject Re: [2.2] Weird NPE when concurrency
Date Fri, 01 Feb 2008 09:26:45 GMT
On Thu, 2008-01-31 at 22:42 +0100, Reinhard Poetz wrote:
> Thorsten Scherler wrote:
> > On Thu, 2008-01-31 at 21:41 +0100, Reinhard Poetz wrote:
> >> Thorsten Scherler wrote:
> >>> Hi all,
> >>>
> >>> we have build a webapp based on cocoon 2.2. Everything is working fine
> >>> if a single person is using the app, but as soon as we have concurrent
> >>> user the code fails with NPE in different lines of the code.
> >>>
> >>> My questions are:
> >>> Every pipeline is thread safe, right?
> >>> The mounts to the different servlet (blocks) is synchronized, right?
> >>> Is there a connection timeout for inner block communications?
> >>>
> >>> The architecture is as follow:
> >>> main webapp - mounts dispatcher sitemap (from block)
> >>>
> >>> Main match:
> >>>  <map:match pattern="**.html">
> >>>         <map:generate src="lm://resolve.structurer.{1}" type="jx">
> >>>           <map:parameter name="lenient-xpath" value="true"/>
> >>>           <map:parameter name="getRequest" value="{1}"/>
> >>>           <map:parameter name="contextPath"
> >>> value="{request:contextPath}"/>
> >>>           <map:parameter name="getRequestExtension" value="html"/>
> >>>         </map:generate>
> >>>         <map:transform type="dispatcher">
> >>>           <map:parameter name="cacheKey" value="{0}"/>
> >>>           <map:parameter name="validityFile"
> >>>             value="lm://resolve.structurer.{1}"/>
> >>>           <map:parameter name="request" value="{1}"/>
> >>>           <map:parameter name="type" value="html"/>
> >>>           <map:parameter name="hooksTransformer"
> >>> value="lm://hooks-to-html.xsl"/>
> >>>         </map:transform>
> >>>         <map:transform src="lm://namespace-stripped"/>
> >>>         <map:transform src="lm://strip-dispatcher-remains-html.xsl"/>
> >>>         <map:serialize type="xhtml"/>
> >>>       </map:match>
> >> Have you made sure that your dispatcher transformer is configured correctly?
If 
> >> it is *not* threadsafe, you have to use the "prototype" scope. Otherwise you
can 
> >> use the "singleton" scope (which is actually the default!).
> > 
> > This is what I always thought and how it is in 2.1 and the old 2.2.
> > version of cocoon that forrest is using.
> > 
> > <bean id="dispatcher"
> >     name="org.apache.cocoon.transformation.Transformer/dispatcher"
> >     class="org.apache.forrest.dispatcher.transformation.DispatcherTransformer">
> >     <property name="manager" ref="org.apache.avalon.framework.service.ServiceManager"/>
> >   </bean>
> 
> Just to be clear, if you configure you transformer like this, it has to be 
> threadsafe.


DOH! 

Thank you so much Ralph, Reinhard and Joerg.

I will update the documentation and point this out since it is a major
difference to 2.1. Can somebody create me an user daisy? TIA.

salu2
-- 
Thorsten Scherler                                 thorsten.at.apache.org
Open Source Java                      consulting, training and solutions


Mime
View raw message