Forrest
  1. Forrest
  2. FOR-955

upgrade our packaged Cocoon to use Cocoon-2.1 branch

    Details

    • Type: Task Task
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 0.9
    • Fix Version/s: 0.9
    • Component/s: Core operations
    • Labels:
      None

      Description

      These are the steps to get Forrest running with Cocoon-2.1 rather than the current situation which uses an old Cocoon trunk. Not everything yet works, but enough to give hope. See discussion at:
       Re: upgrade strategies for our packaged Cocoon
       http://marc.theaimsgroup.com/?l=forrest-dev&m=116969420304386

      --------------------------
      Steps:

      Revert main/java/org/apache/forrest/util/XPathTransformer.java r111200
      Revert main/java/org/apache/forrest/util/IdGeneratorTransformer.java r111200

      Edit main/webapp/WEB-INF/cocoon.xconf
      to change version attribute to ... cocoon version="2.1"

      Move content of WEB-INF/xconf/forrest-core.xconf into WEB-INF/cocoon.xconf
      Remove the <components> wrapper.

      Build cocoon-branch-2_1_X for the blocks that we use (see our etc/cocoon_upgrade) and replace the jars in lib/core
      1. 955.diff
        4 kB
        Thorsten Scherler

        Issue Links

          Activity

          Hide
          David Crossley added a comment -
          There was a subsequent update to rebuild the cocoon jars to be Java 1.4 minimum. So r693831 is the last stable version.

          The head of SVN trunk is now reported to be working on UNIX-like systems, so this FOR-955 remains closed.

          However there are some issues on Windows and cygwin. These are being addressed separately on the dev list now.
          Show
          David Crossley added a comment - There was a subsequent update to rebuild the cocoon jars to be Java 1.4 minimum. So r693831 is the last stable version. The head of SVN trunk is now reported to be working on UNIX-like systems, so this FOR-955 remains closed. However there are some issues on Windows and cygwin. These are being addressed separately on the dev list now.
          Hide
          David Crossley added a comment -
          The forrest branch "update_cocoon_2.1.12-dev" was merged to trunk in r694101.
          Show
          David Crossley added a comment - The forrest branch "update_cocoon_2.1.12-dev" was merged to trunk in r694101.
          Hide
          David Crossley added a comment -
          Show
          David Crossley added a comment - [VOTE] use Cocoon-2.1 http://marc.info/?t=121989160300001
          Hide
          David Crossley added a comment -
          See discussion threads mentioned above and also:

           Updating cocoon (was Re: [jira] Commented: (FOR-1083) switch to Cocoon 2.1.x)
           http://marc.info/?t=121915066600004

           Open points for updating (was Re: Updating cocoon)
           http://marc.info/?t=121940590200002

           [Proposal] use Cocoon-2.1
           http://marc.info/?l=forrest-dev&m=121947857416372
          Show
          David Crossley added a comment - See discussion threads mentioned above and also:  Updating cocoon (was Re: [jira] Commented: ( FOR-1083 ) switch to Cocoon 2.1.x)   http://marc.info/?t=121915066600004  Open points for updating (was Re: Updating cocoon)   http://marc.info/?t=121940590200002  [Proposal] use Cocoon-2.1   http://marc.info/?l=forrest-dev&m=121947857416372
          Hide
          David Crossley added a comment -
          Modified the Issue Summary - it is beyond an "experiment" now - hooray.
          Show
          David Crossley added a comment - Modified the Issue Summary - it is beyond an "experiment" now - hooray.
          Hide
          David Crossley added a comment -
          Removed the initial listing of results from the Issue Description - not relevant now.
          Show
          David Crossley added a comment - Removed the initial listing of results from the Issue Description - not relevant now.
          Hide
          David Crossley added a comment -
          The issue mentioned above about the symbols-core-v10.ent is caused by over-written configuration for the "entity-resolver" in cocoon.xconf ... restored now.

          This cocoon.xconf issue is generally being addressed. See the discussion link above.
          Show
          David Crossley added a comment - The issue mentioned above about the symbols-core-v10.ent is caused by over-written configuration for the "entity-resolver" in cocoon.xconf ... restored now. This cocoon.xconf issue is generally being addressed. See the discussion link above.
          Hide
          Thorsten Scherler added a comment -
          The following patch brings back "forrest site" -> applied in cocoon.

          Index: src/java/org/apache/cocoon/components/pipeline/impl/AbstractCachingProcessingPipeline.java
          ===================================================================
          --- src/java/org/apache/cocoon/components/pipeline/impl/AbstractCachingProcessingPipeline.java (revision 681296)
          +++ src/java/org/apache/cocoon/components/pipeline/impl/AbstractCachingProcessingPipeline.java (working copy)
          @@ -36,6 +36,7 @@
           import org.apache.cocoon.caching.ComponentCacheKey;
           import org.apache.cocoon.caching.PipelineCacheKey;
           import org.apache.cocoon.environment.Environment;
          +import org.apache.cocoon.environment.ObjectModelHelper;
           import org.apache.cocoon.environment.http.HttpEnvironment;
           import org.apache.cocoon.transformation.Transformer;
           import org.apache.cocoon.util.HashUtil;
          @@ -243,6 +244,9 @@
                               }
                           } else {
                               Object lock = env.getObjectModel().get(HttpEnvironment.HTTP_REQUEST_OBJECT);
          + if (null==lock){
          + lock = env.getObjectModel().get(ObjectModelHelper.REQUEST_OBJECT);
          + }
                               try {
                                   transientStore.store(lockKey, lock);
                               } catch (IOException e) {
          Show
          Thorsten Scherler added a comment - The following patch brings back "forrest site" -> applied in cocoon. Index: src/java/org/apache/cocoon/components/pipeline/impl/AbstractCachingProcessingPipeline.java =================================================================== --- src/java/org/apache/cocoon/components/pipeline/impl/AbstractCachingProcessingPipeline.java (revision 681296) +++ src/java/org/apache/cocoon/components/pipeline/impl/AbstractCachingProcessingPipeline.java (working copy) @@ -36,6 +36,7 @@  import org.apache.cocoon.caching.ComponentCacheKey;  import org.apache.cocoon.caching.PipelineCacheKey;  import org.apache.cocoon.environment.Environment; +import org.apache.cocoon.environment.ObjectModelHelper;  import org.apache.cocoon.environment.http.HttpEnvironment;  import org.apache.cocoon.transformation.Transformer;  import org.apache.cocoon.util.HashUtil; @@ -243,6 +244,9 @@                      }                  } else {                      Object lock = env.getObjectModel().get(HttpEnvironment.HTTP_REQUEST_OBJECT); + if (null==lock){ + lock = env.getObjectModel().get(ObjectModelHelper.REQUEST_OBJECT); + }                      try {                          transientStore.store(lockKey, lock);                      } catch (IOException e) {
          Hide
          Thorsten Scherler added a comment -
          "env.getObjectModel()"= HashMap<K,V> (id=271)
          DEFAULT_INITIAL_CAPACITY= 16
          DEFAULT_LOAD_FACTOR= 0.75
          MAXIMUM_CAPACITY= 1073741824
          NULL_KEY= Object (id=301)
          serialVersionUID= 362498820763181265
          useNewHash= false
          entrySet= HashMap$EntrySet (id=295)
          keySet= null

          HashMap values:
          [null, response=org.apache.cocoon.environment.wrapper.ResponseWrapper@fd4662, link-collection=[], request=org.apache.cocoon.environment.wrapper.RequestWrapper@6dddcf, null, null, null, null, context=org.apache.cocoon.environment.commandline.CommandLineContext@14ba9a2, null, null, source-resolver=org.apache.cocoon.environment.commandline.FileSavingEnvironment@725967, org.apache.cocoon.components.CocoonComponentManager=org.apache.cocoon.components.EnvironmentDescription@d2efa1, null, null, null]

          httprequest is not in this map that causes that the lock is null.

          The question is now why the httprequest is not in the objctModel
          Show
          Thorsten Scherler added a comment - "env.getObjectModel()"= HashMap<K,V> (id=271) DEFAULT_INITIAL_CAPACITY= 16 DEFAULT_LOAD_FACTOR= 0.75 MAXIMUM_CAPACITY= 1073741824 NULL_KEY= Object (id=301) serialVersionUID= 362498820763181265 useNewHash= false entrySet= HashMap$EntrySet (id=295) keySet= null HashMap values: [null, response=org.apache.cocoon.environment.wrapper.ResponseWrapper@fd4662, link-collection=[], request=org.apache.cocoon.environment.wrapper.RequestWrapper@6dddcf, null, null, null, null, context=org.apache.cocoon.environment.commandline.CommandLineContext@14ba9a2, null, null, source-resolver=org.apache.cocoon.environment.commandline.FileSavingEnvironment@725967, org.apache.cocoon.components.CocoonComponentManager=org.apache.cocoon.components.EnvironmentDescription@d2efa1, null, null, null] httprequest is not in this map that causes that the lock is null. The question is now why the httprequest is not in the objctModel
          Hide
          Thorsten Scherler added a comment -
          the above error is deeper nested:
          in org.apache.cocoon.components.pipeline.impl.AbstractCachingProcessingPipeline line 245
          Object lock = env.getObjectModel().get(HttpEnvironment.HTTP_REQUEST_OBJECT);
          the lock is null which causes the NPE in the end.
          Show
          Thorsten Scherler added a comment - the above error is deeper nested: in org.apache.cocoon.components.pipeline.impl.AbstractCachingProcessingPipeline line 245 Object lock = env.getObjectModel().get(HttpEnvironment.HTTP_REQUEST_OBJECT); the lock is null which causes the NPE in the end.
          Hide
          Thorsten Scherler added a comment -
          forrest site is failing:
          * [1/0] [0/0] 1.203s 0b linkmap.html
          org.apache.cocoon.sitemap.PatternException: Cannot get variable
          'plugin.xmap.output' in expression '{lm:plugin.xmap.output}'
                  at
          org.apache.cocoon.components.treeprocessor.variables.PreparedVariableResolver.processModule(PreparedVariableResolver.java:262)
                  at
          org.apache.cocoon.components.treeprocessor.variables.PreparedVariableResolver.resolve(PreparedVariableResolver.java:209)

          in forrest run that is no problem.

          When debugging the problem it results that in line 161
          parser.parse(new InputSource(source.getInputStream()),handler);
          the source.getInputStream() is throwing the exception.

          source SitemapSource (id=89)
          environment MutableEnvironmentFacade (id=127)
          exception null
          m_logger LogKitLogger (id=132)
          manager CocoonComponentManager (id=35)
          mimeType null
          needsRefresh true
          pipelineProcessor ConcreteTreeProcessor (id=67)
          processingPipeline CachingProcessingPipeline (id=134)
          processKey EnvironmentDescription (id=136)
          processor TreeProcessor (id=68)
          protocol "cocoon" (id=138)
          redirectSource null
          sourceResolver null
          systemId "cocoon://locationmap.xml" (id=139)
          systemIdForCaching "cocoon://locationmap.xml?pipelinehash=8131474959764425468" (id=140)
          validity SitemapSource$SitemapSourceValidity (id=141)

          Show
          Thorsten Scherler added a comment - forrest site is failing: * [1/0] [0/0] 1.203s 0b linkmap.html org.apache.cocoon.sitemap.PatternException: Cannot get variable 'plugin.xmap.output' in expression '{lm:plugin.xmap.output}'         at org.apache.cocoon.components.treeprocessor.variables.PreparedVariableResolver.processModule(PreparedVariableResolver.java:262)         at org.apache.cocoon.components.treeprocessor.variables.PreparedVariableResolver.resolve(PreparedVariableResolver.java:209) in forrest run that is no problem. When debugging the problem it results that in line 161 parser.parse(new InputSource(source.getInputStream()),handler); the source.getInputStream() is throwing the exception. source SitemapSource (id=89) environment MutableEnvironmentFacade (id=127) exception null m_logger LogKitLogger (id=132) manager CocoonComponentManager (id=35) mimeType null needsRefresh true pipelineProcessor ConcreteTreeProcessor (id=67) processingPipeline CachingProcessingPipeline (id=134) processKey EnvironmentDescription (id=136) processor TreeProcessor (id=68) protocol "cocoon" (id=138) redirectSource null sourceResolver null systemId " cocoon://locationmap.xml " (id=139) systemIdForCaching " cocoon://locationmap.xml?pipelinehash=8131474959764425468 " (id=140) validity SitemapSource$SitemapSourceValidity (id=141)
          Hide
          Thorsten Scherler added a comment -
          I applied the patch in two different steps. One regarding the actNode and the other regarding the dispatcher.
          Show
          Thorsten Scherler added a comment - I applied the patch in two different steps. One regarding the actNode and the other regarding the dispatcher.
          Hide
          David Crossley added a comment -
          Other discussion is happening here:
           Updating cocoon (was Re: [jira] Commented: (FOR-1083) switch to Cocoon 2.1.x)
           http://mail-archives.apache.org/mod_mbox/forrest-dev/200808.mbox/%3c1219150458.6352.19.camel@thorsten-desktop%3e
          Show
          David Crossley added a comment - Other discussion is happening here:  Updating cocoon (was Re: [jira] Commented: ( FOR-1083 ) switch to Cocoon 2.1.x)   http://mail-archives.apache.org/mod_mbox/forrest-dev/200808.mbox/%3c1219150458.6352.19.camel@thorsten-desktop%3e
          Hide
          Thorsten Scherler added a comment -
          Adding fix for class cast problems (since svn server seems to be down)
          Show
          Thorsten Scherler added a comment - Adding fix for class cast problems (since svn server seems to be down)
          Hide
          Thorsten Scherler added a comment -
          We need to review all usage of SourceResolver since we cannot cast anymore from cocoon to avalons resolver.

          e.g.

          Index: whiteboard/plugins/org.apache.forrest.plugin.internal.dispatcher/src/java/org/apache/forrest/dispatcher/util/SourceUtil.java
          ===================================================================
          --- whiteboard/plugins/org.apache.forrest.plugin.internal.dispatcher/src/java/org/apache/forrest/dispatcher/util/SourceUtil.java (revision 687287)
          +++ whiteboard/plugins/org.apache.forrest.plugin.internal.dispatcher/src/java/org/apache/forrest/dispatcher/util/SourceUtil.java (working copy)
          @@ -22,9 +22,9 @@
           
           import org.apache.avalon.framework.service.ServiceException;
           import org.apache.avalon.framework.service.ServiceManager;
          -import org.apache.cocoon.environment.SourceResolver;
           import org.apache.excalibur.source.Source;
           import org.apache.excalibur.source.SourceNotFoundException;
          +import org.apache.excalibur.source.SourceResolver;
           import org.apache.forrest.dispatcher.lenya.xml.DocumentHelper;
           import org.w3c.dom.Document;
           import org.xml.sax.SAXException;
          Show
          Thorsten Scherler added a comment - We need to review all usage of SourceResolver since we cannot cast anymore from cocoon to avalons resolver. e.g. Index: whiteboard/plugins/org.apache.forrest.plugin.internal.dispatcher/src/java/org/apache/forrest/dispatcher/util/SourceUtil.java =================================================================== --- whiteboard/plugins/org.apache.forrest.plugin.internal.dispatcher/src/java/org/apache/forrest/dispatcher/util/SourceUtil.java (revision 687287) +++ whiteboard/plugins/org.apache.forrest.plugin.internal.dispatcher/src/java/org/apache/forrest/dispatcher/util/SourceUtil.java (working copy) @@ -22,9 +22,9 @@    import org.apache.avalon.framework.service.ServiceException;  import org.apache.avalon.framework.service.ServiceManager; -import org.apache.cocoon.environment.SourceResolver;  import org.apache.excalibur.source.Source;  import org.apache.excalibur.source.SourceNotFoundException; +import org.apache.excalibur.source.SourceResolver;  import org.apache.forrest.dispatcher.lenya.xml.DocumentHelper;  import org.w3c.dom.Document;  import org.xml.sax.SAXException;
          Hide
          Thorsten Scherler added a comment -
          The locationmap seems to work fine in the fresh-site:
          http://localhost:8888/samples-b/locationmap/index.html
          Link Rewriting works fine.

          Will now debug ActNode.
          Show
          Thorsten Scherler added a comment - The locationmap seems to work fine in the fresh-site: http://localhost:8888/samples-b/locationmap/index.html Link Rewriting works fine. Will now debug ActNode.
          Hide
          Thorsten Scherler added a comment -
          Dispatcher problem seems to be caused by lm
          ERROR (2008-08-20) 11:12.00:245 [core.modules.mapper.lm] (/index.html) PoolThread-4/MountNode: Failure processing LocationMap.
          java.lang.ClassCastException: org.apache.cocoon.components.CocoonComponentManager
          at org.apache.forrest.locationmap.lm.ActNode.locate(ActNode.java:140)
          Show
          Thorsten Scherler added a comment - Dispatcher problem seems to be caused by lm ERROR (2008-08-20) 11:12.00:245 [core.modules.mapper.lm] (/index.html) PoolThread-4/MountNode: Failure processing LocationMap. java.lang.ClassCastException: org.apache.cocoon.components.CocoonComponentManager at org.apache.forrest.locationmap.lm.ActNode.locate(ActNode.java:140)
          Hide
          Thorsten Scherler added a comment -
          On the first look a skinned site seems to work without any problems. The dispatcher does not.
          Show
          Thorsten Scherler added a comment - On the first look a skinned site seems to work without any problems. The dispatcher does not.
          Hide
          Thorsten Scherler added a comment -
          I have created a branch where I added the current stand of integration for updating cocoon lib based on cocoon 2.1.12-dev r681296.

          I needed to copy symbols-core-v10.ent to the webapp dir.

          /home/thorsten/src/apache/forrest/trunk/main/webapp/symbols-core-v10.ent
          Show
          Thorsten Scherler added a comment - I have created a branch where I added the current stand of integration for updating cocoon lib based on cocoon 2.1.12-dev r681296. I needed to copy symbols-core-v10.ent to the webapp dir. /home/thorsten/src/apache/forrest/trunk/main/webapp/symbols-core-v10.ent
          Hide
          Thorsten Scherler added a comment -
          FOR-1083 is the current stand of integration for me.
          Show
          Thorsten Scherler added a comment - FOR-1083 is the current stand of integration for me.

            People

            • Assignee:
              Unassigned
              Reporter:
              David Crossley
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development