cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Vadim Gritsenko <vadim.gritse...@verizon.net>
Subject Re: cocoon-2.0.3 fails when modifying a sitemap.xconf online ...
Date Thu, 07 Nov 2002 13:55:40 GMT
Hussayn Dabbous wrote:

> Hy;
>
> I run into following problem:
>
> I have separated my sitemap into a master and a
> sub sitemap. My application works fine with this
> configuration. Today i added some documentation
> lines to the master sitemap. Directly after i saved
> the mastersitemap, cocoon constantly rejects
> processing my pages with a null pointer exception in 


Please update your Cocoon to CVS version from cocoon_2_0_3 branch and 
test again. This NPE was fixed already. See 
http://xml.apache.org/cocoon/changes.html, "Fix sitemap reloading bug", 
"Set URI resolver for XSLT handler".

Vadim



> XSLTProcessorImpl.getTransformerHandler(
>   Source stylesheet,
>   XMLFilter filter)
>
> After restarting cocoon, everything works again.
> The problem does NOT occur, when i modify the
> sub sitemap! This behaviour is reproducible on my
> site. Only my pages are affected. (I did not check,
> what happens, when i touch the cocoon sitemap itself.)
>
> I searched the mailinglists and bugzilla and found some
> hints, that point to the class and even the method
> mentioned above, but they don't seem to fit to the problem
> i encounter.
>
>
> my preliminary results on code investigation:
> ---------------------------------------------
> I found, that the instance variable "store" of the XSLTProcessorImpl
> instance is set to NULL. The exact cause of the exception is in method
> getTemplates() (below the offending statement marked with "<===" )
>
> private Templates getTemplates(Source stylesheet, String id)
>   throws ProcessingException, IOException, SAXException {
>   if (!useStore) {
>      return null;
>   }
>   if (getLogger().isDebugEnabled()) {
>   getLogger().debug("XSLTProcessorImpl getTemplates: stylesheet " + id);
>   }
>
>   // Only stylesheets with a last modification date are stored
>   if (stylesheet.getLastModified() == 0) {
>      // Remove an old template
>      store.remove(id);  <=== This statement fails because store==NULL
>      return null;
>   }
>
>   . . .
>
>
> But i can't figure out, why store is NOT set after all, or better, why
> it is set to NULL after modifying the sitemap...
>
> my environment:
> ---------------
> cocoon-2.0.3
> tomcat-4.1.12
> solaris-2.6
> java-1.3
>
> i use a local-catalog configured in cocoon.xconf
> additional note: the bahaviour occurs with xalan AND with saxon
>
>
> Did anyone hit the same problem ?
> Is there something i can do against it ?
> Maybe there is an error in my sitemaps, that causes such a problem?
>
> I include the two sitempas as attachement in case that someone might
> want to have a look at them. (i renamed the sitemaps so that they
> can be easier destinguished in the attachement, on my site the reside
> in different directories and are both named "sitemap.xconf")
>
> Any hint would be highly appreciated...
>
> regards, Hussayn
>
>------------------------------------------------------------------------
>
><?xml version="1.0"?>
>
><map:sitemap xmlns:map="http://apache.org/cocoon/sitemap/1.0">
>
>  <map:components>
>   
>    <map:generators default="file"/>
>  
>    <map:transformers default="xslt">
>      <map:transformer name="xslt" src="org.apache.cocoon.transformation.TraxTransformer"/>
>      <map:transformer name="xslt-with-params" src="org.apache.cocoon.transformation.TraxTransformer">
>        <use-request-parameters>true</use-request-parameters>
>      </map:transformer>
>    </map:transformers>
>    
>    <map:readers default="resource"/>
>  
>    <map:serializers default="html">
>      <map:serializer name="css" mime-type="text/css" src="org.apache.cocoon.serialization.HTMLSerializer"/>
>      <map:serializer name="html" mime-type="text/html" src="org.apache.cocoon.serialization.HTMLSerializer">
>        <doctype-public>-//W3C//DTD HTML 4.01 Transitional//EN</doctype-public>
>      </map:serializer>
>      <map:serializer name="xml" mime-type="text/plain"   src="org.apache.cocoon.serialization.XMLSerializer">
>        <indent>yes</indent>
>        <encoding>ISO-8859-1</encoding>
>      </map:serializer>
>    </map:serializers>
>    
>    <map:matchers default="wildcard">
>      <map:matcher name="wildcard"
>        src="org.apache.cocoon.matching.WildcardURIMatcherFactory"/>
>    </map:matchers>
>    
>  </map:components>
>  
>  <map:pipelines>
>    <map:pipeline>
>
>      <!-- homepage -->
>      <map:match pattern="">
>        <map:redirect-to session="false" uri="metasearch/page/search"/>
>      </map:match>
>
>      <!-- html files -->
>      <map:match pattern="**.html">
>				<map:read src="{1}.html" mime-type="text/plain"/>
>      </map:match>
>
>      <!-- image files -->
>      <map:match pattern="**.gif">
>				<map:read src="{1}.gif" mime-type="image/gif"/>
>      </map:match>
>
>      <!-- css stylesheets -->
>      <map:match pattern="**.css">
>        <map:generate  src  = "css/commons.xml"/>
>        <map:transform src  = "css/commons.xsl"/>
>        <map:serialize type="css"/>
>      </map:match>
>
>      <map:match pattern="page/**">
>        <map:mount check-reload="yes" src="page/sitemap.xmap" uri-prefix="page"/>
>      </map:match>
>
>    </map:pipeline>
>  </map:pipelines>
>
></map:sitemap>
>  
>
>------------------------------------------------------------------------
>
><?xml version="1.0"?>
>
><map:sitemap xmlns:map="http://apache.org/cocoon/sitemap/1.0">
>
>  <map:components>
>    <map:generators default="file"/>
>    <map:transformers default="xslt"/>
>    <map:readers default="resource"/>
>    <map:serializers default="html"/>
>    <map:matchers default="wildcard"/>
>  </map:components>
>  
>  <map:pipelines>
>    <map:pipeline>
>
>      <map:match pattern="*/canvas/*">
>        <map:generate  src="{1}.xml"/>
>        <map:transform type="xslt" src="xsl/{2}.xsl">
>          <map:parameter name="applets-allowed" value="false"/>
>          <map:parameter name="use-request-parameters" value="true"/>
>          <map:parameter name="context" value="{1}"/>
>        </map:transform>
>        <map:serialize type = "xml"/>
>      </map:match>
>
>      <!-- =============================================================== -->
>      <!-- This map is for "canvas" parts only. Note, that we need to      -->
>      <!-- distinguish the different contexts, because each context has    -->
>      <!-- a different canvas (need to change that later to a more general -->
>      <!-- concept.                                                        -->
>      <!-- The request has the form part/canvas/{1}                        -->
>      <!-- {1} the context "search", "history", "organizer", etc...        -->
>      <!-- =============================================================== -->
>
>      <!-- =============================================================== -->
>			<!-- This is for the search context                                  -->
>      <!-- We break up the search context into the "collection" and the    -->
>      <!-- "searchmask" parts as follows:                                  -->
>      <!--                                                                 -->
>      <!-- *=============================*=============================*   -->
>      <!-- |                             |                             |   -->
>      <!-- |page/search/canvas/collection|page/search/canvas/searchmask|   -->
>      <!-- |                             |                             |   -->
>      <!-- *=============================*=============================*   -->
>      <!--                                                                 -->
>      <!-- =============================================================== -->
>
>
>			<!-- This is for the search2 context -->
>      <!-- Note: Only for test purposes!   -->
>
>      <map:match pattern="search2/canvas">
>        <map:aggregate element="canvas">
>          <map:part element = "collection" src="cocoon:/search2/canvas/collection"/>
>          <map:part element = "mask"       src="cocoon:/search2/canvas/search_mask"/>
>        </map:aggregate>
>        <map:transform type="xslt" src = "xsl/search_canvas.xsl">
>          <map:parameter name="use-request-parameters" value="true"/>
>          <map:parameter name="context" value="search"/>
>        </map:transform>
>        <map:serialize type = "xml"/>
>      </map:match>
>
>      <map:match pattern="search/canvas">
>        <map:aggregate element="canvas">
>          <map:part element = "collection" src="cocoon:/search/canvas/collection"/>
>          <map:part element = "mask"       src="cocoon:/search/canvas/search_mask"/>
>        </map:aggregate>
>        <map:transform type="xslt" src = "xsl/search_canvas.xsl">
>          <map:parameter name="use-request-parameters" value="true"/>
>          <map:parameter name="context" value="search"/>
>        </map:transform>
>        <map:serialize type = "xml"/>
>      </map:match>
>
>      <map:match pattern="history/canvas">
>        <map:aggregate element="canvas">
>          <map:part element = "collection" src="cocoon:/history/canvas/collection"/>
>          <map:part element = "mask"       src="cocoon:/history/canvas/search_mask"/>
>          <map:part element = "history"    src="cocoon:/history/canvas/history"/>
>        </map:aggregate>
>        <map:transform type="xslt" src = "xsl/history_canvas.xsl">
>          <map:parameter name="use-request-parameters" value="true"/>
>          <map:parameter name="context" value="search"/>
>        </map:transform>
>        <map:serialize type = "xml"/>
>      </map:match>
>
>      <map:match pattern="agent/canvas">
>        <map:aggregate element="canvas">
>          <map:part element = "mask"     src="cocoon:/agent/canvas/search_mask"/>
>          <map:part element = "agent"    src="cocoon:/agent/canvas/agent"/>
>        </map:aggregate>
>        <map:transform type="xslt" src = "xsl/agent_canvas.xsl">
>          <map:parameter name="use-request-parameters" value="true"/>
>          <map:parameter name="context" value="search"/>
>        </map:transform>
>        <map:serialize type = "xml"/>
>      </map:match>
>
>      <map:match pattern="agent_config/canvas">
>        <map:aggregate element="canvas">
>          <map:part element = "agent_config"  src="cocoon:/agent_config/canvas/agent_config_item"/>
>        </map:aggregate>
>        <map:transform type="xslt" src = "xsl/agent_config_canvas.xsl">
>          <map:parameter name="use-request-parameters" value="true"/>
>          <map:parameter name="context" value="search"/>
>        </map:transform>
>        <map:serialize type = "xml"/>
>      </map:match>
>
>      <map:match pattern="result/canvas">
>        <map:aggregate element="canvas">
>          <map:part element = "statistic"  src="cocoon:/result/canvas/statistic"/>
>          <map:part element = "collection" src="cocoon:/result/canvas/collection"/>
>          <map:part element = "search_params" src="cocoon:/result/canvas/search_params"/>
>          <!--map:part element = "mask"       src="cocoon:/result/canvas/search_mask"/-->
>          <map:part element = "resultset"  src="cocoon:/result/canvas/resultset"/>
>        </map:aggregate>
>        <map:transform type="xslt" src = "xsl/result_canvas.xsl">
>          <map:parameter name="use-request-parameters" value="true"/>
>          <map:parameter name="context" value="result"/>
>        </map:transform>
>        <map:serialize type = "xml"/>
>      </map:match>
>
>      <map:match pattern="ltitleinfo/canvas">
>        <map:generate src="ltitleinfo.xml"/>
>        <map:transform type="xslt" src = "xsl/titleinfo_canvas.xsl">
>          <map:parameter name="use-request-parameters" value="true"/>
>          <map:parameter name="context" value="ltitleinfo"/>
>        </map:transform>
>        <map:serialize type = "xml"/>
>      </map:match>
>
>      <map:match pattern="*/canvas">
>        <map:generate src="{1}.xml"/>
>        <map:transform type="xslt" src = "xsl/{1}_canvas.xsl">
>          <map:parameter name="use-request-parameters" value="true"/>
>          <map:parameter name="context" value="{1}"/>
>        </map:transform>
>        <map:serialize type = "xml"/>
>      </map:match>
>
>
>      <!-- =============================================================== -->
>      <!-- This map is for "menu" and "profile" parts only.                -->
>      <!-- The requets has the form page/{1}/{2}/{3}                       -->
>      <!-- {1} the context e.g. "search, "history", ...                    -->
>      <!-- {2} "menu" or "profile"                                         -->
>      <!-- =============================================================== -->
>
>      <map:match pattern="*/*">
>        <map:generate  src  = "{2}.xml"/>
>        <map:transform type="xslt" src = "xsl/{2}.xsl">
>          <map:parameter name="use-request-parameters" value="true"/>
>          <map:parameter name="context" value="{1}"/>
>        </map:transform>
>        <map:serialize type = "xml"/>
>      </map:match>
>
>
>      <!-- =============================================================== -->
>      <!-- main pages are always built from "profile", "menu" and "canvas" -->
>      <!--                                                                 -->
>      <!-- *=================================*=========================*   -->
>      <!-- |                                 |                         |   -->
>      <!-- | page/context/userprofile        | page/context/menu/*     |   -->
>      <!-- |                                 |                         |   -->
>      <!-- *=================================*=========================*   -->
>      <!-- |                                                           |   -->
>      <!-- |                                                           |   -->
>      <!-- |                    page/context/canvas/*                  |   -->
>      <!-- |                                                           |   -->
>      <!-- |                                                           |   -->
>      <!-- *===========================================================*   -->
>      <!--                                                                 -->
>      <!-- =============================================================== -->
>
>      <map:match pattern="*">
>        <map:aggregate element="page">
>          <map:part element = "profile" src="cocoon:/{1}/userprofile"/>
>          <map:part element = "menu"    src="cocoon:/{1}/menu"/>
>          <map:part element = "canvas"  src="cocoon:/{1}/canvas"/>
>        </map:aggregate>
>        <map:transform src="xsl/page.xsl"/>
>        <map:serialize/>
>      </map:match>
>
>    </map:pipeline>
>  </map:pipelines>
>
></map:sitemap>
>
>  
>
>------------------------------------------------------------------------
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
>For additional commands, email: cocoon-dev-help@xml.apache.org
>



---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org


Mime
View raw message