You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by jean-frederic clere <jf...@fujitsu-siemens.com> on 2001/03/02 14:29:04 UTC

Using Tomcat4.0 (CVS) with xerces

Hi,

There is (still) a problem using xerces with Tomcat4.0:
+++
Exception during startup processing
java.lang.reflect.InvocationTargetException:
javax.xml.parsers.FactoryConfigurationError:
org.apache.crimson.jaxp.SAXParserFactoryImpl
        at
javax.xml.parsers.SAXParserFactory.newInstance(SAXParserFactory.java:95)
        at
org.apache.catalina.util.xml.XmlMapper.readXml(XmlMapper.java:224)
        at
org.apache.catalina.startup.Catalina.start(Catalina.java:657)        
+++

That is because of ./server/lib/jaxp.jar, removing it is a good
work-around.
Where should this be fixed? Somewhere in the build of Tomcat? Or just in
the README?

The strange thing is as jasper works with the ./jasper/jaxp.jar and
./jasper/xerces.jar.
The ./jasper/jaxp.jar is useless for my try (the classes needed for
jasper are loaded correctly from the ./jasper/xerces.jar).
I have some questions:
What is the correct behaviour? Should not jasper try to load
./jasper/jaxp.jar and give an error?

If I try to crimson.jar for jasper I need ./jasper/jaxp.jar and
./jasper/crimson.jar, correct?

Cheers

Jean-frederic

Re: Using Tomcat4.0 (CVS) with xerces

Posted by jean-frederic clere <jf...@fujitsu-siemens.com>.
"Craig R. McClanahan" wrote:
> 
> jean-frederic clere wrote:
> 
> > Hi,
> >
> > There is (still) a problem using xerces with Tomcat4.0:
> 
> Could you expand on precisely what JAR files you have in what directories
> when it fails, and when it succeeds?


The result of build.sh gives the following jar files:
+++
./bin/bootstrap.jar
./lib/namingfactory.jar
./lib/jasper-runtime.jar
./common/lib/servlet.jar
./common/lib/naming.jar
./common/lib/jndi.jar
./server/lib/jaxp.jar
./server/lib/jakarta-regexp-1.2.jar
./server/lib/jakarta-regexp-1.3-dev.jar
./server/lib/xerces.jar
./server/lib/catalina.jar
./server/lib/warp.jar
./jasper/xerces.jar
./jasper/jaxp.jar
./jasper/jasper-compiler.jar
+++

And starting Tomcat fails, catalina.out contains:
+++
    Exception during startup processing
java.lang.reflect.InvocationTargetException:
javax.xml.parsers.FactoryConfigurationError:
org.apache.crimson.jaxp.SAXParserFactoryImpl
        at
javax.xml.parsers.SAXParserFactory.newInstance(SAXParserFactory.java:95)
        at
org.apache.catalina.util.xml.XmlMapper.readXml(XmlMapper.java:224)
        at org.apache.catalina.startup.Catalina.start(Catalina.java:657)
        at
org.apache.catalina.startup.Catalina.execute(Catalina.java:627)
        at
org.apache.catalina.startup.Catalina.process(Catalina.java:177)
        at java.lang.reflect.Method.invoke(Native Method)
        at
org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:177)   
+++
To fix it, I have removed
./server/lib/jaxp.jar                                                                          

>  The test case that I know works
> correctly (at least for my tests) is to leave Jasper using JAXP/1.1 as it
> does by default, and stick xerces.jar in your WEB-INF/lib directory.
> 
> In general, you would use "jaxp.jar" *and* "crimson.jar" if you wanted to
> use JAXP/1.1, and *only* "xerces.jar" if you wanted to use xerces.  However,
> last time I checked Xerces did not have complete support for the JAXP 1.1
> APIs, so you would not be able to use it  for JSP pages in the XML syntax.

So that could be the reason why I have got the exception:
+++
A Servlet Exception Has Occurred
Exception Report:
javax.servlet.ServletException:
javax.xml.transform.TransformerException: SAX Exception
        at
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:441)
        at org.apache.jsp.book_jsp._jspService(book_jsp.java:103)
        at
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
        at
org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:200)
        at
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:357)
        at
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:431)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
+++
When I try to use xsl tags from jakarta-tablibs.

Cheers

Jean-frederic

> 
> Craig McClanahan
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
> For additional commands, email: tomcat-dev-help@jakarta.apache.org

Re: Using Tomcat4.0 (CVS) with xerces

Posted by "Craig R. McClanahan" <Cr...@eng.sun.com>.
jean-frederic clere wrote:

> Hi,
>
> There is (still) a problem using xerces with Tomcat4.0:

Could you expand on precisely what JAR files you have in what directories
when it fails, and when it succeeds?  The test case that I know works
correctly (at least for my tests) is to leave Jasper using JAXP/1.1 as it
does by default, and stick xerces.jar in your WEB-INF/lib directory.

In general, you would use "jaxp.jar" *and* "crimson.jar" if you wanted to
use JAXP/1.1, and *only* "xerces.jar" if you wanted to use xerces.  However,
last time I checked Xerces did not have complete support for the JAXP 1.1
APIs, so you would not be able to use it  for JSP pages in the XML syntax.

Craig McClanahan