Dirk,

I guess this is your sitemap snippet:

<map:match pattern="processed/**.xml">
  <map:generate type="serverpages" src="somePath/{1}.xml"/>
  <map:transform type="cinclude"/>
  <map:serialize type="xml"/>
</map:match>

Here are some advices:

1. Always have serializer
2. Try first without CInclude:

<map:match pattern="processed/**.xml">
  <map:generate type="serverpages" src="somePath/{1}.xml"/>
  <map:serialize type="xml"/>
</map:match>

3. If it works, test that links in the generated include tags are
working and produce correct result.

4. then add cinclude back.

Also,

What Cocoon version do you use? Line numbers from the stacktrace do not
match with Cocoon 2.0.2 sources.

Regards,
Vadim

> From: Dirk Reiss [mailto:[EMAIL PROTECTED]]
> 
> hello,
> 
> we tried to access the ...../processed/somePath/SOME_FILE.xml (which
was
> originally resolved via xsp through an database-query) directly
through a
> browser and cocoon doesnt deliver anything back, just loads forever...
> 
> many thanks so far,
> dirk
> 
> our stacktrace looks like follows:
> 
> Original exception : org.apache.cocoon.ProcessingException: Could not
get
> sitemap source
http://lhost:8080/cocoon/processed/somePath/SOME_FILE.xml:
> java.lang.NullPointerException
>  at
>
org.apache.cocoon.transformation.CIncludeTransformer.processCIncludeElem
ent(CI
> ncludeTransformer.java:136)
>  at
>
org.apache.cocoon.transformation.CIncludeTransformer.startElement(CInclu
deTran
> sformer.java:83)
>  at
>
org.apache.cocoon.www.file_.somePath.example_xsp.generate(example_xsp.ja
va:121
> )
>  at
>
org.apache.cocoon.generation.ServerPagesGenerator.generate(ServerPagesGe
nerato
> r.java:226)
>  at
>
org.apache.cocoon.components.pipeline.AbstractEventPipeline.process(Abst
ractEv
> entPipeline.java:118)
>  at
>
org.apache.cocoon.components.pipeline.AbstractStreamPipeline.process(Abs
tractS
> treamPipeline.java:149)
>  at
org.apache.cocoon.www.sitemap_xmap.matchN1033D(sitemap_xmap.java:4243)

...

> Original exception : org.apache.cocoon.ProcessingException: Could not
get
> sitemap source
http://host:8080/cocoon/processed/somePath/SOME_FILE.xml:
> java.lang.NullPointerException
>  at
>
org.apache.cocoon.components.source.SitemapSource.refresh(SitemapSource.
java:2
> 64)
>  at
>
org.apache.cocoon.components.source.SitemapSource.<init>(SitemapSource.j
ava:15
> 2)
>  at
>
org.apache.cocoon.components.source.CocoonSourceFactory.getSource(Cocoon
Source
> Factory.java:54)
>  at
>
org.apache.cocoon.components.source.SourceHandlerImpl.getSource(SourceHa
ndlerI
> mpl.java:134)
>  at
>
org.apache.cocoon.environment.AbstractEnvironment.resolve(AbstractEnviro
nment.
> java:293)
>  at
>
org.apache.cocoon.transformation.CIncludeTransformer.processCIncludeElem
ent(CI
> ncludeTransformer.java:129)
>  at
>
org.apache.cocoon.transformation.CIncludeTransformer.startElement(CInclu
deTran
> sformer.java:83)
>  at
>
org.apache.cocoon.www.file_.home.vorms.website.example_xsp.generate(exam
ple_xs
> p.java:121)
>  at
>
org.apache.cocoon.generation.ServerPagesGenerator.generate(ServerPagesGe
nerato
> r.java:226)
>  at
>
org.apache.cocoon.components.pipeline.AbstractEventPipeline.process(Abst
ractEv
> entPipeline.java:118)
>  at
>
org.apache.cocoon.components.pipeline.AbstractStreamPipeline.process(Abs
tractS
> treamPipeline.java:149)
>  at
org.apache.cocoon.www.sitemap_xmap.matchN1033D(sitemap_xmap.java:4243)

