commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Pierre8rou <pierre8r-nab...@yahoo.fr>
Subject [Commons Configuration] Why this Java code rise a Exception ?
Date Mon, 01 Sep 2008 20:50:18 GMT

Hello,

Why this Java code rise a Exception in thread "main"
java.lang.NoClassDefFoundError  ?

Thanks,

Pierre8r


package com.test.configuration;
 
import org.apache.commons.configuration.BaseConfiguration;
 
public class testCommonsConfig001 {
 
	public static void main(String[] args) {
 
		BaseConfiguration config = new BaseConfiguration();
 
		config.addProperty("intProperty", 22);
		System.out.println(config.getInt("intProperty"));
 
	}
}


The output console :

Exception in thread "main" java.lang.NoClassDefFoundError:
org/apache/commons/lang/exception/NestableRuntimeException
	at java.lang.ClassLoader.defineClass1(Native Method)
	at java.lang.ClassLoader.defineClass(Unknown Source)
	at java.security.SecureClassLoader.defineClass(Unknown Source)
	at java.net.URLClassLoader.defineClass(Unknown Source)
	at java.net.URLClassLoader.access$000(Unknown Source)
	at java.net.URLClassLoader$1.run(Unknown Source)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.net.URLClassLoader.findClass(Unknown Source)
	at java.lang.ClassLoader.loadClass(Unknown Source)
	at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
	at java.lang.ClassLoader.loadClass(Unknown Source)
	at java.lang.ClassLoader.loadClassInternal(Unknown Source)
	at java.lang.ClassLoader.defineClass1(Native Method)
	at java.lang.ClassLoader.defineClass(Unknown Source)
	at java.security.SecureClassLoader.defineClass(Unknown Source)
	at java.net.URLClassLoader.defineClass(Unknown Source)
	at java.net.URLClassLoader.access$000(Unknown Source)
	at java.net.URLClassLoader$1.run(Unknown Source)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.net.URLClassLoader.findClass(Unknown Source)
	at java.lang.ClassLoader.loadClass(Unknown Source)
	at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
	at java.lang.ClassLoader.loadClass(Unknown Source)
	at java.lang.ClassLoader.loadClassInternal(Unknown Source)
	at
com.test.configuration.testCommonsConfig001.main(testCommonsConfig001.java:9)
Caused by: java.lang.ClassNotFoundException:
org.apache.commons.lang.exception.NestableRuntimeException
	at java.net.URLClassLoader$1.run(Unknown Source)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.net.URLClassLoader.findClass(Unknown Source)
	at java.lang.ClassLoader.loadClass(Unknown Source)
	at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
	at java.lang.ClassLoader.loadClass(Unknown Source)
	at java.lang.ClassLoader.loadClassInternal(Unknown Source)
	... 25 more






-- 
View this message in context: http://www.nabble.com/-Commons-Configuration--Why-this-Java-code-rise-a-Exception---tp19260543p19260543.html
Sent from the Commons - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org


Mime
View raw message