title: Exception in thread "main" java.lang.NoSuchMethodError: org.apache.commons.beanutils.PropertyUtilsBean
body: <p>I'm trying to read properties file and got stuck with error which is given below.I have written an Scala package where i'm trying to read properties file and call into abc.scala program.Any help will be appreciated.   </p>
  
  <p>File:- xyz.properties</p>
  
  <pre><code>driver = "oracle.jdbc.driver.OracleDriver"
  url = "jdbc:oracle:thin:@xxxx:1521/xxxx.xxxx"
  username = "xxx"
  password = "xxx"
  input_file = "C:\\Users\\xxx\\test\\src\\main\\resources\\xxxx.xlsx"
  </code></pre>
  
  <p>build.sbt </p>
  
  <pre><code>name := "xxx.xxxx.xxxxx"
  
  scalaVersion := "2.10.6"
  
  ivyScala := ivyScala.value map{ _.copy(overrideScalaVersion = true) }
  
  
  libraryDependencies ++= Seq(
  "org.apache.spark" %% "spark-core" % "2.1.0",
  "com.databricks" %% "spark-csv" % "1.5.0",
  "org.apache.commons" % "commons-configuration2" % "2.1.1",
  "commons-beanutils" % "commons-beanutils" % "1.9.3",
  "org.apache.spark" %% "spark-sql" % "2.1.0",
  "org.scala-lang" % "scala-xml" % "2.11.0-M4"  )
  </code></pre>
  
  <p>Package</p>
  
  <pre><code>package com.xxx.zzzz.xxx1
  
          import java.io.File
          import org.apache.commons.configuration2.builder.fluent.{Configurations, Parameters}
  
  
          object Configuration {
  
            var config = new Configurations()
            var configs = config.properties(new File("xyz.properties"))
  
            var inputFile = configs.getString("input")
            var userName = configs.getString("user_name")
            var password = configs.getString("passwd")
            var driver = configs.getString("driver")
            var url = configs.getString("Url")
  
          }
  </code></pre>
  
  <p>Main Program abc.scala</p>
  
  <pre><code>import org.apache.spark.{SparkConf, SparkContext}
  import org.apache.spark.sql.SQLContext
  import package com.xxx.zzzz.xxx1.Configurations
  import org.apache.commons.beanutils.PropertyUtils
  
  
  object ItalyPanelData {
    def main(args: Array[String]): Unit = {
  
          //Logger.getRootLogger().setLevel(Level.OFF)
  
          println("Inside main program"+ Configuration.driver)
          //Set the properties for spark to connect the oracle database
          val dbProp = new java.util.Properties
          dbProp.setProperty("driver", Configuration.driver)
          dbProp.setProperty("user", Configuration.userName)
          dbProp.setProperty("password", Configuration.password)
  
  
          //Create a connection to connect spark
          val conf = new SparkConf().setAppName("Simple Application").setMaster("local")
          val sc = new SparkContext(conf)
          val sqlContext = new SQLContext(sc)
  
      //exception handlying
      try {
        //Create dataframe boject
        val df = sqlContext.read
          .option("location", Configuration.inputFile)        //Initiating input path
          .option("sheetName", "xyz")                       //Give the SheetName
          .option("useHeader", "true")                        //It takes the header name from excel sheet
          .option("treatEmptyValuesAsNulls", "true")
          .option("inferSchema", "true")
          .option("addColorColumns", "false")
          .load()
        // Write into oracale database
        df.write.mode("append").jdbc(Configuration.url, "xyz", dbProp)
      }
      catch {
  
          case e: Throwable =&gt; e.printStackTrace();
      }
  
        }
  }
  </code></pre>
  
  <p>Error</p>
  
  <pre><code>Exception in thread "main" java.lang.NoSuchMethodError: org.apache.commons.beanutils.PropertyUtilsBean.addBeanIntrospector(Lorg/apache/commons/beanutils/BeanIntrospector;)V
  at org.apache.commons.configuration2.beanutils.BeanHelper.initBeanUtilsBean(BeanHelper.java:631)
  at org.apache.commons.configuration2.beanutils.BeanHelper.&lt;clinit&gt;(BeanHelper.java:89)
  at java.lang.Class.forName0(Native Method)
  at java.lang.Class.forName(Class.java:264)
  at com.sun.proxy.$Proxy0.&lt;clinit&gt;(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.fileBased(Parameters.java:185)
  at org.apache.commons.configuration2.builder.fluent.Configurations.fileParams(Configurations.java:602)
  at org.apache.commons.configuration2.builder.fluent.Configurations.fileParams(Configurations.java:614)
  at org.apache.commons.configuration2.builder.fluent.Configurations.fileBasedBuilder(Configurations.java:132)
  at org.apache.commons.configuration2.builder.fluent.Configurations.propertiesBuilder(Configurations.java:238)
  at org.apache.commons.configuration2.builder.fluent.Configurations.properties(Configurations.java:282)
  at com.rxcorp.italy.config.Configuration$.&lt;init&gt;(Configuration.scala:8)
  at com.rxcorp.italy.config.Configuration$.&lt;clinit&gt;(Configuration.scala)
  at com.rxcorp.paneldataloading.ItalyPanelData$.main(abc.scala:12)
  </code></pre>