RE: the classloader doesn't like XML in TC 3.2.3 and TC 4.0

2001-11-26 Thread Arnaud Héritier



 -Message d'origine-
 De:   Domingo Aguilera [SMTP:[EMAIL PROTECTED]]
 Date: vendredi 23 novembre 2001 20:27
 À:[EMAIL PROTECTED]
 Objet:RE: the classloader doesn't like XML in TC 3.2.3 and TC 4.0
 
 More on...
 
 http://www.mail-archive.com/tomcat-user%40jakarta.apache.org/msg37534.html
 
 I am having the same problem when trying to use xalan within tomcat 4.0.1
 
 Xalan includes a xerces.jar file which I copied to
 $CATALINA_HOME/webapps/mywebapp/WEB-INF/lib
 
 ...
 
 1 - If placing crimson.jar and jaxp.jar files in the above directory is the
 solution, where can I get those versions?

In fact it's only a solution with Tomcat 4.0 and not with Tomcat 4.01.
I just upgraded my release to 4.01 and now Tomcat uses Xerces with Jasper so my 
problem with the conflict is resolved.

Just for information :

crimson : http://xml.apache.org/crimson/index.html
jasper is build on tomcat

 
 2 - It seems that jasper in tomcat 4.0.1 is using xerces.jar instead of
 crimson.jar , am I right ?

yes. I didn't know

 
 3 - I hope somebody in this beautiful world will sometime write an article
 or book on conflicting issues between xml parsers when using tomcat.  Just
 kidding.

oh my god, help us ;-)

 
 
 
 --
 To unsubscribe:   mailto:[EMAIL PROTECTED]
 For additional commands: mailto:[EMAIL PROTECTED]
 Troubles with the list: mailto:[EMAIL PROTECTED]


--
To unsubscribe:   mailto:[EMAIL PROTECTED]
For additional commands: mailto:[EMAIL PROTECTED]
Troubles with the list: mailto:[EMAIL PROTECTED]




RE: the classloader doesn't like XML in TC 3.2.3 and TC 4.0

2001-11-24 Thread Domingo Aguilera

More on...

http://www.mail-archive.com/tomcat-user%40jakarta.apache.org/msg37534.html

I am having the same problem when trying to use xalan within tomcat 4.0.1

Xalan includes a xerces.jar file which I copied to
$CATALINA_HOME/webapps/mywebapp/WEB-INF/lib

...

1 - If placing crimson.jar and jaxp.jar files in the above directory is the
solution, where can I get those versions?

2 - It seems that jasper in tomcat 4.0.1 is using xerces.jar instead of
crimson.jar , am I right ?

3 - I hope somebody in this beautiful world will sometime write an article
or book on conflicting issues between xml parsers when using tomcat.  Just
kidding.



--
To unsubscribe:   mailto:[EMAIL PROTECTED]
For additional commands: mailto:[EMAIL PROTECTED]
Troubles with the list: mailto:[EMAIL PROTECTED]




RE: the classloader doesn't like XML in TC 3.2.3 and TC 4.0

2001-11-21 Thread Arnaud Héritier

Hello.

With some documentations about Tomcat, Xalan, Xerces, Crimson and the 
mailing list archive, I finally found what's happenned.

The problem is that Jasper (the JSP compiler) can (and should) see my 
webapp classloader to compile JSPs files.
So by default Jasper use the crimson XML parser.
In the Crimson Jar there're 2 files in the META-INF/services :
javax.xml.parsers.DocumentBuilderFactory with the value 
org.apache.crimson.jaxp.DocumentBuilderFactoryImpl
javax.xml.parsers.SAXParserFactory with the value 
org.apache.crimson.jaxp.SAXParserFactoryImpl
This two files are used to configure the parser and to say it which class 
to use.
But when I use Xalan and so Xerces by default the classloader load the 
xerces Jar file which defines its own services files with
javax.xml.parsers.DocumentBuilderFactory with the value 
org.apache.xerces.jaxp.DocumentBuilderFactoryImpl
javax.xml.parsers.SAXParserFactory with the value 
org.apache.xerces.jaxp.SAXParserFactoryImpl
This System properties are then replaced. There's a ClassCastException 
between the class org.apache.xerces.jaxp.DocumentBuilderFactoryImpl

and the class org.apache.crimson.jaxp.DocumentBuilderFactoryImpl


To resolve this problem there are several solutions.

