Nathaniel Alfred wrote:
I see three possible causes for this behaviour:
1) The esql logicsheet is not applied (Cocoon problem).
2) The esql logicsheet is applied but does not transform the input (XSLT
problem).
3) The esql logicsheet is applied before sil.xsl.
If you define sil.xsl as <builtin-logicsheet> in cocoon.xconf, 3) is a likely
explanation. The order for builtin logicsheets is not defined since it is
derived from the namespace declaration on the xsp:page root element.
If that is the case, try to refer to your logicsheet inside the XSP by
<xsp:logicsheet location="path/to/sil.xsl"/>.
OK, I tried this. The first try, I made <xsp:logicsheet
location="resource://logicsheets/sil.xsl"/> the child of the <xsp:page>
element, before the other child element. The result was a
ProcessingException: java.net.MalformedURLException: Invalid System ID
at
org.apache.cocoon.generation.ServerPagesGenerator.setup(ServerPagesGenerator.java:176)
...
Caused by: java.net.MalformedURLException: Invalid System ID
at
org.apache.excalibur.source.impl.SourceResolverImpl.resolveURI(SourceResolverImpl.java:168)
Does this have something to do with the resource:// pseudo-protocol? If
so, what can I do about it? It would be impractical to have to use an
absolute file:// URL in our XSP pages, because Cocoon is installed in
different places on different machines. Just to see if this was the
issue, I tried <xsp:logicsheet
location="file:///D|/...absolute.path.../logicsheets/sil.xsl"/> and
<xsp:logicsheet
location="file:///D:/...absolute.path.../logicsheets/sil.xsl"/>, but got
the same exception.
I also tried moving <xsp:logicsheet
location="resource://logicsheets/sil.xsl"/> to be the grandchild of the
<xsp:page> element, and child of the <page> element. The behavior
returned to what it had been, namely, outputting <esql:*> tags instead
of querying the database.
Any more information on how to use <xsp:logicsheet/> would be appreciated.
Thanks,
Lars
If that is not the case, try to use another XSLT processor to exclude 2).
NB make sure that you pick up the Xalan version bundled with Cocoon and
not the one from JDK1.5.
HTH, Alfred.
-----Original Message-----
From: Lars Huttar [mailto:[EMAIL PROTECTED]
Sent: Freitag, 5. August 2005 21:37
To: Cocoon Users List
Subject: esql logicsheet sometimes fails to transform elements
Dear Cocoon users,
We have been struggling with a significant problem lately on our Cocoon
servers. It seemed to start around the time we upgraded to JDK 1.5 /
Tomcat 5.5.9 / Cocoon 2.1.7.
The problem involves XSP pages that use esql. Often they work fine, but
sometimes the esql logicsheet just doesn't seem to run. (Both behaviors
can occur with the some XSP page.) The output of the xsp page, instead
of including data produced by the esql query, includes the <esql:*> tags
themselves. The generated Java code includes things like:
this.contentHandler.startElement("http://apache.org/cocoon/SQL/v2",
"query", "esql:query", xspAttr);
xspAttr.clear();
this.characters("\n SELECT * ");
this.characters("\n FROM StatCategories");
this.characters("\n ORDER BY Category");
this.characters("\n ");
this.contentHandler.endElement("http://apache.org/cocoon/SQL/v2",
"query", "esql:query");
I should mention that we're also using a homegrown logicsheet (sil.xsl)
that generates the <esql:*> elements. However I'm sure that is not the
source of the problem. Many other stylesheets using sil.xsl work fine,
and even the ones that have problems used to work fine, and still do
sometimes (without code changes).
We have not yet seen a pattern in which xsp pages will fail at any given
time. Sometimes a page will work on machine A but not machine B; then
later the reverse will be true!
The problem occurs across multiple Cocoon applications, so it's a pretty
serious issue for us.
We have not yet upgraded our production environment to these versions,
and as far as I know, the production environment has not been affected
by this problem. If we can't resolve the problem, we may have to roll
back to Tomcat 4.1 and Java 1.4.2.
Here is the xsp page whose Java code is excerpted above:
<xsp:page language="java"
xmlns:xsp="http://apache.org/xsp"
xmlns:xsp-request="http://apache.org/xsp/request/2.0"
xmlns:esql="http://apache.org/cocoon/SQL/v2"
xmlns:sil="http://www.sil.org/namespace/cocoon-sql-logicsheet">
<stats-categories>
<sil:query connection="CLAM" row-element="stats-category">
SELECT * FROM StatCategories ORDER BY Category
</sil:query>
</stats-categories>
</xsp:page>
<sil:query> expands to:
<esql:connection>
<esql:pool>CLAM</esql:pool>
<esql:execute-query>
<esql:query>SELECT * FROM StatCategories ORDER BY Category</esql:query>
<esql:results>
<esql:row-results>
<stats-category>
<esql:get-columns />
</stats-category>
</esql:row-results>
</esql:results>
</esql:execute-query>
</esql:connection>
Thanks for looking at this and for any suggestions you can give.
By the way it doesn't seem to be a memory issue... the Tomcat and Cocoon
status pages say there is still a fair bit of free memory.
Lars
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]