Hello,

my c2 gives me something like this:
message: Exception in ServerPagesGenerator.generate()
description: org.apache.cocoon.ProcessingException: Exception in 
ServerPagesGenerator.generate(): java.lang.NullPointerException

i dont know how to fix it.
i enclose sitemap, xsp, xsl.
in cocoon.xconf i have defined fp-tool namespace.

You may see this error live at 
http://office.ferienwelt.com.pl:8080/cocoon/portal/destinations

thanks in advance,
        hubert.
<?xml version="1.0"?>

<map:sitemap xmlns:map="http://apache.org/cocoon/sitemap/1.0";>

<!-- =========================== Components ================================ -->

 <map:components>

  <map:generators default="file"/>

  <map:transformers default="xslt"/>

  <map:readers default="resource"/>

  <map:serializers default="html"/>

  <map:selectors default="browser"/>

  <map:matchers default="wildcard">
   <map:matcher name="wildcard"        
src="org.apache.cocoon.matching.WildcardURIMatcherFactory"/>
  </map:matchers>

 </map:components>

<!-- =========================== Pipelines ================================= -->

 <map:pipelines>

        <!-- private pipelines -->
        <map:pipeline>
                <map:match pattern="dests">
                        <map:generate type="serverpages" 
src="serverpages/destinations.xsp"/>
                        <map:serialize type="xml"/>
                </map:match>
        </map:pipeline>
        
        <!-- public pipelines -->
  <map:pipeline>

   <map:match pattern="">
    <map:redirect-to uri="welcome"/>
   </map:match>
         
        <map:match pattern="welcome">
                <map:aggregate element="page">
                        <map:part src="cocoon:/dests" element="destinations"/>
                </map:aggregate>
                <map:transform type="xslt" src="stylesheets/main.xsl"/>
                <map:serialize type="html"/>
        </map:match>

        <!-- i use this for tests -->
        <map:match pattern="destinations">
                <map:generate type="serverpages" src="serverpages/destinations.xsp"/>
                <map:transform src="stylesheets/destinations.xsl"/>
                <map:serialize/>
        </map:match>
        
        <map:match pattern="main-style">
                <map:read src="main.css" mime-type="text/css"/>
        </map:match>

  </map:pipeline>
 </map:pipelines>

</map:sitemap>

<!-- end of file -->
<?xml version="1.0" encoding="UTF-8"?>

<xsl:stylesheet version="1.1"
        xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
        xmlns:esql="http://apache.org/cocoon/SQL/v2";
        xmlns:xsp="http://apache.org/xsp";
        xmlns:fp-tool="http://office.ferienwelt.com.pl/fp-tool";>

        <xsl:template match="fp-tool:dests">
                <esql:connection>
                        <esql:pool>fp</esql:pool>

                        <esql:execute-query>
                                <esql:query>SELECT * FROM loc</esql:query>

                                <!-- got results -->
                                <esql:results>
                                        <esql:row-results>
                                                <xsp:element name="destination">
                                                        <xsp:attribute name="id">
                                                                <esql:get-int 
column="id_loc"/>
                                                        </xsp:attribute>
                                                        <xsp:attribute name="sup-id">
                                                                <esql:get-int 
column="sup_loc"/>
                                                        </xsp:attribute>
                                                        <xsp:element name="name">
                                                                <esql:get-string 
column="name_loc"/>
                                                        </xsp:element>
                                                        <xsp:element name="short-info">
                                                                <esql:get-string 
column="short_info_loc"/>
                                                        </xsp:element>
                                                </xsp:element>
                                        </esql:row-results>
                                </esql:results>
                        </esql:execute-query>
                </esql:connection>
        </xsl:template>

        <xsl:template match="@*|node()" priority="-1">
                <xsl:copy>
                        <xsl:apply-templates select="@*|node()"/>
                </xsl:copy>
        </xsl:template>
</xsl:stylesheet>
<?xml version="1.0" encoding="UTF-8"?>

<xsp:page
        xmlns:esql="http://apache.org/cocoon/SQL/v2";
        xmlns:xsp="http://apache.org/xsp";
        xmlns:fp-tool="http://office.ferienwelt.com.pl/fp-tool";>

        <fp-tool:dests/>
</xsp:page>
<?xml version="1.0" encoding="UTF-8"?>

<xsl:stylesheet version="1.1"
        xmlns:xsl="http://www.w3.org/1999/XSL/Transform";>

        <xsl:template match="destinations">
                <table>
                        <xsl:for-each select="destination">
                                <xsl:apply-templates select="."/>
                        </xsl:for-each>
                </table>
        </xsl:template>

        <xsl:template match="destination">
                <tr>
                        <td>
                                <xsl:value-of select="name"/>
                        </td>
                </tr>
        </xsl:template>
