title: Apache Drill Deployment on Pivotal Cloud Flow
body: <p>I have created one spring-boot maven project using Apache Drill and I am able to successfully query the data from the file. When I tried to deploy the project on PCF, every time my instance crashed stating multiple <code>slf4j</code> bindings.</p>
  
  <pre><code>@SpringBootApplication
  public class Drill {
      static final String JDBC_DRIVER = "org.apache.drill.jdbc.Driver";
      public static final String DRILL_JDBC_LOCAL_URI = "jdbc:drill:drillbit=xx.xx.xxx.xx;
  
      public static void main(String[] args) throws IOException {
          SpringApplication.run(Drill.class, args);
          boolean result = false;
          try {
              result = sqlResult();
          } catch (FileNotFoundException e) {
              //TODO Auto-generated catch block
              e.printStackTrace();
          }
          System.out.println(result);
      }
  
      public static boolean sqlResult() throws IOException {
          try {
              Class.forName(JDBC_DRIVER);
          } catch (ClassNotFoundException ce) {
              ce.printStackTrace();
          }
          long d = 1;
          try {
              Connection conn = DriverManager.getConnection(DRILL_JDBC_LOCAL_URI, "usrname","passwrd");
              Statement stmt = conn.createStatement();
              String sql = "select * from dfs.`/Users/system.user/Desktop/123.csv`";
              ResultSet rs = stmt.executeQuery(sql);
              long currentTimeMillis = System.currentTimeMillis();
              while (rs.next()) {     
                  System.out.println("columns: "+rs.getString(1));
                  d++;
              }
              long currentTimeMillisEnd = System.currentTimeMillis();
              System.out.println(" start: "+currentTimeMillis+" end "+currentTimeMillisEnd +" size: "+d);
          rs.close();
          } catch (Exception se) {
              System.out.println("last count is: "+d);
              se.printStackTrace();
          }
  
          return false;
      }
  }
  
  pom.xml:&lt;parent&gt;
      &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
      &lt;artifactId&gt;spring-boot-starter-parent&lt;/artifactId&gt;
      &lt;version&gt;1.5.6.RELEASE&lt;/version&gt;
      &lt;relativePath /&gt; &lt;!-- lookup parent from repository --&gt;
  &lt;/parent&gt;
  
  &lt;properties&gt;
      &lt;project.build.sourceEncoding&gt;UTF-8&lt;/project.build.sourceEncoding&gt;
      &lt;project.reporting.outputEncoding&gt;UTF-8&lt;/project.reporting.outputEncoding&gt;
      &lt;org.slf4j-version&gt;1.7.5&lt;/org.slf4j-version&gt;
      &lt;java.version&gt;1.8&lt;/java.version&gt;
  &lt;/properties&gt;
  
  &lt;dependencies&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
          &lt;artifactId&gt;spring-boot-starter&lt;/artifactId&gt;
          &lt;exclusions&gt;
              &lt;exclusion&gt;
                  &lt;groupId&gt;org.slf4j&lt;/groupId&gt;
                  &lt;artifactId&gt;slf4j-api&lt;/artifactId&gt;
              &lt;/exclusion&gt;
              &lt;exclusion&gt;
                  &lt;artifactId&gt;jcl-over-slf4j&lt;/artifactId&gt;
                  &lt;groupId&gt;org.slf4j&lt;/groupId&gt;
              &lt;/exclusion&gt;
              &lt;exclusion&gt;
                  &lt;artifactId&gt;jul-to-slf4j&lt;/artifactId&gt;
                  &lt;groupId&gt;org.slf4j&lt;/groupId&gt;
              &lt;/exclusion&gt;
          &lt;/exclusions&gt;
      &lt;/dependency&gt;
      &lt;!-- https://mvnrepository.com/artifact/com.fasterxml.jackson.core/jackson-core --&gt;
  
      &lt;dependency&gt;
          &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
          &lt;artifactId&gt;spring-boot-starter-test&lt;/artifactId&gt;
          &lt;scope&gt;test&lt;/scope&gt;         
      &lt;/dependency&gt;
       &lt;dependency&gt;
          &lt;groupId&gt;org.apache.drill.exec&lt;/groupId&gt;
          &lt;artifactId&gt;drill-jdbc-all&lt;/artifactId&gt;
          &lt;version&gt;1.1.0&lt;/version&gt;
          &lt;exclusions&gt;
              &lt;exclusion&gt;
                  &lt;groupId&gt;org.slf4j&lt;/groupId&gt;
                  &lt;artifactId&gt;slf4j-api&lt;/artifactId&gt;
              &lt;/exclusion&gt;
              &lt;exclusion&gt;
                  &lt;artifactId&gt;jcl-over-slf4j&lt;/artifactId&gt;
                  &lt;groupId&gt;org.slf4j&lt;/groupId&gt;
              &lt;/exclusion&gt;
              &lt;exclusion&gt;
                  &lt;artifactId&gt;jul-to-slf4j&lt;/artifactId&gt;
                  &lt;groupId&gt;org.slf4j&lt;/groupId&gt;
              &lt;/exclusion&gt;
          &lt;/exclusions&gt;
      &lt;/dependency&gt;   
      &lt;dependency&gt;
          &lt;groupId&gt;org.apache.hadoop&lt;/groupId&gt;
          &lt;artifactId&gt;hadoop-core&lt;/artifactId&gt;
          &lt;version&gt;0.20.2&lt;/version&gt;
      &lt;/dependency&gt;
  &lt;/dependencies&gt;
  
  &lt;build&gt;
      &lt;plugins&gt;
          &lt;plugin&gt;
              &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
              &lt;artifactId&gt;spring-boot-maven-plugin&lt;/artifactId&gt;
          &lt;/plugin&gt;
      &lt;/plugins&gt;
  &lt;/build&gt;
  </code></pre>
  
  <p>This is the error message I get:</p>
  
  <blockquote>
    <p>[ERR] SLF4J: Class path contains multiple SLF4J bindings.<br>
    [ERR] SLF4J: Found binding in [jar:file:/home/vcap/app/BOOT-INF/lib/drill-jdbc-all-1.1.0.jar!/org/slf4j/impl/StaticLoggerBinder.class]<br>
    [ERR] SLF4J: See <a href="http://www.slf4j.org/codes.html#multiple_bindings" rel="nofollow noreferrer">http://www.slf4j.org/codes.html#multiple_bindings</a> for an explanation.<br>
    [ERR] SLF4J: Found binding in [jar:file:/home/vcap/app/BOOT-INF/lib/logback-classic-1.1.11.jar!/org/slf4j/impl/StaticLoggerBinder.class]<br>
    [ERR] SLF4J: Actual binding is of type [ch.qos.logback.classic.util.ContextSelectorStaticBinder]<br>
    [ERR] Exception in thread "main" java.lang.reflect.InvocationTargetException<br>
    [ERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)<br>
    [ERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)<br>
    [ERR] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)<br>
    [ERR] at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:48)<br>
    [ERR] at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:51)<br>
    [ERR] at org.springframework.boot.loader.Launcher.launch(Launcher.java:87)<br>
    [ERR] Caused by: java.lang.NoSuchMethodError: com.fasterxml.jackson.databind.ObjectMapper.readValue(Ljava/lang/String;Lcom/fasterxml/jackson/core/type/TypeReference;)Ljava/lang/Object;<br>
    [ERR] at org.springframework.boot.SpringApplication.run(SpringApplication.java:296)<br>
    [ERR] at org.springframework.boot.SpringApplication.run(SpringApplication.java:1107)<br>
    [ERR] at pack.drill.Drill.main(Drill.java:26)</p>
  </blockquote>
  
  <p>I tried all the possible help available on net but I am not able to figure out the issue. I am not understanding why it is working perfectly fine in a local environment and why it is not even deploying on PCF.</p>