...

> java.lang.NullPointerException
>  at
>
org.apache.cocoon.components.source.SitemapSource.refresh(SitemapSource.
java:2
> 34)
>  at
>
org.apache.cocoon.components.source.SitemapSource.<init>(SitemapSource.j
ava:15
> 2)
>  at
>
org.apache.cocoon.components.source.CocoonSourceFactory.getSource(Cocoon
Source
> Factory.java:54)
>  at
>
org.apache.cocoon.components.source.SourceHandlerImpl.getSource(SourceHa
ndlerI
> mpl.java:134)
>  at
>
org.apache.cocoon.environment.AbstractEnvironment.resolve(AbstractEnviro
nment.
> java:293)
>  at
>
org.apache.cocoon.transformation.CIncludeTransformer.processCIncludeElem
ent(CI
> ncludeTransformer.java:129)
>  at
>
org.apache.cocoon.transformation.CIncludeTransformer.startElement(CInclu
deTran
> sformer.java:83)
>  at
>
org.apache.cocoon.www.file_.somePath.example_xsp.generate(example_xsp.ja
va:121
> )
>  at
>
org.apache.cocoon.generation.ServerPagesGenerator.generate(ServerPagesGe
nerato
> r.java:226)

...

> Original exception : java.lang.NullPointerException
>  at
>
org.apache.cocoon.components.source.SitemapSource.refresh(SitemapSource.
java:2
> 34)
>  at
>
org.apache.cocoon.components.source.SitemapSource.<init>(SitemapSource.j
ava:15
> 2)
>  at
>
org.apache.cocoon.components.source.CocoonSourceFactory.getSource(Cocoon
Source
> Factory.java:54)
>  at
>
org.apache.cocoon.components.source.SourceHandlerImpl.getSource(SourceHa
ndlerI
> mpl.java:134)
>  at
>
org.apache.cocoon.environment.AbstractEnvironment.resolve(AbstractEnviro
nment.
> java:293)
>  at
>
org.apache.cocoon.transformation.CIncludeTransformer.processCIncludeElem
ent(CI
> ncludeTransformer.java:129)
>  at
>
org.apache.cocoon.transformation.CIncludeTransformer.startElement(CInclu
deTran
> sformer.java:83)
>  at
>
org.apache.cocoon.www.file_.somePath.website.example_xsp.generate(exampl
e_xsp.
> java:121)
>  at
>
org.apache.cocoon.generation.ServerPagesGenerator.generate(ServerPagesGe
nerato
> r.java:226)
...

> > > From: Dirk Reiss [mailto:[EMAIL PROTECTED]]
> > >
> > > hello,
> > >
> > > what we try to do is parsing several files hierarchically, 
> > > which means that
> > > we got one 'starting file' which contains a link that is processed

