title: Hibernate: javax.persistence.* driver properties cause UnsupportedOperationException: The user must supply a JDBC connection?
body: <p>I'm using</p>
  
  <pre><code>&lt;property name="javax.persistence.jdbc.driver"   value="com.mysql.jdbc.Driver" /&gt;
  &lt;property name="javax.persistence.jdbc.url"      value="jdbc:mysql://localhost/whatever" /&gt;
  &lt;property name="javax.persistence.jdbc.user"     value="" /&gt;
  &lt;property name="javax.persistence.jdbc.password" value="" /&gt;
  </code></pre>
  
  <p>in all of my JavaSE test apps with Hibernate without problems. However, when using the same in a webapp (Tomcat) an exception is thrown:</p>
  
  <pre><code>java.lang.UnsupportedOperationException: The user must supply a JDBC connection
      org.hibernate.connection.UserSuppliedConnectionProvider.getConnection(UserSuppliedConnectionProvider.java:54)
      org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:446)
      org.hibernate.jdbc.ConnectionManager.getConnection(ConnectionManager.java:167)
      org.hibernate.jdbc.AbstractBatcher.prepareQueryStatement(AbstractBatcher.java:161)
      org.hibernate.loader.Loader.prepareQueryStatement(Loader.java:1596)
      org.hibernate.loader.Loader.doQuery(Loader.java:717)
      org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:270)
      org.hibernate.loader.Loader.loadEntity(Loader.java:1933)
      org.hibernate.loader.entity.AbstractEntityLoader.load(AbstractEntityLoader.java:86)
      org.hibernate.loader.entity.AbstractEntityLoader.load(AbstractEntityLoader.java:76)
      org.hibernate.persister.entity.AbstractEntityPersister.load(AbstractEntityPersister.java:3270)
      org.hibernate.event.def.DefaultLoadEventListener.loadFromDatasource(DefaultLoadEventListener.java:496)
      org.hibernate.event.def.DefaultLoadEventListener.doLoad(DefaultLoadEventListener.java:477)
      org.hibernate.event.def.DefaultLoadEventListener.load(DefaultLoadEventListener.java:227)
      org.hibernate.event.def.DefaultLoadEventListener.proxyOrLoad(DefaultLoadEventListener.java:285)
      org.hibernate.event.def.DefaultLoadEventListener.onLoad(DefaultLoadEventListener.java:152)
      org.hibernate.impl.SessionImpl.fireLoad(SessionImpl.java:1080)
      org.hibernate.impl.SessionImpl.get(SessionImpl.java:997)
      org.hibernate.impl.SessionImpl.get(SessionImpl.java:990)
      org.hibernate.ejb.AbstractEntityManagerImpl.find(AbstractEntityManagerImpl.java:182)
      com.kawoolutions.bbstats.servlet.BasketballStatsServlet.doGet(BasketballStatsServlet.java:405)
      javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
      javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
  </code></pre>
  
  <p>I couldn't find anything useful on the net, so I grabbed a backup and noticed the only change I made was that I previously used:</p>
  
  <pre><code>&lt;property name="hibernate.connection.driver_class" value="com.mysql.jdbc.Driver" /&gt;
  &lt;property name="hibernate.connection.url"          value="jdbc:mysql://localhost/whatever" /&gt;
  &lt;property name="hibernate.connection.username"     value="" /&gt;
  &lt;property name="hibernate.connection.password"     value="" /&gt;
  </code></pre>
  
  <p>After reverting to the hibernate.* properties the exception went away!</p>
  
  <p>What's wrong here? Why do the javax.persistence.* properties work in a JavaSE environment but not in my webapp? It's really strange...</p>