1) Use xerces in tomcat instead of crimson as XML Parser. See the paragraph 
Tomcat 4 and XML Parsers in the Class Loader Documentation 
(http://jakarta.apache.org/tomcat/tomcat-4.0-doc/class-loader-howto.html)
2) Use crimson in my webapp instead xerces. I replaced the xerces.jar by 
the crimson.jar and jaxp.jar.
This two solutions are working so I hope that it will help some of you.

Arnaud H

 -Message d'origine-
 De:   Arnaud Héritier [SMTP:[EMAIL PROTECTED]]
 Date: mardi 20 novembre 2001 17:59
 À:Tomcat Users List (Adresse de messagerie)
 Objet:the classloader doesn't like XML in TC 3.2.3 and TC 4.0

 Snif, I'm in despair :-)

 I'm developping a web application with the Struts Framework. All worked
 correctly until I need to develop a new servlet used to transform XML
 Documents in HTML with Xalan.
 I used xerces with Struts, and all was good.
 But now I added xalan (xalan.jar,xml-apis.jar, and replace the 
xerces.jar)
 from the xalan J2 D13 distribution in the lib directory of my web
 application.
 So from now after each time when I access to my Xalan Servlet I can't
 access to the JSPs.
 Jasper give me this error :

 java.lang.ClassCastException:
 org.apache.xerces.jaxp.DocumentBuilderFactoryImpl
   at
 javax.xml.parsers.DocumentBuilderFactory.newInstance(DocumentBuilderFact 
 ory.java:116)
   at
 
org.apache.jasper.parser.ParserUtils.parseXMLDocument(ParserUtils.java:183)
   at
 org.apache.jasper.compiler.TagLibraryInfoImpl.parseTLD(TagLibraryInfoImp 
 l.java:278)
   at
 
org.apache.jasper.compiler.TagLibraryInfoImpl.(TagLibraryInfoImpl.java:219)
   at org.apache.jasper.compiler.JspParseEventListener.processTaglibDirect 
 ive(JspParseEventListener.java:1150)
   at
 org.apache.jasper.compiler.JspParseEventListener.handleDirective(JspPars 
 eEventListener.java:755)
   at
 org.apache.jasper.compiler.DelegatingListener.handleDirective(Delegating 
 Listener.java:121)
   at org.apache.jasper.compiler.Parser$Directive.accept(Parser.java:243)
   at org.apache.jasper.compiler.Parser.parse(Parser.java:1132)
   at org.apache.jasper.compiler.Parser.parse(Parser.java:1091)
   at org.apache.jasper.compiler.Parser.parse(Parser.java:1087)
   at
 org.apache.jasper.compiler.ParserController.parse(ParserController.java: 
 213)
   at org.apache.jasper.compiler.Compiler.compile(Compiler.java:210)
   at org.apache.jasper.servlet.JspServlet.loadJSP(JspServlet.java:543)
   at
 org.apache.jasper.servlet.JspServlet$JspServletWrapper.loadIfNecessary(J 
 spServlet.java:176)
   at
 org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServle 
 t.java:188)
   at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java: 
 381)
   at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:473)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:1264)
   at
 org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatc 
 her.java:672)
   at
 org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDisp 
 atcher.java:430)
   at
 org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispat 
 cher.java:354)
   at
 org.apache.struts.action.ActionServlet.processActionForward(ActionServle 
 t.java:1758)
   at 
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1595)
   at
 com.sopra.projet.aladin.pfe.stock.gui.servlet.PFEActionServlet.process(P 
 FEActionServlet.java:137)
   at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:491)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:1125)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:1264)
   

Re: the classloader doesn't like XML in TC 3.2.3 and TC 4.0

2001-11-21 Thread Barry White

Does Crimson have any advantages/disadvantages over Xerces?

What does your webapp do with the xml?

P.S.  Thanks for the followup (even if you fixed your own problem).  Things
like this are very usefull when troubleshooting an application.

Barry

