java.lang.NoClassDefFoundError: org/apache/oro/text/perl/Perl5Util

Problem

Validate an URL with Apache common URLValidator to validate an URL, but it hits following error message ?


java.lang.NoClassDefFoundError: org/apache/oro/text/perl/Perl5Util
	at org.apache.commons.validator.UrlValidator.isValid(UrlValidator.java:242)
	...
Caused by: java.lang.ClassNotFoundException: org.apache.oro.text.perl.Perl5Util
	at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1516)
	at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1361)
	at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
	... 28 more

Solution

The URLValidator class is required Jakarta-ORO library, make sure you include the oro-xxx.jar into your project class path.

You can get oro-xxx.jar from :
1. Jakarta-ORO official site – http://jakarta.apache.org/oro/index.html
2. Maven central repository


<dependency>
	<groupId>oro</groupId>
	<artifactId>oro</artifactId>
	<version>2.0.8</version>
</dependency>

5 comments on “java.lang.NoClassDefFoundError: org/apache/oro/text/perl/Perl5Util

  1. Use the org.apache.commons.validator.routines.EmailValidator version 1.4. No Oro dependency

    Reply
  2. Hi, i’m using spring (with out maven) and i having “NoClassDefFoundError” error, any idea how a can refer a class from the xml??.

    The xml is:

     
    
    <beans xmlns="http://www.springframework.org/schema/beans"
    	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    	xsi:schemaLocation="http://www.springframework.org/schema/beans
    	http://www.springframework.org/schema/beans/spring-beans-2.5.xsd">
     
    	<bean id="helloBean" class="Hello" />
    
    </beans>
     

    Thanks, great tutorials.
    SAlute

    Reply
    1. I second the above question. Do you know what can be done now that oro is retired? Thanks for the tutorials btw.

      Reply

Leave a Comment

Your email address will not be published. Required fields are marked *