You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Eric BASLEY <er...@odb.fr> on 2002/08/08 16:41:36 UTC

Use of cocoon 1.8.2 with Tomcat 3.3


I'm trying to use cocoon 1.8.2 with Tomcat 3.3, and I can't fix this
error message :

java.lang.RuntimeException: Error loading logicsheet at
resource://org/apache/cocoon/processor/xsp/library/java/util.xsl due to
java.lang.Exception: Resource not found or retrieving error.


Obviously it's a classpath setup problem, but I can't find where to put
cocoon.jar to able cocoon to find 'util.xsl'.

How does it work?

Kindly regards,

Eric BASLEY

---------------------------------------------------------------------
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: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>


Re: Is it possible to fire an error from a XSL file ?

Posted by Nicola Ken Barozzi <ni...@apache.org>.
From: "Vadim Gritsenko" <va...@verizon.net>

> Two ideas:
>1. Debug and find out why it is not 404.
> Make as simple test: have a pipeline with XSP page and XML serializer,
> and throw ResourceNotFoundException from the XSP page. I would expect
> that <handle-errors type="404"/> would be called in this situation (I
> might be mistaken - Nikola? Ken? ;)

Correct :-)

-- 
Nicola Ken Barozzi                   nicolaken@apache.org
            - verba volant, scripta manent -
  (discussions get forgotten, just Vadim remains)
---------------------------------------------------------------------


---------------------------------------------------------------------
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: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>


RE: Is it possible to fire an error from a XSL file ?

Posted by Vadim Gritsenko <va...@verizon.net>.
> From: sylvain.fetiveau@webmotion.com
[mailto:sylvain.fetiveau@webmotion.com]
> 
> Vadim Gritsenko wrote:
> >
> > You could write an extension function to the Xalan to throw
> > ResourceNotFoundException.
> 
> I just tried that, but in this case, it's not considered by the error
> handler as an error 404, but a simple error 500.
> 
> Any new idea ?

Two ideas:
1. Debug and find out why it is not 404.
Make as simple test: have a pipeline with XSP page and XML serializer,
and throw ResourceNotFoundException from the XSP page. I would expect
that <handle-errors type="404"/> would be called in this situation (I
might be mistaken - Nikola? Ken? ;)
2. Refactor to avoid this issue completely.

Vadim