- Original Message -
From: Arnaud Héritier [EMAIL PROTECTED]
To: Tomcat Users List (Adresse de messagerie)
[EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Wednesday, November 21, 2001 6:07 AM
Subject: RE: the classloader doesn't like XML in TC 3.2.3 and TC 4.0


Hello.

With some documentations about Tomcat, Xalan, Xerces, Crimson and the
mailing list archive, I finally found what's happenned.

The problem is that Jasper (the JSP compiler) can (and should) see my
webapp classloader to compile JSPs files.
So by default Jasper use the crimson XML parser.
In the Crimson Jar there're 2 files in the META-INF/services :
javax.xml.parsers.DocumentBuilderFactory with the value
org.apache.crimson.jaxp.DocumentBuilderFactoryImpl
javax.xml.parsers.SAXParserFactory with the value
org.apache.crimson.jaxp.SAXParserFactoryImpl
This two files are used to configure the parser and to say it which class
to use.
But when I use Xalan and so Xerces by default the classloader load the
xerces Jar file which defines its own services files with
javax.xml.parsers.DocumentBuilderFactory with the value
org.apache.xerces.jaxp.DocumentBuilderFactoryImpl
javax.xml.parsers.SAXParserFactory with the value
org.apache.xerces.jaxp.SAXParserFactoryImpl
This System properties are then replaced. There's a ClassCastException
between the class org.apache.xerces.jaxp.DocumentBuilderFactoryImpl

and the class org.apache.crimson.jaxp.DocumentBuilderFactoryImpl


To resolve this problem there are several solutions.

1) Use xerces in tomcat instead of crimson as XML Parser. See the paragraph
Tomcat 4 and XML Parsers in the Class Loader Documentation
(http://jakarta.apache.org/tomcat/tomcat-4.0-doc/class-loader-howto.html)
2) Use crimson in my webapp instead xerces. I replaced the xerces.jar by
the crimson.jar and jaxp.jar.
This two solutions are working so I hope that it will help some of you.

Arnaud H

 -Message d'origine-
 De: Arnaud Héritier [SMTP:[EMAIL PROTECTED]]
 Date: mardi 20 novembre 2001 17:59
 À: Tomcat Users List (Adresse de messagerie)
 Objet: the classloader doesn't like XML in TC 3.2.3 and TC 4.0

 Snif, I'm in despair :-)

 I'm developping a web application with the Struts Framework. All worked
 correctly until I need to develop a new servlet used to transform XML
 Documents in HTML with Xalan.
 I used xerces with Struts, and all was good.
 But now I added xalan (xalan.jar,xml-apis.jar, and replace the
xerces.jar)
 from the xalan J2 D13 distribution in the lib directory of my web
 application.
 So from now after each time when I access to my Xalan Servlet I can't
 access to the JSPs.
 Jasper give me this error :

 java.lang.ClassCastException:
 org.apache.xerces.jaxp.DocumentBuilderFactoryImpl
 at
 javax.xml.parsers.DocumentBuilderFactory.newInstance(DocumentBuilderFact
 ory.java:116)
 at

org.apache.jasper.parser.ParserUtils.parseXMLDocument(ParserUtils.java:183)
 at
 org.apache.jasper.compiler.TagLibraryInfoImpl.parseTLD(TagLibraryInfoImp
 l.java:278)
 at

org.apache.jasper.compiler.TagLibraryInfoImpl.(TagLibraryInfoImpl.java:219)
 at org.apache.jasper.compiler.JspParseEventListener.processTaglibDirect
 ive(JspParseEventListener.java:1150)
 at
 org.apache.jasper.compiler.JspParseEventListener.handleDirective(JspPars
 eEventListener.java:755)
 at
 org.apache.jasper.compiler.DelegatingListener.handleDirective(Delegating
 Listener.java:121)
 at org.apache.jasper.compiler.Parser$Directive.accept(Parser.java:243)
 at org.apache.jasper.compiler.Parser.parse(Parser.java:1132)
 at org.apache.jasper.compiler.Parser.parse(Parser.java:1091)
 at org.apache.jasper.compiler.Parser.parse(Parser.java:1087)
 at
 org.apache.jasper.compiler.ParserController.parse(ParserController.java:
 213)
 at org.apache.jasper.compiler.Compiler.compile(Compiler.java:210)
 at org.apache.jasper.servlet.JspServlet.loadJSP(JspServlet.java:543)
 at
 org.apache.jasper.servlet.JspServlet$JspServletWrapper.loadIfNecessary(J
 spServlet.java:176)
 at
 org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServle
 t.java:188)
 at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:
 381)
 at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:473)
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:1264)
 at
 org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatc
 her.java:672)
 at
 org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDisp
 atcher.java:430)
 at
 org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispat
 cher.java:354)
 at
 org.apache.struts.action.ActionServlet.processActionForward(ActionServle
 t.java:1758)
 at
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1595)
 at