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!
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!