Jakarta Commons-Validator config. problem

B

bb

I'm trying to user commons-validator stand-alone in a project under
Eclipse 2.1. I'm using Tomcat 4.1
and the Sysdeo plug-in to run Tomcat. I'm using ver. 1.1.4 of
commons-validator. I'm going by an example
purchased from 'The Jakarta Commons Online Bookshelf: Module 6
Validating Data with Validator' by Vikram Goyal.

The code follows:

ValidatorResources r = null;
InputStream in = null;

try {
in =
VendorPaymentValidator.class.getResourceAsStream("validator.xml");
r = new ValidatorResources(in);
}catch(Exception ex) {
System.err.println("VendorPaymentValidator ERROR: " +
ex.getMessage());
ex.printStackTrace();
throw new Exception(ex);
}

// OUTPUT IN ECLIPSE
Source not found for
ApplicationFilterChain.internalDoFilter(ServletRequest,
ServletResponse) line: 267

// OUTPUT ON JSP PAGE
java.lang.NoClassDefFoundError:
org/apache/commons/digester/xmlrules/DigesterLoader
at
org.apache.commons.validator.ValidatorResources.<init>(ValidatorResources.java:144)
at
org.apache.commons.validator.ValidatorResources.<init>(ValidatorResources.java:124)


Note that the catch() clause is never executed. The input stream is not
null. I've placed the commons-digester
and the commons-validator jar files in the web-apps/webapp/web-inf/lib
file. I experimented on placing them elsewhere
to no avail. Obviously the commons-digester is having a problem but I
don't understand why. If anyone else is using
the commons-validator successfully under Eclipse/Sysdeo, I'd appreciate
your advice on configuring it all!
 
Joined
Feb 7, 2012
Messages
1
Reaction score
0
RE:

common-validator depends on some other jars in Apache Common project. Try to add commons-digester-1.8.jar, and/or one of the following jars, until no exception thrown:

commons-beanutils-1.8.0.jar
commons-chain-1.2.jar
commons-digester-1.8.jar
commons-logging-1.0.4.jar
commons-validator-1.3.1.jar
oro-2.0.8.jar

P.S. I answer to this old thread so other may benefit from it as well.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,042
Latest member
icassiem

Latest Threads

Top