> 
> > > -----Original Message-----
> > > From: sylvain.fetiveau@webmotion.com
> > [mailto:sylvain.fetiveau@webmotion.com]
> > > Sent: Monday, April 08, 2002 11:15 AM
> > > To: cocoon-users@xml.apache.org
> > > Subject: Is it possible to fire an error from a XSL file ?
> > >
> > > Hi,
> > >
> > > When someone requests an URL like /glossary/*.html, I use a single
XML
> > > file for all the glossaries + an XSL file to transform it (I pass
the
> > > filename of the glossary page to the XSL transformer). Sometimes,
an
> > > unexisting page is requested (i.e. a page which is not listed in
my
> > > large XML file). Is there a way to "fire" something to make cocoon
> > > consider this request as an error 404, which will be then handled
? As
> > > long as I handle the 404 errors, I guess that it's not a real
problem
> > if
> > > I already outputed some content when I "fire" my error... Or maybe
I
> > > should write a Xalan extension to redirect the user to my error
404
> > > page...
> > >
> > > Thank you in advance.
> 
> --
> °v° Sylvain Fétiveau   Tel. (613) 731-4046
> / \ Webmotion Inc.     http://www.webmotion.com
> " " mailto:sylvain.fetiveau@webmotion.com


---------------------------------------------------------------------
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: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>


Re: Is it possible to fire an error from a XSL file ?

Posted by Sylvain Fétiveau <sy...@webmotion.com>.
Vadim Gritsenko wrote:
> 
> You could write an extension function to the Xalan to throw
> ResourceNotFoundException.

I just tried that, but in this case, it's not considered by the error
handler as an error 404, but a simple error 500.

Any new idea ?

> > -----Original Message-----
> > From: sylvain.fetiveau@webmotion.com
> [mailto:sylvain.fetiveau@webmotion.com]
> > Sent: Monday, April 08, 2002 11:15 AM
> > To: cocoon-users@xml.apache.org
> > Subject: Is it possible to fire an error from a XSL file ?
> >
> > Hi,
> >
> > When someone requests an URL like /glossary/*.html, I use a single XML
> > file for all the glossaries + an XSL file to transform it (I pass the
> > filename of the glossary page to the XSL transformer). Sometimes, an
> > unexisting page is requested (i.e. a page which is not listed in my
> > large XML file). Is there a way to "fire" something to make cocoon
> > consider this request as an error 404, which will be then handled ? As
> > long as I handle the 404 errors, I guess that it's not a real problem
> if
> > I already outputed some content when I "fire" my error... Or maybe I
> > should write a Xalan extension to redirect the user to my error 404
> > page...
> >
> > Thank you in advance.

-- 
°v° Sylvain Fétiveau   Tel. (613) 731-4046
/ \ Webmotion Inc.     http://www.webmotion.com
" " mailto:sylvain.fetiveau@webmotion.com

---------------------------------------------------------------------
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: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>


RE: Is it possible to fire an error from a XSL file ?

Posted by Vadim Gritsenko <va...@verizon.net>.
You could write an extension function to the Xalan to throw
ResourceNotFoundException.

Vadim

> -----Original Message-----
> From: sylvain.fetiveau@webmotion.com
[mailto:sylvain.fetiveau@webmotion.com]
> Sent: Monday, April 08, 2002 11:15 AM
> To: cocoon-users@xml.apache.org
> Subject: Is it possible to fire an error from a XSL file ?
> 
> Hi,
> 
> When someone requests an URL like /glossary/*.html, I use a single XML
> file for all the glossaries + an XSL file to transform it (I pass the
> filename of the glossary page to the XSL transformer). Sometimes, an
> unexisting page is requested (i.e. a page which is not listed in my
> large XML file). Is there a way to "fire" something to make cocoon
> consider this request as an error 404, which will be then handled ? As
> long as I handle the 404 errors, I guess that it's not a real problem
if
> I already outputed some content when I "fire" my error... Or maybe I
> should write a Xalan extension to redirect the user to my error 404
> page...
> 
> Thank you in advance.
> 
> --
> °v° Sylvain Fétiveau   Tel. (613) 731-4046
> / \ Webmotion Inc.     http://www.webmotion.com
> " " mailto:sylvain.fetiveau@webmotion.com
> 
> ---------------------------------------------------------------------
> 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: <co...@xml.apache.org>
> For additional commands, e-mail: <co...@xml.apache.org>


---------------------------------------------------------------------
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: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>


Re: Is it possible to fire an error from a XSL file ?

Posted by Michael McKibben <mm...@ncube.com>.
I haven't tried this with Xalan, and the behavior is very processor
specific, but one idea is to try:

<xsl:message terminate="yes">404 Resource Not Found.</xsl:message>

in your stylesheet and then add a handle-errors section in your pipeline
with a serializer that sets the status-code="404". The unknown is how
Xalan handles the terminate="yes" attribute. If I recall correctly, Xalan
handles this by throwing an exception, which should bubble up and be
handled by the Cocoon error handler.

The suggestion by Liam is cleaner in that it is less
transformer specific, but I just thought I'd throw this out there as
quick and dirty option :)

Regards,

--mike

On Mon, 8 Apr 2002, Liam Morley wrote:

> What you might do (and this is just one approach) is to write a
> java transformer that will verify that the file exists, and if it doesn't,
> throw a ResourceNotFoundException(). Then, if it does exist, pass the SAX
> information on to the XSLT transformer. By that time, you don't have to
> worry whether or not you'll find it or not. Or (and I'm not sure about
> this) write a transformer that simply extends TraxTransformer, and
> overwrite the setup() method. From here, you can check parameters passed
> from the sitemap. You wouldn't have to overwrite any other code.
>
> Liam Morley
>
>
> On Mon, 8 Apr 2002, Sylvain Fétiveau wrote:
>
> > Hi,
> >
> > When someone requests an URL like /glossary/*.html, I use a single XML
> > file for all the glossaries + an XSL file to transform it (I pass the
> > filename of the glossary page to the XSL transformer). Sometimes, an
> > unexisting page is requested (i.e. a page which is not listed in my
> > large XML file). Is there a way to "fire" something to make cocoon
> > consider this request as an error 404, which will be then handled ? As
> > long as I handle the 404 errors, I guess that it's not a real problem if
> > I already outputed some content when I "fire" my error... Or maybe I
> > should write a Xalan extension to redirect the user to my error 404
> > page...
> >
> > Thank you in advance.
> >
> > --
> > °v° Sylvain Fétiveau   Tel. (613) 731-4046
> > / \ Webmotion Inc.     http://www.webmotion.com
> > " " mailto:sylvain.fetiveau@webmotion.com
> >
> > ---------------------------------------------------------------------
> > 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: <co...@xml.apache.org>
> > For additional commands, e-mail: <co...@xml.apache.org>
> >
> >
>
>
> ---------------------------------------------------------------------
> 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: <co...@xml.apache.org>
> For additional commands, e-mail: <co...@xml.apache.org>
>


---------------------------------------------------------------------
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: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>


Re: Is it possible to fire an error from a XSL file ?

Posted by Liam Morley <lm...@lovecraft.gdc.wpi.edu>.
What you might do (and this is just one approach) is to write a
java transformer that will verify that the file exists, and if it doesn't,
throw a ResourceNotFoundException(). Then, if it does exist, pass the SAX
information on to the XSLT transformer. By that time, you don't have to
worry whether or not you'll find it or not. Or (and I'm not sure about
this) write a transformer that simply extends TraxTransformer, and
overwrite the setup() method. From here, you can check parameters passed
from the sitemap. You wouldn't have to overwrite any other code.

Liam Morley


On Mon, 8 Apr 2002, Sylvain Fétiveau wrote:

> Hi,
>
> When someone requests an URL like /glossary/*.html, I use a single XML
> file for all the glossaries + an XSL file to transform it (I pass the
> filename of the glossary page to the XSL transformer). Sometimes, an
> unexisting page is requested (i.e. a page which is not listed in my
> large XML file). Is there a way to "fire" something to make cocoon
> consider this request as an error 404, which will be then handled ? As
> long as I handle the 404 errors, I guess that it's not a real problem if
> I already outputed some content when I "fire" my error... Or maybe I
> should write a Xalan extension to redirect the user to my error 404
> page...
>
> Thank you in advance.
>
> --
> °v° Sylvain Fétiveau   Tel. (613) 731-4046
> / \ Webmotion Inc.     http://www.webmotion.com
> " " mailto:sylvain.fetiveau@webmotion.com
>
> ---------------------------------------------------------------------
> 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: <co...@xml.apache.org>
> For additional commands, e-mail: <co...@xml.apache.org>
>
>


---------------------------------------------------------------------
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: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>


Is it possible to fire an error from a XSL file ?

Posted by Sylvain Fétiveau <sy...@webmotion.com>.
Hi,

When someone requests an URL like /glossary/*.html, I use a single XML
file for all the glossaries + an XSL file to transform it (I pass the
filename of the glossary page to the XSL transformer). Sometimes, an
unexisting page is requested (i.e. a page which is not listed in my
large XML file). Is there a way to "fire" something to make cocoon
consider this request as an error 404, which will be then handled ? As
long as I handle the 404 errors, I guess that it's not a real problem if
I already outputed some content when I "fire" my error... Or maybe I
should write a Xalan extension to redirect the user to my error 404
page...

Thank you in advance.

-- 
°v° Sylvain Fétiveau   Tel. (613) 731-4046
/ \ Webmotion Inc.     http://www.webmotion.com
" " mailto:sylvain.fetiveau@webmotion.com

---------------------------------------------------------------------
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: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>


Re: Use of cocoon 1.8.2 with Tomcat 3.3

Posted by Roman Medina <ro...@batmap.com>.
On Tue, 15 Jan 2002 22:14:34 +0530, you wrote:

>hi,
>u can  find  this error troubleshooted  in  docs

 :-? Where? (give url, plz). I didn't find any related stuff in docs.
Only Brian's response helped me...

--
Román Medina-Heigl Hernández
Sysadmin & Security Officer
@ BatMap S.A.

---------------------------------------------------------------------
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: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>


Re: Use of cocoon 1.8.2 with Tomcat 3.3

Posted by re...@hotmail.com.
hi,
u can  find  this error troubleshooted  in  docs

thanx
sumit
----- Original Message ----- 
From: Eric BASLEY <er...@odb.fr>
To: <co...@xml.apache.org>
Sent: Thursday, August 08, 2002 8:11 PM
Subject: Use of cocoon 1.8.2 with Tomcat 3.3


> 
> 
> I'm trying to use cocoon 1.8.2 with Tomcat 3.3, and I can't fix this
> error message :
> 
> java.lang.RuntimeException: Error loading logicsheet at
> resource://org/apache/cocoon/processor/xsp/library/java/util.xsl due to
> java.lang.Exception: Resource not found or retrieving error.
> 
> 
> Obviously it's a classpath setup problem, but I can't find where to put
> cocoon.jar to able cocoon to find 'util.xsl'.
> 
> How does it work?
> 
> Kindly regards,
> 
> Eric BASLEY
> 
> ---------------------------------------------------------------------
> 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: <co...@xml.apache.org>
> For additional commands, e-mail: <co...@xml.apache.org>
> 
> 

---------------------------------------------------------------------
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: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>


Re: Use of cocoon 1.8.2 with Tomcat 3.3

Posted by Roman Medina <ro...@batmap.com>.
 I had the same problem as you. I resolved following Brian's idea.

 Summarizing, edit your "cocoon.properties" file and change the
"resource" lines to "file" lines. You'll end with something like:

# Set the libraries associated with the given namespace.
# Use the syntax:
#   processor.xsp.logicsheet.<namespace-tag>.<language> = URL to file
# where "URL to file" is usually starting with file:// if you locate
# your custom library in your file system.
processor.xsp.logicsheet.context.java  = 
file:///usr/local/cocoon-1.8.2/src/org/apache/cocoon/processor/xsp/library/java/context.xsl
#processor.xsp.logicsheet.cookie.java   = 
file:///usr/local/cocoon-1.8.2/src/org/apache/cocoon/processor/xsp/library/java/cookie.xsl
processor.xsp.logicsheet.global.java   = 
file:///usr/local/cocoon-1.8.2/src/org/apache/cocoon/processor/xsp/library/java/global.xsl
processor.xsp.logicsheet.request.java  = 
file:///usr/local/cocoon-1.8.2/src/org/apache/cocoon/processor/xsp/library/java/request.xsl
processor.xsp.logicsheet.response.java = 
file:///usr/local/cocoon-1.8.2/src/org/apache/cocoon/processor/xsp/library/java/response.xsl
processor.xsp.logicsheet.session.java  = 
file:///usr/local/cocoon-1.8.2/src/org/apache/cocoon/processor/xsp/library/java/session.xsl
processor.xsp.logicsheet.util.java     = 
file:///usr/local/cocoon-1.8.2/src/org/apache/cocoon/processor/xsp/library/java/util.xsl
processor.xsp.logicsheet.sql.java      = 
file:///usr/local/cocoon-1.8.2/src/org/apache/cocoon/processor/xsp/library/sql/sql.xsl
processor.xsp.logicsheet.esql.java      = 
file:///usr/local/cocoon-1.8.2/src/org/apache/cocoon/processor/xsp/library/sql/esql.xsl
processor.xsp.logicsheet.fp.java       = 
file:///usr/local/cocoon-1.8.2/src/org/apache/cocoon/processor/xsp/library/fp/fp.xsl


 Perhaps you'll have to adjust cocoon path. Give thanks to Brian
(brian.blakeley@cogeco.ca), not me :-)))

--
Román Medina-Heigl Hernández
Sysadmin & Security Officer
@ BatMap S.A.



On 08 Aug 2002 16:41:36 +0200, you wrote:

>
>
>I'm trying to use cocoon 1.8.2 with Tomcat 3.3, and I can't fix this
>error message :
>
>java.lang.RuntimeException: Error loading logicsheet at
>resource://org/apache/cocoon/processor/xsp/library/java/util.xsl due to
>java.lang.Exception: Resource not found or retrieving error.
>
>
>Obviously it's a classpath setup problem, but I can't find where to put
>cocoon.jar to able cocoon to find 'util.xsl'.
>
>How does it work?
>
>Kindly regards,
>
>Eric BASLEY
>
>---------------------------------------------------------------------
>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: <co...@xml.apache.org>
>For additional commands, e-mail: <co...@xml.apache.org>


---------------------------------------------------------------------
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: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>