Where exactly are you adding the Jars ? I assume because you mention tomcat, you have a jsp that converts xml to html using the stylesheet. - I might be wrong.:-) Web apps are partitioned by class loaders, and classes loaded in one webapp are in a different 'classloader namespace' than those loaded at startup. Casting between classes loaded in different class loaders often results in this exception.
I would make sure that all the classes that I needed were in my webapp ( WEB-INF/lib and nowhere else ) for a start. Have a read of this link as well. http://jakarta.apache.org/tomcat/tomcat-4.1-doc/class-loader-howto.html John -----Original Message----- From: ODVARKO [mailto:[EMAIL PROTECTED]] Sent: Thursday, May 23, 2002 1:46 PM To: [EMAIL PROTECTED] Subject: Re: [castor-dev] Castor & Xalan I have done it. I have downloaded the JAR and have made it available for the application, but unfortunately the problem stay the same. When I try to create an instance of the class (i.e. javax/xml/transform/Source) like follows: Source s; ...it works. Honza -----Original Message----- From: Rainey, Michael [mailto:[EMAIL PROTECTED]] Sent: Thursday, May 23, 2002 7:39 PM To: [EMAIL PROTECTED] Subject: Re: [castor-dev] Castor & Xalan Xalan 2.3.1 ships with a jar file named "xml-apis.jar" that contains standard API classes like javax.xml.transform.Source. Just make sure that it's available to your application. -----Original Message----- From: ODVARKO [mailto:[EMAIL PROTECTED]] Sent: Thursday, May 23, 2002 10:22 AM To: [EMAIL PROTECTED] Subject: [castor-dev] Castor & Xalan Hi, all I would like to use Castor 0.9.3.9 & Tomcat 4.0.3 & Xalan 2.3.1, but when I try to run following code: TransformerFactory factory = TransformerFactory.newInstance(); Transformer xslt = factory.newTransformer(new StreamSource("Products.xslt")); xslt.transform(new StreamSource("Products.xml"), new StreamResult(new FileOutputStream("Products.html"))); the web application throws an exception as follows: java.lang.NoClassDefFoundError: javax/xml/transform/Source When I try to run it as a single application (i.e. through main method) everything works OK. Finally, I am using following JARs: castor-0.9.3.9.jar commons-beanutils.jar commons-collections.jar commons-dbcp.jar commons-digester.jar commons-logging.jar commons-pool.jar commons-services.jar commons-validator.jar jdbc-se2.0.jar jta1.0.1.jar mm.mysql-2.0.4-bin.jar Opta2000.jar servlet.jar struts.jar tilesForStruts1-0.jar xerces-J_1.4.0.jar Thanks for help. Honza ----------------------------------------------------------- If you wish to unsubscribe from this mailing, send mail to [EMAIL PROTECTED] with a subject of: unsubscribe castor-dev ----------------------------------------------------------- If you wish to unsubscribe from this mailing, send mail to [EMAIL PROTECTED] with a subject of: unsubscribe castor-dev ----------------------------------------------------------- If you wish to unsubscribe from this mailing, send mail to [EMAIL PROTECTED] with a subject of: unsubscribe castor-dev ----------------------------------------------------------- If you wish to unsubscribe from this mailing, send mail to [EMAIL PROTECTED] with a subject of: unsubscribe castor-dev
