Ask is moving to Stack Overflow and! Please use the "opendaylight" tag on either of these sites. This site is now in Read-Only mode


ODL controller build error: java.lang.ClassNotFoundException: org.apache.commons.lang.StringUtils

asked 2015-05-20 03:30:34 -0700

eya.get gravatar image

Dear all,

I wanted to contribute on the development of the odl controller and I have cloned only the controller repo using ssh. But I couldn't manage to handle the error while building it with maven on Ubuntu 14.04 CLI. May Java version is 1.7.0_79 and maven version 3.3.3. Build fails on odl-model-project. Please have a look on the full error trace bellow:

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-archetype-plugin:2.2:jar (default-jar) on project odl-model-project: Execution default-jar of goal org.apache.maven.plugins:maven-archetype-plugin:2.2:jar failed: A required class was missing while executing org.apache.maven.plugins:maven-archetype-plugin:2.2:jar: org/apache/commons/lang/StringUtils

With -X debugging, the trace is as follows:

at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo( ... 21 more Caused by: java.lang.NoClassDefFoundError: org/apache/commons/lang/StringUtils at org.apache.velocity.runtime.resource.ResourceManagerImpl.initialize( at org.apache.velocity.runtime.RuntimeInstance.initializeResourceManager( at org.apache.velocity.runtime.RuntimeInstance.init( at at org.codehaus.plexus.velocity.DefaultVelocityComponent.initialize( at org.eclipse.sisu.plexus.PlexusLifecycleManager.initialize( at org.eclipse.sisu.plexus.PlexusLifecycleManager.activate( at org.eclipse.sisu.bean.BeanScheduler$Pending.activate( at org.eclipse.sisu.bean.BeanScheduler$Activator.onProvision( at$Provision.provision( at at at at$2$ at at$2.get( at$1.get( at org.eclipse.sisu.inject.LazyBeanEntry.getValue( at org.eclipse.sisu.plexus.LazyPlexusBean.getValue( at org.codehaus.plexus.DefaultPlexusContainer.lookup( at org.codehaus.plexus.DefaultPlexusContainer.lookup( at org.apache.maven.plugin.internal.DefaultMavenPluginManager.getConfiguredMojo( at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo( ... 21 more Caused by: java.lang.ClassNotFoundException: org.apache.commons.lang.StringUtils at org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy.loadClass( at org.codehaus.plexus.classworlds.realm.ClassRealm.unsynchronizedLoadClass( at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass( at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass( ... 44 more

Could you please point me out how to solve this error/bug? Please let me know if there is a workaround on this error.

Thank you,

edit retag flag offensive close merge delete


I have the same problem. I followed all the instructions on the wiki for setting up the development environment on Ubuntu 14.04, but somehow there is a problem with maven/java. In fact, when I just run "mvn archetype:generate" I get the java.lang.NoClassDefFound exception.

Chris Lauwers ( 2015-05-20 14:21:14 -0700 )edit

I figured out that the problem is related to maven-archetype-plugin. It is defined on pom.xml but it is not getting downloaded while building the project. I don't know why.

eya.get ( 2015-05-20 14:27:49 -0700 )edit

Hi, I am facing a similar problem. Can you share if you moved ahead with this error. I found a link to a probable solution->

sidhant13 ( 2015-05-21 00:15:29 -0700 )edit

Thanks sidhant13 for your input. Adding the following dependency in file ~/.m2/repository/org/apache/maven/plugins/maven-archetype-plugin/2.2/maven-archetype-plugin-2.2.pom solves the problem for me. <dependency> <groupid>commons-lang</groupid> <artifactid>commons-lang</artifactid> <version>2.3</version> </dependency> It might not be a permanent solution though.

eya.get ( 2015-05-21 11:01:39 -0700 )edit

4 answers

Sort by ยป oldest newest most voted

answered 2015-05-20 03:54:56 -0700

Check this wiki: . This may help you.

edit flag offensive delete publish link more


Hi Subhash, thank you for the reply. I followed all the steps, but it doesn't work. There is no problem with the integration project. The problem is on the controller project. I have been trying to build only the controller repo, i.e., git clone JDK and Maven are correctly installed. But build fails at odl-model-project

eya.get ( 2015-05-20 04:12:39 -0700 )edit

answered 2015-05-21 10:11:09 -0700

eya.get gravatar image

updated 2015-05-23 21:59:16 -0700

Adding the following dependency in file ~/.m2/repository/org/apache/maven/plugins/maven-archetype-plugin/2.2/maven-archetype-plugin-2.2.pom solves the problem for me.

<dependency> <groupid>commons-lang</groupid> <artifactid>commons-lang</artifactid> <version>2.3</version>

It might not be a permanent solution though.

edit flag offensive delete publish link more


Thanks. It worked but guess the comment here is formatted such that inline Uppercase characters are converted to lowercase, and in pasting the above dependency to pom file gives a null dependency error. So i in groupid and artifactid have to be in uppercase.

sidhant13 ( 2015-05-22 05:34:46 -0700 )edit

you are right, but I don't know why this editor converts all inline Uppercase characters to lower case.

eya.get ( 2015-05-23 21:57:44 -0700 )edit

It worked fine also for me! Thanks

mattedallo ( 2015-06-03 06:18:39 -0700 )edit

answered 2015-05-21 15:10:12 -0700

I had a similar problem trying to run the MD-SAL example described in

I got the StringUtils exception when running the "mvn archetype:generate" command shown in the example. I finally got this to work as follows:

  1. delete the entire ~/.m2/repository
  2. delete ~/.m2/settings.xml
  3. run the mvn archetype:generate command (with the arguments listed on the wiki). This now succeeds without problems
  4. create ~/.m2/settings.xml based on the instructions from the "setting up your dev environment" section on the wiki
  5. run "mvn clean install"

From this, I surmise that there might be a discrepancy between the repos in and

edit flag offensive delete publish link more


This worked fine for me as well. Thanks.

pbraun ( 2015-06-05 05:12:00 -0700 )edit

answered 2015-05-22 17:06:15 -0700

Bruno Lopes gravatar image

You can try the solution of this post . This worked with me.

edit flag offensive delete publish link more
Login/Signup to Answer

Question Tools



Asked: 2015-05-20 03:30:34 -0700

Seen: 1,944 times

Last updated: May 23 '15