Discussion:
[Resin-interest] SAXParseException when using (jakarta's) JSTL in JSP
Olaf Krische
2008-01-28 14:15:30 UTC
Permalink
Hello,

currently i am trying to make my application of mine Resin 3.1 ready, while
it can still run on Resin 2.1. For this i use the jakarta standard tag
library (1.0.6), not for the tag implementations, but for its
EvaluationManager to be able to use EL in my tags.

Ok, this is what i do:

1. Download Resin 2.1 snapshot
2. Starting with "java -jar lib/resin.jar start"
3. http://localhost:8080/resin-doc/index.jsp

Works perfectly.

4. Now i add to resin-doc a new file "indexXML.jsp".
5. I add the standard.jar (1.0.6) to resin-doc/WEB-INF/lib/
6. Receiving now a SAXParseException, when calling
http://localhost:8080/resin-doc/indexXML.jsp

I dont know, what exactly is broken here. Any idea?

This is the complete exception message (jsp source is below)

500 Servlet Exception

/indexXML.jsp:1: org.xml.sax.SAXParseException: The prefix "c" for element
"c:set" is not bound.

1: <?xml version="1.0" encoding="UTF-8"?>
2: <jsp:root xmlns="http://www.w3.org/1999/xhtml"
xmlns:jsp="http://java.sun.com/JSP/Page"
xmlns:c="http://java.sun.com/jstl/core" version="2.1">
3:

This is the indexXML.jsp:

<?xml version="1.0" encoding="UTF-8"?>
<jsp:root xmlns="http://www.w3.org/1999/xhtml"
xmlns:jsp="http://java.sun.com/JSP/Page"
xmlns:c="http://java.sun.com/jstl/core" version="2.1">
<c:set var="locale">de_DE</c:set>
<c:out value="${locale}"/>
</jsp:root>

The jar can be found here ( i tried with 1.1.2, did not work as well)

- http://jakarta.apache.org/taglibs/doc/standard-doc/intro.html
--
View this message in context: http://www.nabble.com/SAXParseException-when-using-%28jakarta%27s%29-JSTL-in-JSP-tp15136126p15136126.html
Sent from the Resin mailing list archive at Nabble.com.
Erik Forkalsrud
2008-01-28 19:37:46 UTC
Permalink
Post by Olaf Krische
Hello,
currently i am trying to make my application of mine Resin 3.1 ready, while
it can still run on Resin 2.1. For this i use the jakarta standard tag
library (1.0.6), not for the tag implementations, but for its
EvaluationManager to be able to use EL in my tags.
1. Download Resin 3.1 snapshot (resin-3.1.s080126)
2. Starting with "java -jar lib/resin.jar start"
3. http://localhost:8080/resin-doc/index.jsp
Works perfectly.
4. Now i add to resin-doc a new file "indexXML.jsp".
5. I add the standard.jar (1.0.6) to resin-doc/WEB-INF/lib/
6. Receiving now a SAXParseException, when calling
http://localhost:8080/resin-doc/indexXML.jsp
I dont know, what exactly is broken here. Any idea?
This is the complete exception message (jsp source is below)
500 Servlet Exception
/indexXML.jsp:1: org.xml.sax.SAXParseException: The prefix "c" for element
"c:set" is not bound.
1: <?xml version="1.0" encoding="UTF-8"?>
2: <jsp:root xmlns="http://www.w3.org/1999/xhtml"
xmlns:jsp="http://java.sun.com/JSP/Page"
xmlns:c="http://java.sun.com/jstl/core" version="2.1">
I think in resin 3.1.x you should use http://java.sun.com/jsp/jstl/core
for the "c" JSTL tags. (note the extra "/jsp/")


- Erik -
Olaf Krische
2008-01-28 19:55:26 UTC
Permalink
Hello Erik,

thank you for your answer. And yes, you were right about the missing 'jsp' .
My heart started to bump. I have changed the example accordingly. Sadly, the
error will not disappear:

/indexXML.jsp:1: org.xml.sax.SAXParseException: The prefix "c" for element
"c:set" is not bound.

1: <?xml version="1.0" encoding="UTF-8"?>
2: <jsp:root xmlns="http://www.w3.org/1999/xhtml"
xmlns:jsp="http://java.sun.com/JSP/Page"
xmlns:c="http://java.sun.com/jsp/jstl/core" version="2.1">
Post by Erik Forkalsrud
Post by Olaf Krische
1. Download Resin 3.1 snapshot (resin-3.1.s080126)
2. Starting with "java -jar lib/resin.jar start"
3. http://localhost:8080/resin-doc/index.jsp
Works perfectly.
4. Now i add to resin-doc a new file "indexXML.jsp".
5. I add the standard.jar (1.0.6) to resin-doc/WEB-INF/lib/
6. Receiving now a SAXParseException, when calling
http://localhost:8080/resin-doc/indexXML.jsp
I think in resin 3.1.x you should use http://java.sun.com/jsp/jstl/core
for the "c" JSTL tags. (note the extra "/jsp/")
The changed indexXML.jsp:

<?xml version="1.0" encoding="UTF-8"?>
<jsp:root xmlns="http://www.w3.org/1999/xhtml"
xmlns:jsp="http://java.sun.com/JSP/Page"
xmlns:c="http://java.sun.com/jsp/jstl/core" version="2.1">

<c:set var="locale">de_AT</c:set>
<c:out value="${locale}"/>

</jsp:root>
--
View this message in context: http://www.nabble.com/SAXParseException-when-using-%28jakarta%27s%29-JSTL-in-JSP-%28Resin-3.1%29-tp15136126p15143991.html
Sent from the Resin mailing list archive at Nabble.com.
Erik Forkalsrud
2008-01-30 00:19:08 UTC
Permalink
It seems to work better if you use Rein's XML parser, i.e. add this to
your resin.conf:

<system-property
javax.xml.parsers.DocumentBuilderFactory="com.caucho.xml.parsers.XmlDocumentBuilderFactory"
/>
<system-property
javax.xml.parsers.SAXParserFactory="com.caucho.xml.parsers.XmlSAXParserFactory"
/>

There is a bug that looks very similar to this:
http://bugs.caucho.com/view.php?id=1647 that was marked as fixed in
version 3.1.1 -- maybe it's not completely fixed after all?


- Erik -
Post by Olaf Krische
Hello Erik,
thank you for your answer. And yes, you were right about the missing 'jsp' .
My heart started to bump. I have changed the example accordingly. Sadly, the
/indexXML.jsp:1: org.xml.sax.SAXParseException: The prefix "c" for element
"c:set" is not bound.
1: <?xml version="1.0" encoding="UTF-8"?>
2: <jsp:root xmlns="http://www.w3.org/1999/xhtml"
xmlns:jsp="http://java.sun.com/JSP/Page"
xmlns:c="http://java.sun.com/jsp/jstl/core" version="2.1">
Post by Erik Forkalsrud
Post by Olaf Krische
1. Download Resin 3.1 snapshot (resin-3.1.s080126)
2. Starting with "java -jar lib/resin.jar start"
3. http://localhost:8080/resin-doc/index.jsp
Works perfectly.
4. Now i add to resin-doc a new file "indexXML.jsp".
5. I add the standard.jar (1.0.6) to resin-doc/WEB-INF/lib/
6. Receiving now a SAXParseException, when calling
http://localhost:8080/resin-doc/indexXML.jsp
I think in resin 3.1.x you should use http://java.sun.com/jsp/jstl/core
for the "c" JSTL tags. (note the extra "/jsp/")
<?xml version="1.0" encoding="UTF-8"?>
<jsp:root xmlns="http://www.w3.org/1999/xhtml"
xmlns:jsp="http://java.sun.com/JSP/Page"
xmlns:c="http://java.sun.com/jsp/jstl/core" version="2.1">
<c:set var="locale">de_AT</c:set>
<c:out value="${locale}"/>
</jsp:root>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://maillist.caucho.com/pipermail/resin-interest/attachments/20080129/95da9d17/attachment.html
Olaf Krische
2008-02-05 15:25:56 UTC
Permalink
Hello Erik,

your idea to change the system properties did relax the error.

Thank you!

(I am unable to re-open the Bug or to submit a new bug, i dont get any email
from Mantis. Grmbl.)
Post by Erik Forkalsrud
It seems to work better if you use Rein's XML parser, i.e. add this to
<system-property
javax.xml.parsers.DocumentBuilderFactory="com.caucho.xml.parsers.XmlDocumentBuilderFactory"
/>
<system-property
javax.xml.parsers.SAXParserFactory="com.caucho.xml.parsers.XmlSAXParserFactory"
/>
http://bugs.caucho.com/view.php?id=1647 that was marked as fixed in
version 3.1.1 -- maybe it's not completely fixed after all?
--
View this message in context: http://www.nabble.com/SAXParseException-when-using-%28jakarta%27s%29-JSTL-in-JSP-%28Resin-3.1%29-tp15136126p15291422.html
Sent from the Resin mailing list archive at Nabble.com.
Loading...