title: Issue reading XMLConfiguration files using apache configuration2
body: <p>I was trying to use <a href="https://commons.apache.org/proper/commons-configuration/userguide/howto_xml.html" rel="nofollow">apache commons configuration</a> and running into an issue where it throws a NoClassDefFoundError. It happens on <a href="https://commons.apache.org/proper/commons-configuration/apidocs/org/apache/commons/configuration2/builder/fluent/Parameters.html#xml--" rel="nofollow">Parameters.xml()</a> call. Below is the full code and the exception details that my IntelliJ generated. I am using jdk1.8.0_91. I appreciate any help in solving this.</p>
  
  <pre><code>import org.apache.commons.configuration2.*;
  import org.apache.commons.configuration2.ex.*;
  import org.apache.commons.configuration2.builder.*;
  import org.apache.commons.configuration2.builder.fluent.*;
  
  public class TestDBA {
  
      public static void main(String[] args)
      {
          try {
              Parameters params = new Parameters();
              FileBasedConfigurationBuilder&lt;XMLConfiguration&gt; builder = new FileBasedConfigurationBuilder&lt;XMLConfiguration&gt;(XMLConfiguration.class);
              XMLBuilderParameters px = params.xml();
              builder.configure(px.setFileName("myconfig.xml"));
              XMLConfiguration config = builder.getConfiguration();
              System.out.println(config.toString());
          } catch (ConfigurationException cex) {
              // loading of the configuration file failed
              System.out.println("some error occurred");
          }
      }
  }
  </code></pre>
  
  <p>Exception details:</p>
  
  <blockquote>
    <p>Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/commons/beanutils/DynaBean
        at java.lang.Class.forName0(Native Method)
        at java.lang.Class.forName(Class.java:264)
        at com.sun.proxy.$Proxy0.(Unknown Source)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
        at java.lang.reflect.Proxy.newProxyInstance(Proxy.java:739)
        at org.apache.commons.configuration2.builder.fluent.Parameters.createParametersProxy(Parameters.java:294)
        at org.apache.commons.configuration2.builder.fluent.Parameters.xml(Parameters.java:232)
        at TestDBA.main(TestDBA.java:16)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at com.intellij.rt.execution.application.AppMain.main(AppMain.java:144)
    Caused by: java.lang.ClassNotFoundException: org.apache.commons.beanutils.DynaBean
        at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
        ... 16 more</p>
  </blockquote>
  
  <p>Process finished with exit code 1</p>