NoClassDefFoundError problems with help of Apache

2020-03-24 06:18发布

Getting an error if using Apache Commons Validator:

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

Even if, Apache Commons Validator /dependencies state that ORO.jar is optional.

6条回答
成全新的幸福
2楼-- · 2020-03-24 06:47

Apparently you're using something that requires that class.

Compiler wins over documentation.

查看更多
▲ chillily
3楼-- · 2020-03-24 06:47

You can download this dependency to get Perl5Util.

<dependency>
     <groupId>oro</groupId>
     <artifactId>oro</artifactId>
     <version>2.0.8</version>
</dependency>
查看更多
Root(大扎)
4楼-- · 2020-03-24 06:53

Put the jar containing "org/apache/oro/text/perl/Perl5Util" class on the server and modify the classpath of the server to include the jar file.

查看更多
放荡不羁爱自由
5楼-- · 2020-03-24 07:09

I was having this issue on version 1.3.1 of Apache's Validator. I rolled back to 1.3.0 and it included the oro dependency just fine.

If you don't rely on something from the dot release, perhaps this could work for you as well.

查看更多
迷人小祖宗
6楼-- · 2020-03-24 07:11

You need to get Apache oro. I've version 2.0.8 though Maven and it has Perl5Util:

mpandit-mbp:2.0.8 mpandit$ jar tvf oro-2.0.8.jar | grep 'Perl5Util'
7818 Sun Dec 28 23:00:18 PST 2003 org/apache/oro/text/perl/Perl5Util.class
查看更多
我想做一个坏孩纸
7楼-- · 2020-03-24 07:13

The newer version (1.4.0) of commons-validator has no dependency on oro anymore. Using Maven:

<dependency>
    <groupId>commons-validator</groupId>
    <artifactId>commons-validator</artifactId>
    <version>1.4.0</version>
</dependency>
查看更多
登录 后发表回答