You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Adrian Geissel <ag...@zenark.com> on 2001/10/25 11:56:53 UTC

[C2.0rc1] Exception when redirecting during pipeline processing

Hi,

My question relates to breaking out of a pipeline after the generate stage has completed. Specifically, the generate stage performs some processing as XSP, and based on the success/failure of this processing, the pipeline is allowed to continue, or 'breaks-out' using a redirect. When I configure my sitemap to do this, an exception is thrown, and looking at the stacktrace, it appears that this is not legal. 

Has someone configured something similar, or alternatively, what is the recommended approach? In reference to suggestions, I would really like to be able to perform my processing (database updating) using XSP, as this needs to be flexible in a multi-customer environment and currently uses logicsheets to achieve this. Also, if the processing fails, the XSP returns valid XML to re-populate the original form.

Many thanks,
Adrian

====== Begin: sitemap fragment =====================

   <map:match pattern="update_*.html">
     <map:act type="locale"/>
     <map:act type="check-login">
      <map:act type="get-update-mode">
        <map:aggregate element="page" prefix="zdam" ns="zenark.com/zdam">
          <map:part src="cocoon:/banner.xml"/>
          <map:part src="cocoon:/sidebar.xml"/>
          <map:part src="cocoon:/{../../1}.form?mode={update-mode}"/>
          <map:part src="cocoon:/{../../1}.update?mode={update-mode}"/>
        </map:aggregate>
        <map:act type="check-update-succeed">
          <map:redirect-to uri="{redirect-uri}"/>    <!-- ### Exception is thrown in processing this redirect ### -->
        </map:act>
        <map:transform type="i18n"/>
        <map:transform src="stylesheets/zdam2html.xsl"/>
        <map:serialize/>
      </map:act>
    </map:act>
    <map:generate src="cocoon:/login"/>
    <map:serialize type="html"/>
   </map:match>

====== End: sitemap fragment =====================

====== Begin: logfile extract ========================


