title: NoClassDefFoundError: com.sforce.soap.enterprise.Connector
body: <p>I am trying to query contacts from salesForce account but getting above error.</p>
  
  <p>I generated <code>enterprise.jar</code> file from the WSDL downloaded from my account.</p>
  
  <p>I have <code>wsc-23-min.jar</code> along with <code>enterprise.jar</code> files in <code>libs</code> folder.</p>
  
  <p>Below method is used to query contacts</p>
  
  <pre><code>private void queryContacts() {
      Log.i(TAG, "Querying for the 5 newest Contacts...");
  
      ConnectorConfig config = new ConnectorConfig();
      config.setUsername("***@***.com");
      config.setPassword("***");
  
      try {
  
          connection = Connector.newConnection(config);
          // query for the 5 newest contacts      
          com.sforce.soap.enterprise.QueryResult queryResults = connection.query("SELECT Id, FirstName, LastName, Account.Name " +
                  "FROM Contact WHERE AccountId != NULL ORDER BY CreatedDate DESC LIMIT 5");
  
          if (queryResults.getSize() &gt; 0) {
              for (int i=0;i&lt;queryResults.getRecords().length;i++) {
                  // cast the SObject to a strongly-typed Contact
                  Contact c = (Contact)queryResults.getRecords()[i];
                  Log.i(TAG, " ------------- Id: " + c.getId() + " - Name: "+c.getFirstName()+" "+
                          c.getLastName()+" - Account: "+c.getAccount().getName());
              }
          }
  
      } catch (Exception e) {
          e.printStackTrace();
      }
  }
  </code></pre>
  
  <p>Any help or clue is appreciated.
  Thanks.</p>
  
  <p><strong>Edit:</strong></p>
  
  <p>I tried all the methods from <a href="https://stackoverflow.com/questions/2247998/noclassdeffounderror-eclipse-and-android">this</a> popular question but no luck.</p>
  
  <p>I have other projects in my workspace which are having jar files (in 'libs' folder) and they all work properly. Don’t know whats wrong with salesforce related jar files.</p>
  
  <p><strong>Edit:</strong></p>
  
  <p>There is no problem with <code>wsc-23.jar</code> file. Classes placed in this jar, for ex. <code>Connector</code> and others loading and they are working fine.</p>
  
  <p>Only problem is with generated <code>enterprise.jar</code> through WSDL file.</p>
  
  <p>Followed <a href="http://www.salesforce.com/us/developer/docs/api/Content/sforce_api_quickstart_steps.htm" rel="nofollow noreferrer">this</a> to generate enterprise.jar file</p>
  
  <p>Not getting what's wrong with it.</p>