Question

I have the following dependensies in my pom.xml :

<dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>commons-validator</groupId>
                <artifactId>commons-validator</artifactId>
                <version>1.1.3</version>
            </dependency>
            <dependency>
                <groupId>struts</groupId>
                <artifactId>struts</artifactId>
                <version>1.1</version>
            </dependency>
        </dependencies>
 </dependencyManagement>

My goal is to use more later version of commons-validator. Namely, I am going to use DomainValidator from 1.4.0 version.

I tried to change version, but struts throws exception like this:

java.lang.NoClassDefFoundError: org/apache/commons/validator/ValidatorResourcesInitializer

In the latest version of commons-validator class ValidatorResourcesInitializer is simply missing.

Will be good to know whether it possible to fix this one without changes of struts version. Could you suggest any alternative libraries for validation domain and IP addresses?

Was it helpful?

Solution

I've found guava validator com.google.common.net.InternetDomainName based on much newer version of RFC-3490.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top