</xsl:stylesheet>
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.1"
        xmlns:xsl="http://www.w3.org/1999/XSL/Transform";>
        <xsl:template match="page">
                <html>
                        <head>
                                <title>
                                        Welcome
                                </title>
                                <meta name="Version" content="{version}"/>
                                <link rel="stylesheet" href="main-style" 
mime="text/css"/>
                        </head>
                        <body bgcolor="#99ff33">
                                <table border="0" cellspacing="0" cellpadding="0" 
width="100%" height="100%" style="text-align: center">
                                        <tr height="90%">
                                                <td style="vertical-align: top; 
background-color: #e7fbc8">
                                                        <table width="95%" 
align="center">
                                                                <thead>
                                                                        <tr>
                                                                                <th>
                                                                                       
 Welcome
                                                                                </th>
                                                                        </tr>
                                                                </thead>
                                                                <tbody>
                                                                        <tr>
                                                                                <td 
align="left">
                                                                                       
 <xsl:apply-templates select="destinations"/>
                                                                                </td>
                                                                        </tr>
                                                                </tbody>
                                                        </table>
                                                </td>
                                        </tr>
                                        <tr>
                                                <td style="vertical-align: bottom; 
background-color: #e7fbc8">
                                                        <table width="48%" 
align="right">
                                                                <tr>
                                                                        <td 
class="id">
                                                                                
<xsl:element name="a">
                                                                                       
 <xsl:attribute name="href">
                                                                                       
         <xsl:text>mailto:</xsl:text>
                                                                                       
         <xsl:value-of select="author/address"/>
                                                                                       
 </xsl:attribute>
                                                                                       
 <xsl:attribute name="title">
                                                                                       
         <xsl:text>Write a comment to </xsl:text>
                                                                                       
         <xsl:value-of select="author/name"/>
                                                                                       
 </xsl:attribute>
                                                                                       
 <xsl:value-of select="author/name"/>
                                                                                
</xsl:element>
                                                                                <br/>
                                                                                
<xsl:value-of select="version"/>
                                                                                <br />
                                                                                
<xsl:text>$Id: test5.xsl,v 1.46 2001/10/16 09:46:40 huberti Exp $</xsl:text>
                                                                        </td>
                                                                </tr>
                                                        </table>
                                                </td>
                                        </tr>
                                </table>
                        </body>
                </html>
        </xsl:template>
        
        <xsl:template match="destinations">
                <table width="20%" height="100%">
                        <thead>
                                <tr>
                                        <th class="id" style="color: red">
                                                :::destinations:::
                                        </th>
                                </tr>
                        </thead>
                        <xsl:for-each select="destination [@sup-id = 0]">
                                <xsl:sort data-type="text" select="text()"/>
                                <xsl:apply-templates select="."/>
                        </xsl:for-each>
                </table>
        </xsl:template>

        <xsl:template match="destination">
                <tr>
                        <td>
                                <span class="id" style="color: blue"><xsl:value-of 
select="@id"/></span>
                                
                                <xsl:choose>
                                        <xsl:when       test="string-length 
(short-info) > 0">
                                                <span style="font-size: xx-small; 
font-weight: bold; color: green">
                                                        <xsl:attribute name="title">
                                                                <xsl:value-of 
select="short-info"/>
                                                        </xsl:attribute>
                                                        <xsl:value-of 
select="text()"/>
                                                </span>
                                        </xsl:when>

                                        <xsl:otherwise>
                                                <span style="font-size: xx-small; 
color: blue">
                                                        <xsl:value-of 
select="text()"/>
                                                </span>
                                        </xsl:otherwise>
                                </xsl:choose>
                                
                                <xsl:variable name="current_loc_id">
                                        <xsl:value-of select="@id"/>
                                </xsl:variable>
                                <xsl:if test="count (../destination [@sup-id = 
$current_loc_id])">
                                        <table width="95%" align="right">
                                                <thead>
                                                        <tr>
                                                                <th class="id">
                                                                        
:::subdestinations:::
                                                                </th>
                                                        </tr>
                                                </thead>
                                                <tbody>
                                                        <xsl:for-each 
select="../destinations [@sup-id = $current_loc_id]">
                                                                <xsl:sort 
data-type="text" select="text()"/>
                                                                <xsl:apply-templates 
select="."/>
                                                        </xsl:for-each>
                                                </tbody>
                                        </table>
                                </xsl:if>
                        </td>
                </tr>
        </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