java.lang.ClassNotFoundException: org.apache.commons.lang.StringUtils from BaseClassLoader

拜拜、爱过 提交于 2019-12-05 00:51:38

Your code seems to be using apace-commons-lang package . Do add the jar from here http://mvnrepository.com/artifact/commons-lang/commons-lang/2.6. Chek for the version you are using. Add the jar to your lib folder/classpath.

I received the same error, I added to my pom.xml the following lines and worked fine after maven install:

<dependencies>

        <!-- commons lang dependency -->
        <dependency>
            <groupId>commons-lang</groupId>
            <artifactId>commons-lang</artifactId>
            <version>2.6</version>
        </dependency>

</dependencies> 
mas_kur1

In case you use maven and Ubuntu 14.04:

This can be caused by the maven version included in Ubuntu 14.04, and the workaround is to download the maven tarball from http://maven.apache.org/download.cgi and use that version instead of the default version provided by the distribution.

More information: https://github.com/airbnb/chronos/issues/211

EDIT: You can also add a symlink to commons-lang.jar to avoid having to do a custom install (Source and @Shoham in the comments)

cd /usr/share/maven/lib
sudo ln -s ../../java/commons-lang.jar .

Verify that the paths are correct on your system before attempting. They should work for Ubuntu 14.04 OOTB, but always verify.

Add the commons-lang jar either into WEB-INF/lib or server/lib

include commons-lang-<version>.jar in your classpath

I faced the same issue in latest version of IntelliJ Community Edition (idea-IC-13.224.1 or version 14) along with apache-maven 3.2.3.

Adding missing jar (commons-lang-2.6.jar) in $IDEA_HOME/plugins/maven/lib/maven3 folder seems to fix it.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!