Mailing List Archive

Internal Server Error:Cannot find a matching 2-argument function
Hello,
While deploying the my-project.war to Tomcat via eclipse WTP I get the
following error once the servlet runs. (my-project.war that is used is the
default .war generated after
Step 1) forrest seed
Step 2) forrest war
=======================
Internal Server Error
Message: null

Description: No details available.

Sender: org.apache.cocoon.servlet.CocoonServlet

Source: Cocoon Servlet

Request URI

index.html

cause

Cannot find a matching 2-argument function named
{http://xml.apache.org/xslt/java}format()

request-uri

/my-project/index.html

Apache Cocoon 2.2.0-dev
========================


Searching the web, the best I could make out was that "while calling the
format() function for xslt ... it couldn't find it...."

What is missing for the cocoon servlet, that this is not getting
recongnized?

Bhatia
RE: Internal Server Error:Cannot find a matching 2-argument function [ In reply to ]
Hello,
Further information that I could gather on this error is as follows:
The file:
skins/common/xslt/html/site-to-xhtml.xsl has the following on line 381
<xsl:variable name="year" select="java:format($formatter, $date)"/>

The java: namespace has earlier been defined in the same stylesheet as
below:
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:java="http://xml.apache.org/xslt/java"
exclude-result-prefixes="java">

So the reported error seems to be that the classes for the
java:format($formatter, $date) are not locatable/ not included.

Which classes/jar file in forrest/cocoon has these function extensions?


Bhatia
-----Original Message-----
From: Dr. Praveen Bhatia [mailto:praveen.bhatia@sumpurn.com]
Sent: Tuesday, December 08, 2009 1:45 PM
To: user@forrest.apache.org
Subject: Internal Server Error:Cannot find a matching 2-argument function

Hello,
While deploying the my-project.war to Tomcat via eclipse WTP I get the
following error once the servlet runs. (my-project.war that is used is the
default .war generated after
Step 1) forrest seed
Step 2) forrest war
=======================
Internal Server Error
Message: null

Description: No details available.

Sender: org.apache.cocoon.servlet.CocoonServlet

Source: Cocoon Servlet

Request URI

index.html

cause

Cannot find a matching 2-argument function named
{http://xml.apache.org/xslt/java}format()

request-uri

/my-project/index.html

Apache Cocoon 2.2.0-dev
========================


Searching the web, the best I could make out was that "while calling the
format() function for xslt ... it couldn't find it...."

What is missing for the cocoon servlet, that this is not getting
recongnized?

Bhatia
Re: Internal Server Error:Cannot find a matching 2-argument function [ In reply to ]
On Tue, Dec 08, 2009 at 03:44:30PM +0900, Dr. Praveen Bhatia wrote:
> Hello,
> Further information that I could gather on this error is as follows:
> The file:
> skins/common/xslt/html/site-to-xhtml.xsl has the following on line 381
> <xsl:variable name="year" select="java:format($formatter, $date)"/>
>
> The java: namespace has earlier been defined in the same stylesheet as
> below:
> <xsl:stylesheet version="1.0"
> xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
> xmlns:java="http://xml.apache.org/xslt/java"
> exclude-result-prefixes="java">
>
> So the reported error seems to be that the classes for the
> java:format($formatter, $date) are not locatable/ not included.
>
> Which classes/jar file in forrest/cocoon has these function
> extensions?

XSLT extensions are handled by the XSLT processor, Xalan, which is in
lib/endorsed/xalan-x.y.z.jar. I think there is an issue about the war
target not copying all the necessary libraries. If I recall correctly,
the workaround is to copy Xalan from $FORREST/lib/endorsed to
$TOMCAT/shared/lib. I can test this later, but I don't have Tomcat
configured at the moment.

Brian

> Bhatia
RE: Internal Server Error:Cannot find a matching 2-argument function [ In reply to ]
Hello Brian,
There is xalan-2.7.0.jar in the WEB-INF/lib of the war file already.
However, I also copied $FORREST's xalan 2.7.0 to $TOMCAT/common/lib but the
same error appears.
Xalan website informs http://xalan.apache.org/ that it only supports xslt
and xpath 1.0 version, and I could not locate the format(...,...) function
in xslt/xpath 1.0 version. Is the format(...,...) part of xalan 2.7.0? Or
Could it be another .jar file ....?

Thanks
Bhatia

-----Original Message-----
From: Brian M Dube [mailto:bdube@apache.org]
Sent: Tuesday, December 08, 2009 4:38 PM
To: user@forrest.apache.org
Subject: Re: Internal Server Error:Cannot find a matching 2-argument
function

On Tue, Dec 08, 2009 at 03:44:30PM +0900, Dr. Praveen Bhatia wrote:
> Hello,
> Further information that I could gather on this error is as follows:
> The file:
> skins/common/xslt/html/site-to-xhtml.xsl has the following on line 381
> <xsl:variable name="year" select="java:format($formatter, $date)"/>
>
> The java: namespace has earlier been defined in the same stylesheet as
> below:
> <xsl:stylesheet version="1.0"
> xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
> xmlns:java="http://xml.apache.org/xslt/java"
> exclude-result-prefixes="java">
>
> So the reported error seems to be that the classes for the
> java:format($formatter, $date) are not locatable/ not included.
>
> Which classes/jar file in forrest/cocoon has these function
> extensions?

XSLT extensions are handled by the XSLT processor, Xalan, which is in
lib/endorsed/xalan-x.y.z.jar. I think there is an issue about the war
target not copying all the necessary libraries. If I recall correctly,
the workaround is to copy Xalan from $FORREST/lib/endorsed to
$TOMCAT/shared/lib. I can test this later, but I don't have Tomcat
configured at the moment.

Brian

> Bhatia