At 02:08 PM 1/27/2002 +0100, you wrote: >Hello, > >as I saw in many mailing lists I am not the only one who had the following >problem, so I post a solution here. > >Problem: >After installing tomcat 4.01 all example JSPs in the provided applications >work well. But when you try to run your own JSPs in your own applications >you suddenly get this exception thrown: > >exception >javax.servlet.ServletException: Servlet.init() for servlet jsp threw >exception >... >... >root cause >java.lang.ClassCastException: >org.apache.xerces.jaxp.DocumentBuilderFactoryImpl > > >Solution (at least in my case): > >I had an xml parser version in my /appname/WEB-INF/lib directory which was >different from the xml parser located in {TOMCAT-ROOT}/common/lib. It seems >that if there is an xml parser located in the app's WEB-INF/lib directory, >then this parser is being used to compile the application's JSPs. And this >leads eventually to the ClassCastException. > >The application, where this error occured was originally transferred from >JRUN 3.1 where this behaviour does not occur. On a JRUN 3.1 server the xml >parser in an application's WEB-INF/lib directory is NOT being used to >compile the application's JSPs. However in tomcat 4.01 it is being USED. So >watch out about multiple xml-parser versions! > >Maybe this helps some people. > >Sincerely > >Michael Kastner
I had the same problem recently and due to a similar situation. I generated a .war file using my IDE's deploy tool, which then included the parser classes being used during development. Removing the package under my Tomcat WEB-INF directory fixed the problem. My problem was not with a JSP however, so this issue isn't limited to XML parsing in JSPs. Not sure what you mean about "this parser is being used to compile application's JSPs" though. Mark -- To unsubscribe: <mailto:[EMAIL PROTECTED]> For additional commands: <mailto:[EMAIL PROTECTED]> Troubles with the list: <mailto:[EMAIL PROTECTED]>