title: BasicDataSource not finding postgresql or postgis jdbc drivers
body: <p>I'm trying to add a BasicDataSource to a new LocalContainerEntityManagerFactoryBean.  When I create the new dataSource like so:</p>
  
  <pre><code>&lt;bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close"&gt;
      &lt;property name="driverClassName" value="org.postgresql.Driver" /&gt;
      &lt;property name="url" value="jdbc:postgresql://localhost:5432/database" /&gt;
      &lt;property name="username" value="XXXXX" /&gt;
      &lt;property name="password" value="XXXXX" /&gt;
  &lt;/bean&gt;
  </code></pre>
  
  <p>And add it to the entitiyManagerFactory</p>
  
  <pre><code>&lt;bean id="entityManagerFactory" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean"&gt;
      &lt;property name="dataSource" ref="dataSource"/&gt;
  &lt;/bean&gt;
  </code></pre>
  
  <p>The error I'm getting is that it's can't find the JDBC driver:</p>
  
  <pre><code>[org.hibernate.engine.jdbc.internal.JdbcServicesImpl.configure] HHH000342: Could not obtain connection to query metadata : Cannot load JDBC driver class 'org.postgresql.Driver'
  </code></pre>
  
  <p>I have the jar being loaded via maven: </p>
  
  <pre><code>&lt;dependency&gt;
      &lt;groupId&gt;org.postgresql&lt;/groupId&gt;
      &lt;artifactId&gt;postgresql&lt;/artifactId&gt;
      &lt;version&gt;9.3-1103-jdbc3&lt;/version&gt;
  &lt;/dependency&gt;
  </code></pre>
  
  <p>and mavens added to my classpath </p>
  
  <pre><code>&lt;classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER"&gt;
      &lt;attributes&gt;
          &lt;attribute name="maven.pomderived" value="true"/&gt;
          &lt;attribute name="org.eclipse.jst.component.dependency" value="/WEB-INF/lib"/&gt;
      &lt;/attributes&gt;
  &lt;/classpathentry&gt;
  </code></pre>
  
  <p>So I'm wondering what am I missing? I can see that the driver is available from the maven dependencies library, but it never finds it when starting up.  Any ideas would be much appreciated.</p>