> > > wia xsp-logicsheet. The link points to an cocoon: -ressource 
> > > which shall be included using <cinclude include... >.
> > >
> > > when we try to access and include the cocoon: -ressource we get 
> > > the following error:
> > >
> > > Cocoon 2 - Internal server error
> > >
> > > message Failed to execute pipeline.
> > >
> > > description org.apache.cocoon.ProcessingException: Failed to
execute
> > > pipeline.: org.apache.cocoon.ProcessingException: Could not get
> > > sitemap
> > > source http://somePath/SOME_FILE.xsp:
java.lang.NullPointerException
> >
> > While processing cocoon: source, NullPointerException occurred.
Can't
> > say much without stacktrace of this NullPointerException.
> >
> > > this path is resolved correctly and should be matched by sitemap, 
> > > but it doesnt.
> >
> > The cocoon: URI you are trying to include, try accessing it first
from
> > the browser.
> >
> > Vadim
> >
> > > what does 'could not get sitemap source' mean? where could be the
> > > error? does anybody has any solution for our problem?
> > >
> > > many thanks in advance
> > >
> > > dirk
> > >
> > >
> > >
> > > relevant parts of the affected files:
> > >
> > > ---- sitemap ------
> > >
> > > <map:pipeline>
> > >    <map:match pattern="processed/**.xsp">
> > >         <map:generate type="serverpages" src="somePath/{1}.xsp"/>
> > >         <map:transform type="cinclude"/>
> > > <!--    <map:serialize type="xml"/> -->
> > > <!-- doesn't work with or without serializer -->
> > >    </map:match>
> > >
> > >    <map:match pattern="processed/**.xml">
> > >         <map:generate type="serverpages" src="somePath/{1}.xml"/>
> > >         <map:transform type="cinclude"/>
> > > <!--    <map:serialize type="xml"/> -->
> > >    </map:match>
> > >
> > >    <map:match pattern="example.xsp">
> > >     <map:generate type="serverpages" src="somePath/example.xsp"/>
> > >    <!-- <map:transform src="somePath/some_stylesheet.xsl">
> > >         <map:parameter name="view-source"
> > > value="somePath/example.xsp"/>
> > >     </map:transform> -->
> > >     <map:transform type="cinclude" />
> > >     <map:transform src="somePath/some_stylesheet.xsl"/>
> > >     <map:serialize/>
> > >    </map:match>
> > > </map:pipeline>
> > >
> > >
> > > ----- example.xsp ----
> > >
> > > <xsp:page
> > >         language="java"
> > >         xmlns:xsp="http://apache.org/xsp";
> > >         xmlns:ownnamespace="http://www.ownnamespace.org/xsl";
> > >         xmlns:util="http://www.apache.org/xsp/util/2.0";
> > >         xmlns:cinclude="http://apache.org/cocoon/include/1.0";
> > >
> > >        <ownnamespace:header/>
> > >   <page>
> > >         <ownnamespace:link identifier="SOME_IDENTIFIER"/>
> > >   </page>
> > > </xsp:page>
> > >
> > > ------ example.xsl ----- which is the logicsheet ----
> > >
> > > <xsl:stylesheet version="1.0"
> > >                 xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
> > >                 xmlns:xsp="http://apache.org/xsp";
> > >
xmlns:ownnamespace="http://www.ownnamespace.org/xsl";
> > >
xmlns:cinclude="http://apache.org/cocoon/include/1.0";
> > >
> > >
> > > <xsl:template match="ownnamespace:header">
> > >   <xsp:structure>
> > >         <xsp:include>DBInterface</xsp:include>
> > >   </xsp:structure>
> > >
> > >   <xsp:logic>
> > >       public synchronized String getURI(String identifier)
> > >        {
> > >        DBInterface dbinterface = new DBInterface();
> > > dbinterface.establishConnection("jdbc:mysql....","....","....");
> > >       String msg = "cocoon:processed/" +
> > >       dbinterface.getURIForLM(identifier);
> > >       return msg;
> > >       }
> > >    </xsp:logic>
> > >   <xsl:apply-templates/>
> > > </xsl:template>
> > >
> > >
> > > <xsl:template match="ownnamespace:link">
> > >         <cinclude:include>
> > >                 <xsp:attribute name="src">
> > >                     <!-- this would be replaced by <xsp:expr> to
> > >                          get the uri -->
> > >  <xsp:text>cocoon:processed/somePath/someFile.xsp</xsp:text>
> > >                 </xsp:attribute>
> > >         </cinclude:include>
> > >         <xsl:apply-templates/>
> > > </xsl:template>
> > >
> > > <xsl:template match="@*|node()" priority="-1">
> > >         <xsl:copy>
> > >               <xsl:apply-templates select="@*|node()"/>
> > >         </xsl:copy>
> > > </xsl:template>
> > >
> > > </xsl:stylesheet>


---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>

To unsubscribe, e-mail: <[EMAIL PROTECTED]>
For additional commands, e-mail: <[EMAIL PROTECTED]>

Reply via email to