jQuery in Action, 2nd edition*
The moose likes Java in General and the fly likes EasyConf NestableRuntimeException Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "EasyConf NestableRuntimeException" Watch "EasyConf NestableRuntimeException" New topic
Author

EasyConf NestableRuntimeException

Ravi kapa
Ranch Hand

Joined: Jan 05, 2012
Posts: 87
Hi All,iam using "EasyConf" for properties configuration i just tried to read and print the variable from the properties file and getting one runtime exception that is "NestableRunTimeException".Can anyone guide me what is wrong..i included all the necessary jars
those jars are
commons-configuration 1.1
commons-collections 3.1
commons-lang 2.0
dom4j 1.4
commons-logging 1.0.4
commons-digester 1.6
commons-beanutils (core and collections) 1.7.0...

i created calculator.properties file under src with the variable euro-to-dollars=1.2

my source code
===============
import com.germinus.easyconf.ComponentConfiguration;
import com.germinus.easyconf.ComponentProperties;
import com.germinus.easyconf.EasyConf;

public class EasyCDemoEx{
public static void main(String[] args) {
System.out.println("1");
final double EURO_TO_DOLLARS_RATIO = EasyConf.
getConfiguration("calculator").getProperties().
getDouble("euro-to-dollars");
System.out.println(EURO_TO_DOLLARS_RATIO);

}
}

output(Exception)
===============

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(ClassLoader.java:791)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:449)
at java.net.URLClassLoader.access$100(URLClassLoader.java:71)
at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:423)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
at com.easy.demo.EasyConfDemo.main(EasyConfDemo.java:8)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:120)
Caused by: java.lang.ClassNotFoundException: org.apache.commons.lang.exception.NestableRuntimeException
at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:423)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
... 18 more
Steve Luke
Bartender

Joined: Jan 28, 2003
Posts: 4181
    
  21

Looks like you didn't set your classpath correctly. You say you have the commons-lang JAR - that is where the NestableRuntimeException is located. So you may have downloaded it but it seams like you did not add it to the classpath correctly.

Also, make sure you have the correct version of commons-lang on the classpath. The latest version (3.x) uses the org.apache.commons.lang3 package instead of org.apache.commons.lang, and does not have a NestableRuntimeException. You need to use a 2.x version of the commons-lang JAR.


Steve
 
Don't get me started about those stupid light bulbs.
 
subject: EasyConf NestableRuntimeException