DEBUG   (2001-10-25) 09:32.55:829   [cocoon  ] (/zdam/update_asset.html) Thread-13/DefaultPool: Retrieving a org.apache.cocoon.components.pipeline.CachingEventPipeline from the pool
DEBUG   (2001-10-25) 09:32.55:829   [cocoon  ] (/zdam/update_asset.html) Thread-13/DefaultPool: Retrieving a org.apache.cocoon.components.pipeline.CachingStreamPipeline from the pool
DEBUG   (2001-10-25) 09:32.55:829   [cocoon  ] (/zdam/update_asset.html) Thread-13/sitemap_xmap: Matched wildcardmatcher_wildcard_N400296 pattern:update_*.html
DEBUG   (2001-10-25) 09:32.55:829   [cocoon  ] (/zdam/update_asset.html) Thread-13/LocaleAction: org.apache.cocoon.acting.LocaleAction: obtained locale information, locale = en_IE
DEBUG   (2001-10-25) 09:32.55:829   [cocoon  ] (/zdam/update_asset.html) Thread-13/LocaleAction: org.apache.cocoon.acting.LocaleAction: language = en, country = IE, variant = 
DEBUG   (2001-10-25) 09:32.55:829   [cocoon  ] (/zdam/update_asset.html) Thread-13/LocaleAction: org.apache.cocoon.acting.LocaleAction: checking for local overrides, language-attribute = lang, country-attribute = country, variant-attribute = variant, locale-attribute = locale, store-in-request = false, store-in-session = false, create-session = false, store-in-cookie = false
DEBUG   (2001-10-25) 09:32.55:829   [cocoon  ] (/zdam/update_asset.html) Thread-13/LocaleAction: org.apache.cocoon.acting.LocaleAction: returning map for XPath substitutions
DEBUG   (2001-10-25) 09:32.55:829   [cocoon  ] (/zdam/update_asset.html) Thread-13/DefaultComponentFactory: ComponentFactory creating new instance of com.zenark.zdam.cocoon.action.CheckLoginAction.
DEBUG   (2001-10-25) 09:32.55:829   [cocoon  ] (/zdam/update_asset.html) Thread-13/sitemap_xmap: Action check-login
DEBUG   (2001-10-25) 09:32.55:829   [cocoon  ] (/zdam/update_asset.html) Thread-13/DefaultComponentFactory: ComponentFactory creating new instance of com.zenark.zdam.cocoon.action.GetUpdateMode.
DEBUG   (2001-10-25) 09:32.55:829   [cocoon  ] (/zdam/update_asset.html) Thread-13/DefaultComponentFactory: no logger attribute available, using standard logger
DEBUG   (2001-10-25) 09:32.55:829   [cocoon  ] (/zdam/update_asset.html) Thread-13/sitemap_xmap: Action get-update-mode
DEBUG   (2001-10-25) 09:32.55:829   [cocoon  ] (/zdam/update_asset.html) Thread-13/sitemap_xmap: Component generator:!content-aggregator!(emptyParam)
DEBUG   (2001-10-25) 09:32.55:829   [cocoon  ] (/zdam/update_asset.html) Thread-13/DefaultPool: Retrieving a org.apache.cocoon.sitemap.ContentAggregator from the pool
DEBUG   (2001-10-25) 09:32.55:829   [cocoon  ] (/zdam/update_asset.html) Thread-13/ContentAggregator: ContentAggregator: root element='page' ns='zenark.com/zdam' prefix='zdam'
DEBUG   (2001-10-25) 09:32.55:829   [cocoon  ] (/zdam/update_asset.html) Thread-13/ContentAggregator: ContentAggregator: part uri='cocoon:/banner.xml' element='' ns='' stripRootElement='' prefix=''
DEBUG   (2001-10-25) 09:32.55:829   [cocoon  ] (/zdam/update_asset.html) Thread-13/ContentAggregator: ContentAggregator: part uri='cocoon:/sidebar.xml' element='' ns='' stripRootElement='' prefix=''
DEBUG   (2001-10-25) 09:32.55:829   [cocoon  ] (/zdam/update_asset.html) Thread-13/AbstractSitemap: Substitute evaluated value for 1 as asset
DEBUG   (2001-10-25) 09:32.55:829   [cocoon  ] (/zdam/update_asset.html) Thread-13/AbstractSitemap: Substitute evaluated value for update-mode as NEW
DEBUG   (2001-10-25) 09:32.55:829   [cocoon  ] (/zdam/update_asset.html) Thread-13/ContentAggregator: ContentAggregator: part uri='cocoon:/asset.form?mode=NEW' element='' ns='' stripRootElement='' prefix=''
DEBUG   (2001-10-25) 09:32.55:829   [cocoon  ] (/zdam/update_asset.html) Thread-13/AbstractSitemap: Substitute evaluated value for 1 as asset
DEBUG   (2001-10-25) 09:32.55:829   [cocoon  ] (/zdam/update_asset.html) Thread-13/AbstractSitemap: Substitute evaluated value for update-mode as NEW
DEBUG   (2001-10-25) 09:32.55:829   [cocoon  ] (/zdam/update_asset.html) Thread-13/ContentAggregator: ContentAggregator: part uri='cocoon:/asset.update?mode=NEW' element='' ns='' stripRootElement='' prefix=''
DEBUG   (2001-10-25) 09:32.55:829   [cocoon  ] (/zdam/update_asset.html) Thread-13/DefaultComponentFactory: ComponentFactory creating new instance of com.zenark.zdam.cocoon.action.CheckCommitSucceeded.
DEBUG   (2001-10-25) 09:32.55:829   [cocoon  ] (/zdam/update_asset.html) Thread-13/DefaultComponentFactory: no logger attribute available, using standard logger
DEBUG   (2001-10-25) 09:32.55:829   [cocoon  ] (/zdam/update_asset.html) Thread-13/CheckCommitSucceeded: Update Status: 'null'
DEBUG   (2001-10-25) 09:32.55:839   [cocoon  ] (/zdam/update_asset.html) Thread-13/sitemap_xmap: Action check-commit-succeed
DEBUG   (2001-10-25) 09:32.55:839   [cocoon  ] (/zdam/update_asset.html) Thread-13/sitemap_xmap: Sitemap: session='false', redirecting to '{redirect-uri}'
DEBUG   (2001-10-25) 09:32.55:839   [cocoon  ] (/zdam/update_asset.html) Thread-13/AbstractSitemap: Substitute evaluated value for redirect-uri as asset_categories.html
DEBUG   (2001-10-25) 09:32.55:939   [cocoon  ] (/zdam/update_asset.html) Thread-13/DefaultComponentFactory: ComponentFactory decommissioning instance of com.zenark.zdam.cocoon.action.CheckCommitSucceeded.
DEBUG   (2001-10-25) 09:32.55:949   [cocoon  ] (/zdam/update_asset.html) Thread-13/DefaultComponentFactory: ComponentFactory decommissioning instance of com.zenark.zdam.cocoon.action.GetUpdateMode.
DEBUG   (2001-10-25) 09:32.55:949   [cocoon  ] (/zdam/update_asset.html) Thread-13/DefaultComponentFactory: ComponentFactory decommissioning instance of com.zenark.zdam.cocoon.action.CheckLoginAction.
DEBUG   (2001-10-25) 09:32.55:949   [cocoon  ] (/zdam/update_asset.html) Thread-13/CachingEventPipeline: Recycling of CachingEventPipeline
WARN    (2001-10-25) 09:32.55:949   [cocoon  ] (/zdam/update_asset.html) Thread-13/DefaultPool: Pool interrupted while waiting for lock.
java.lang.NullPointerException
 at org.apache.cocoon.sitemap.ContentAggregator.recycle(Unknown Source)
 at org.apache.avalon.excalibur.pool.DefaultPool.put(Unknown Source)
 at org.apache.avalon.excalibur.component.PoolableComponentHandler.put(Unknown Source)
 at org.apache.avalon.excalibur.component.ExcaliburComponentSelector.release(Unknown Source)
 at org.apache.cocoon.sitemap.SitemapComponentSelector.release(Unknown Source)
 at org.apache.cocoon.components.pipeline.AbstractEventPipeline.recycle(Unknown Source)
 at org.apache.cocoon.components.pipeline.CachingEventPipeline.recycle(Unknown Source)
 at org.apache.avalon.excalibur.pool.DefaultPool.put(Unknown Source)
 at org.apache.avalon.excalibur.component.PoolableComponentHandler.put(Unknown Source)
 at org.apache.avalon.excalibur.component.ExcaliburComponentManager.release(Unknown Source)
 at org.apache.cocoon.www.sitemap_xmap.process(sitemap_xmap.java:1249)
 at org.apache.cocoon.sitemap.Handler.process(Unknown Source)
 at org.apache.cocoon.sitemap.Manager.invoke(Unknown Source)
 at org.apache.cocoon.Cocoon.process(Unknown Source)
 at org.apache.cocoon.servlet.CocoonServlet.service(Unknown Source)
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
 at org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:404)
 at org.apache.tomcat.core.Handler.service(Handler.java:286)
 at org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372)
 at org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:797)
 at org.apache.tomcat.core.ContextManager.service(ContextManager.java:743)
 at org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpConnectionHandler.java:210)
 at org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416)
 at org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:498)
 at java.lang.Thread.run(Thread.java:484)
DEBUG   (2001-10-25) 09:32.55:949   [cocoon  ] (/zdam/update_asset.html) Thread-13/DefaultPool: Returning a org.apache.cocoon.components.pipeline.CachingEventPipeline to the pool
DEBUG   (2001-10-25) 09:32.55:949   [cocoon  ] (/zdam/update_asset.html) Thread-13/CachingStreamPipeline: Recycling of CachingStreamPipeline
DEBUG   (2001-10-25) 09:32.55:949   [cocoon  ] (/zdam/update_asset.html) Thread-13/DefaultPool: Returning a org.apache.cocoon.components.pipeline.CachingStreamPipeline to the pool
DEBUG   (2001-10-25) 09:37.55:961   [cocoon  ] (/zdam/asset_categories.html) Thread-14/Cocoon: DEBUGGING INFORMATION:

====== End: logfile extract ========================