On 10/20/06, Allen,Eva <[EMAIL PROTECTED]> wrote:
I sent this message to the tomcat users list also because I wasn't sure where the actual problem lies--with tomcat or with the digester. Anyway, here's the problem: I want to use the Jakarta commons digester xmlrules package to parse the xml I get from a web service I access from within a service. This means I have to include four commons jar files within the classpath tomcat uses commons-digester, commons-logging, commons-beanutils and commons-collections. I tried putting the jar files in my CLASSPATH variable, but Tomcat builds its own classpath, so when the servlet executed I got a java.lang.NoClassDefFoundError. Tomcat (or the servlet) couldn't find org/apache/commons/digester/xmlrules/DigesterLoader. I am using Tomcat version 4.1.24. There is a version of the commons-digester jar file that comes with that tomcat in server/lib. So I put the commons-digester.jar file in server/lib in the commons/lib directory so that Tomcat would include the jar file in its classpath. However, when I did that, Tomcat wouldn't even start--the error message then was ClassNotFoundException. The relevant part of the stack trace is included here below. What gives? It looks like the version of commons-digester.jar that comes with tomcat 4.1.24 isn't even compatible with it, but that can't be right? I suppose the bigger question, though, is how can I get Jakarta digester and tomcat 4 to play nice with each other?
You should follow the standard practice for web applications and include all of your dependencies in your own application, rather than trying to depend on the container to satisfy some of them. The problem you are seeing is happening because the Digester cannot "see" your classes to instantiate them, because those classes are not "visible" outside of your web app. Once you put Digester inside of your web app, it will be able to see your classes and thus be able to instantiate them. And how can
I find out what version of *any* jar file I have when all I have is the name of the jar file?
Assuming you have the actual jar file (and not just the name of it), the manifest inside the jar file should include the version. -- Martin Cooper 2006-10-20 14:20:36.300 [ERROR ] main (digester.Digester) - Begin event
threw exception java.lang.ClassNotFoundException: org.apache.catalina.core.StandardServer at org.apache.catalina.loader.StandardClassLoader.loadClass(StandardClassLo ader.java:992) at org.apache.catalina.loader.StandardClassLoader.loadClass(StandardClassLo ader.java:857) at org.apache.commons.digester.ObjectCreateRule.begin(ObjectCreateRule.java :252) at org.apache.commons.digester.Rule.begin(Rule.java:200) at org.apache.commons.digester.Digester.startElement(Digester.java:1268) -- Eva Allen Consulting Software Engineer, OCLC, Inc. 6565 Frantz Rd., Dublin, OH 43017 614.764.6009 | [EMAIL PROTECTED] Views contained herein are my own; they do not necessarily reflect those of my employer --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]