Jakarta Commons-Validator config. problem

Discussion in 'Java' started by bb, Jul 12, 2005.

  1. bb

    bb Guest

    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!
     
    bb, Jul 12, 2005
    #1
    1. Advertising

  2. bb

    glVertex

    Joined:
    Feb 7, 2012
    Messages:
    1
    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.
     
    glVertex, Feb 7, 2012
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. FGB

    Jakarta Commons CLI

    FGB, Aug 6, 2003, in forum: Java
    Replies:
    0
    Views:
    555
  2. Replies:
    0
    Views:
    403
  3. Replies:
    0
    Views:
    419
  4. Barry
    Replies:
    1
    Views:
    2,558
  5. Marc Beckers

    Jakarta Commons Validator:

    Marc Beckers, Jul 27, 2006, in forum: Java
    Replies:
    0
    Views:
    437
    Marc Beckers
    Jul 27, 2006
Loading...

Share This Page