It's all about the answers!

Ask a question

Maven Build in Rational - NoClassDefFoundError: org.codehaus.classworlds.Launcher


Tommy Ng (2123) | asked Feb 18 '13, 9:02 a.m.
edited Feb 20 '13, 8:28 a.m. by Spencer Murata (2.3k115971)

Dear Sir

When I use the Maven Build in Rational, I got below error

[Jazz build engine] Invoking build participant "com.ibm.team.build.maven"

Ecveption in thread "main" java.langNoClassDefFoundError: org.codehaus.classworlds.Launcher

Can anyone know it?

5 answers



permanent link
Ian Wark (79713450) | answered Feb 19 '13, 10:51 p.m.
Hi Tommy,

I also get the same error. Here is what I get:

2013-02-19 14:58:14 [Jazz build engine] running on host: XXXXXXX
2013-02-19 14:58:14 [Jazz build engine] Should build occur?
2013-02-19 14:58:14 [Jazz build engine] Yes: Always build a user initiated request.
2013-02-19 14:58:14 [Jazz build engine] Invoking build participant "com.ibm.team.build.maven"
Exception in thread "main" java.lang.NoClassDefFoundError : org.codehaus.classworlds.Launc her
Caused by: java.lang.ClassNotFoundExcepti on: org.codehaus.classworlds.Launc her
    at java.net.URLClassLoader.findCl ass(URLClassLoader.java:434)
    at java.lang.ClassLoader.loadClas s(ClassLoader.java:660)
    at sun.misc.Launcher$AppClassLoad er.loadClass(Launcher.java:358)
    at java.lang.ClassLoader.loadClas s(ClassLoader.java:626)
Could not find the main class: org.codehaus.classworlds.Launc her.  Program will exit.
Build failed. Exit value was 1.


It seems that the C:\Program Files\Apache Software Foundation\apache-maven-3.0.4\ boot\plexus-classworlds-2.4.ja r is not in classpath, but building from Maven and not Eclipse client works fine. We tried adding -cp "C:\Program Files\Apache Software Foundation\apache-maven-3.0.4\ boot\plexus-classworlds-2.4.ja r" to the Java VM arguments section in build definition, but this did not seem to resolve issue.

<Reproduce steps>
1. Download Windows Maven v3.0.4 from http://maven.apache.org and add environment variables carefully as per instructions.
2. Create the sample using steps under http://maven.apache.org/guides/getting-started/maven-in-five-minutes.html
3. Unzip the build feature RTC-BuildSystem-Toolkit-Win-4. 0.1.zip and copy jdk from RTC 4.0.1 Eclipse client as per instructions
4. Create a build definition for Maven in RTC project area and configure as per screen captures.
5. Click "Create" button in Overview section to create a build engine.
6. Run jbe -vm {path_to_jdk}/bin/java -repository {repositoryURL} -userId {user} -pass {password} -engineId {engine}
7. Copy the sample maven project to your configured build workspace.
8. Invoke a build from the Builds view.


Can someone help?

permanent link
Ian Wark (79713450) | answered Feb 19 '13, 10:56 p.m.
There is only one screen capture. Here it is.

Build definition



permanent link
Spencer Murata (2.3k115971) | answered Feb 20 '13, 8:34 a.m.
FORUM MODERATOR / JAZZ DEVELOPER
 It appears that this is a problem with mixing Maven 2 scripts with a Maven 3 engine.
http://cyntech.wordpress.com/2011/03/09/maven-2-error/

or a missing classworlds jar from the path:
http://www.permeance.com.au/web/terry.mueller/home/-/blogs/maven2-reports-java-lang-noclassdeffounderror:-org-codehaus-classworlds-launcher

Does the same Maven script run from the command line without problems?

~Spencer

permanent link
Ian Wark (79713450) | answered Feb 20 '13, 10:06 p.m.

OK. I succeeded in the build. The key was to remove the \bin from the end of the Maven home: variable in the build definition settings.

"C:\Program Files\Apache Software Foundation\apache-maven-3.0.4".

I also changed my Project location: to include \my-app a the end.. which makes

"C:\Users\ibmrat\workspace\my-app"

I am using the amy-app pplication generated from http://maven.apache.org/guides/getting-started/maven-in-five-minutes.html which is a good sample application. I advise to use this application to test.


permanent link
Joseph Mao (440189) | answered Feb 20 '13, 11:37 p.m.
JAZZ DEVELOPER
In Maven build definition,
- "Maven home" need to set to [Maven_installed_folder], rather than [Maven_installed_folder]\bin, to allow maven library can be found
- "Project Location" need to be set to project path level, allow Maven to find pom.xml, rahter than workspace level.

Your answer


Register or to post your answer.