title: Deployment works, JPA works, JawsDB works but they don't all work together
body: <p>I have an app deployed to heroku with a Jaws MariaDB resource.</p>
  <p>I can connect to my local mariadb instance just fine with my localhost:8080 with my Persistence.xml configuration. I can also connect to the remote JawsDB on my local tomcat server. I can also run my application on heroku when it's not accessing the persistence layer. However, for some reason, a Persistence provider is not created.</p>
  <p>I'm using Maven for my dependency management. All the pieces work separately. They just don't come together. What am I missing?</p>
  <p>Here is my Pom, my persistence.xml, my error logs and a screenshot, and if you know of any tools or techniques to get more information, let me know. I have access to the heroku bash console.</p>
  <p>POM</p>
  <pre class="lang-xml prettyprint-override"><code>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
  &lt;project xmlns=&quot;http://maven.apache.org/POM/4.0.0&quot;
      xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot;
      xsi:schemaLocation=&quot;http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd&quot;&gt;
      &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
  
      &lt;groupId&gt;com.gerald.ryan&lt;/groupId&gt;
      &lt;artifactId&gt;blocks&lt;/artifactId&gt;
      &lt;version&gt;0.0.1-SNAPSHOT&lt;/version&gt;
      &lt;packaging&gt;war&lt;/packaging&gt;
  
      &lt;name&gt;blocks&lt;/name&gt;
      &lt;url&gt;http://maven.apache.org&lt;/url&gt;
  
      &lt;properties&gt;
          &lt;java.version&gt;1.8&lt;/java.version&gt;
          &lt;spring.version&gt;5.3.5&lt;/spring.version&gt;
          &lt;hibernate.version&gt;5.4.1.Final&lt;/hibernate.version&gt;
          &lt;cglib.version&gt;2.2.2&lt;/cglib.version&gt;
      &lt;/properties&gt;
  
      &lt;dependencies&gt;
  
  
          &lt;!-- Part of the Spring MVC Maven archetype --&gt;
  
          &lt;!-- Spring core &amp; mvc --&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework&lt;/groupId&gt;
              &lt;artifactId&gt;spring-context&lt;/artifactId&gt;
              &lt;version&gt;${spring.version}&lt;/version&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework&lt;/groupId&gt;
              &lt;artifactId&gt;spring-webmvc&lt;/artifactId&gt;
              &lt;version&gt;${spring.version}&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework&lt;/groupId&gt;
              &lt;artifactId&gt;spring-orm&lt;/artifactId&gt;
              &lt;version&gt;${spring.version}&lt;/version&gt;
              &lt;type&gt;jar&lt;/type&gt;
              &lt;scope&gt;compile&lt;/scope&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework&lt;/groupId&gt;
              &lt;artifactId&gt;spring-test&lt;/artifactId&gt;
              &lt;version&gt;${spring.version}&lt;/version&gt;
              &lt;type&gt;jar&lt;/type&gt;
              &lt;scope&gt;test&lt;/scope&gt;
          &lt;/dependency&gt;
  
          &lt;!-- CGLib for @Configuration --&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;cglib&lt;/groupId&gt;
              &lt;artifactId&gt;cglib-nodep&lt;/artifactId&gt;
              &lt;version&gt;${cglib.version}&lt;/version&gt;
              &lt;scope&gt;runtime&lt;/scope&gt;
          &lt;/dependency&gt;
  
  
          &lt;!-- Maven says this below was moved to one below it--&gt;
          &lt;!-- &lt;dependency&gt;
              &lt;groupId&gt;javax.servlet&lt;/groupId&gt;
              &lt;artifactId&gt;servlet-api&lt;/artifactId&gt;
              &lt;version&gt;2.4&lt;/version&gt;
              &lt;scope&gt;provided&lt;/scope&gt;
          &lt;/dependency&gt; --&gt;
  
          &lt;!-- https://mvnrepository.com/artifact/javax.servlet/javax.servlet-api --&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;javax.servlet&lt;/groupId&gt;
              &lt;artifactId&gt;javax.servlet-api&lt;/artifactId&gt;
              &lt;version&gt;4.0.1&lt;/version&gt;
              &lt;scope&gt;provided&lt;/scope&gt;
          &lt;/dependency&gt;
  
  
  
          &lt;dependency&gt;
              &lt;groupId&gt;javax.servlet.jsp&lt;/groupId&gt;
              &lt;artifactId&gt;jsp-api&lt;/artifactId&gt;
              &lt;version&gt;2.1&lt;/version&gt;
              &lt;scope&gt;provided&lt;/scope&gt;
          &lt;/dependency&gt;
  
          &lt;!-- END of the Spring MVC Maven archetype --&gt;
  
  
  
  
  
  
          &lt;!-- pubnub --&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;com.pubnub&lt;/groupId&gt;
              &lt;artifactId&gt;pubnub-gson&lt;/artifactId&gt;
              &lt;version&gt;4.35.0&lt;/version&gt;
          &lt;/dependency&gt;
  
  
          &lt;!-- https://mvnrepository.com/artifact/org.jetbrains/annotations --&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.jetbrains&lt;/groupId&gt;
              &lt;artifactId&gt;annotations&lt;/artifactId&gt;
              &lt;version&gt;13.0&lt;/version&gt;
          &lt;/dependency&gt;
  
  
  
          &lt;!-- Database Connectivity --&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;mysql&lt;/groupId&gt;
              &lt;artifactId&gt;mysql-connector-java&lt;/artifactId&gt;
              &lt;version&gt;8.0.23&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.eclipse.persistence&lt;/groupId&gt;
              &lt;artifactId&gt;eclipselink&lt;/artifactId&gt;
              &lt;version&gt;3.0.0&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.hibernate&lt;/groupId&gt;
              &lt;artifactId&gt;hibernate-core&lt;/artifactId&gt;
              &lt;version&gt;${hibernate.version}&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.hibernate.validator&lt;/groupId&gt;
              &lt;artifactId&gt;hibernate-validator&lt;/artifactId&gt;
              &lt;version&gt;6.2.0.Final&lt;/version&gt;
          &lt;/dependency&gt;
  
  
  
  
  
          &lt;!-- https://mvnrepository.com/artifact/org.apache.httpcomponents/httpclient --&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.apache.httpcomponents&lt;/groupId&gt;
              &lt;artifactId&gt;httpclient&lt;/artifactId&gt;
              &lt;version&gt;4.5.13&lt;/version&gt;
          &lt;/dependency&gt;
  
  
  
  
  
  
          &lt;!-- https://mvnrepository.com/artifact/junit/junit --&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;junit&lt;/groupId&gt;
              &lt;artifactId&gt;junit&lt;/artifactId&gt;
              &lt;version&gt;4.13.2&lt;/version&gt;
              &lt;scope&gt;test&lt;/scope&gt;
          &lt;/dependency&gt;
  
  
  
  
          &lt;!-- GSON For serialization --&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;com.google.code.gson&lt;/groupId&gt;
              &lt;artifactId&gt;gson&lt;/artifactId&gt;
              &lt;version&gt;2.8.6&lt;/version&gt;
          &lt;/dependency&gt;
  
  
          &lt;!-- use in jsp --&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;jstl&lt;/groupId&gt;
              &lt;artifactId&gt;jstl&lt;/artifactId&gt;
              &lt;version&gt;1.2&lt;/version&gt;
          &lt;/dependency&gt;
  
          &lt;!-- https://mvnrepository.com/artifact/json-taglib/json-taglib --&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;atg.taglib.json&lt;/groupId&gt;
              &lt;artifactId&gt;json-taglib&lt;/artifactId&gt;
              &lt;version&gt;0.4.1&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;!-- use in jsp --&gt;
  
  
      &lt;/dependencies&gt;
  
      &lt;repositories&gt;
          &lt;repository&gt;
              &lt;id&gt;springsource-milestones&lt;/id&gt;
              &lt;name&gt;SpringSource Milestones Proxy&lt;/name&gt;
              &lt;url&gt;https://oss.sonatype.org/content/repositories/springsource-milestones&lt;/url&gt;
          &lt;/repository&gt;
  
  
          &lt;repository&gt;
              &lt;id&gt;public&lt;/id&gt;
              &lt;url&gt;http://maven.nuxeo.org/nexus/content/repositories/public/&lt;/url&gt;
          &lt;/repository&gt;
  
      &lt;/repositories&gt;
  
  
  
      &lt;build&gt;
          &lt;finalName&gt;blocks&lt;/finalName&gt;
          &lt;plugins&gt;
              &lt;plugin&gt;
                  &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
                  &lt;artifactId&gt;maven-compiler-plugin&lt;/artifactId&gt;
                  &lt;version&gt;2.0.2&lt;/version&gt;
                  &lt;configuration&gt;
                      &lt;source&gt;${java.version}&lt;/source&gt;
                      &lt;target&gt;${java.version}&lt;/target&gt;
                  &lt;/configuration&gt;
              &lt;/plugin&gt;
              &lt;plugin&gt;
                  &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
                  &lt;artifactId&gt;maven-dependency-plugin&lt;/artifactId&gt;
                  &lt;executions&gt;
                      &lt;execution&gt;
                          &lt;phase&gt;package&lt;/phase&gt;
                          &lt;goals&gt;
                              &lt;goal&gt;copy&lt;/goal&gt;
                          &lt;/goals&gt;
                          &lt;configuration&gt;
                              &lt;artifactItems&gt;
                                  &lt;artifactItem&gt;
                                      &lt;groupId&gt;com.heroku&lt;/groupId&gt;
                                      &lt;artifactId&gt;webapp-runner&lt;/artifactId&gt;
                                      &lt;version&gt;9.0.41.0&lt;/version&gt;
                                      &lt;destFileName&gt;webapp-runner.jar&lt;/destFileName&gt;
                                  &lt;/artifactItem&gt;
                              &lt;/artifactItems&gt;
                          &lt;/configuration&gt;
                      &lt;/execution&gt;
                  &lt;/executions&gt;
              &lt;/plugin&gt;
          &lt;/plugins&gt;
      &lt;/build&gt;
  &lt;/project&gt;
  </code></pre>
  <pre class="lang-xml prettyprint-override"><code>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
  &lt;persistence version=&quot;2.2&quot;
      xmlns=&quot;http://xmlns.jcp.org/xml/ns/persistence&quot;
      xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot;
      xsi:schemaLocation=&quot;http://xmlns.jcp.org/xml/ns/persistence http://xmlns.jcp.org/xml/ns/persistence/persistence_2_2.xsd&quot;&gt;
      &lt;!-- &lt;persistence-unit name=&quot;blocks&quot;&gt; &lt;class&gt;com.gerald.ryan.blocks.entity.Block&lt;/class&gt; 
          &lt;class&gt;com.gerald.ryan.blocks.entity.Blockchain&lt;/class&gt; &lt;class&gt;com.gerald.ryan.blocks.entity.Transaction&lt;/class&gt; 
          &lt;class&gt;com.gerald.ryan.blocks.entity.Wallet&lt;/class&gt; &lt;class&gt;com.gerald.ryan.blocks.entity.User&lt;/class&gt; 
          &lt;properties&gt; &lt;property name=&quot;javax.persistence.jdbc.url&quot; value=&quot;jdbc:mysql://localhost:3306/blockchain?serverTimezone=UTC&quot; 
          /&gt; &lt;property name=&quot;javax.persistence.jdbc.user&quot; value=&quot;root&quot; /&gt; &lt;property 
          name=&quot;javax.persistence.jdbc.password&quot; value=&quot;root&quot; /&gt; &lt;property name=&quot;javax.persistence.jdbc.driver&quot; 
          value=&quot;com.mysql.jdbc.Driver&quot; /&gt; &lt;property name=&quot;javax.persistence.schema-generation.database.action&quot; 
          value=&quot;create&quot; /&gt; &lt;property name=&quot;hibernate.show_sql&quot; value=&quot;true&quot; /&gt; &lt;property 
          name=&quot;hibernate.format_sql&quot; value=&quot;true&quot; /&gt; &lt;/properties&gt; &lt;/persistence-unit&gt; --&gt;
      &lt;persistence-unit name=&quot;blocks&quot;&gt;
          &lt;class&gt;com.gerald.ryan.blocks.entity.Block&lt;/class&gt;
          &lt;class&gt;com.gerald.ryan.blocks.entity.Blockchain&lt;/class&gt;
          &lt;class&gt;com.gerald.ryan.blocks.entity.Transaction&lt;/class&gt;
          &lt;class&gt;com.gerald.ryan.blocks.entity.Wallet&lt;/class&gt;
          &lt;class&gt;com.gerald.ryan.blocks.entity.User&lt;/class&gt;
          &lt;properties&gt;
              &lt;property name=&quot;javax.persistence.jdbc.url&quot;
                  value=&quot;jdbc:mysql://u3r5w4ayhxzdrw87.cbetxkdyhwsb.us-east-1.rds.amazonaws.com:3306/f5wvp1u840cyi24e&quot; /&gt;
              &lt;property name=&quot;javax.persistence.jdbc.user&quot;
                  value=&quot;e9hhcvg1kn3ik6cr&quot; /&gt;
              &lt;property name=&quot;javax.persistence.jdbc.password&quot;
                  value=&quot;p0fhaapu58vhqvor&quot; /&gt;
              &lt;property name=&quot;javax.persistence.jdbc.driver&quot;
                  value=&quot;com.mysql.jdbc.Driver&quot; /&gt;
              &lt;property
                  name=&quot;javax.persistence.schema-generation.database.action&quot;
                  value=&quot;create&quot; /&gt;
              &lt;property name=&quot;hibernate.show_sql&quot; value=&quot;true&quot; /&gt;
              &lt;property name=&quot;hibernate.format_sql&quot; value=&quot;true&quot; /&gt;
          &lt;/properties&gt;
      &lt;/persistence-unit&gt;
  &lt;!-- as config var on https://dashboard.heroku.com/apps/blocksjava/settings --&gt;
  &lt;!-- mysql://e9hhcvg1kn3ik6cr:b5wkq1kvydnyogrp@u3r5w4ayhxzdrw87.cbetxkdyhwsb.us-east-1.rds.amazonaws.com:3306/f5wvp1u840cyi24e --&gt;
  
  &lt;/persistence&gt;
  </code></pre>
  <pre class="lang-java prettyprint-override"><code>package com.gerald.ryan.blocks.dbConnection;
  
  import java.net.URI;
  import java.net.URISyntaxException;
  import java.sql.Connection;
  import java.sql.DriverManager;
  import java.sql.SQLException;
  
  import javax.persistence.EntityManager;
  import javax.persistence.EntityManagerFactory;
  import javax.persistence.Persistence;
  
  public abstract class DBConnection {
      protected EntityManagerFactory emf = null;
      protected EntityManager em = null;
      private String pUName = &quot;blocks&quot;;
  
      public void connect() {
          System.err.println(&quot;Persistence Provider: &quot; + Persistence.PERSISTENCE_PROVIDER);
          System.err.println(&quot;Persistence Class: &quot; + Persistence.class);
          this.emf = Persistence.createEntityManagerFactory(pUName);
          this.em = emf.createEntityManager();
      }
  
      public void disconnect() {
          if (this.em != null) {
              em.close();
          }
          if (this.emf != null) {
              emf.close();
          }
      }
  </code></pre>
  <pre><code>Type Exception Report
  
  Message Request processing failed; nested exception is javax.persistence.PersistenceException: No Persistence provider for EntityManager named blocks
  
  Description The server encountered an unexpected condition that prevented it from fulfilling the request.
  
  Exception
  
  org.springframework.web.util.NestedServletException: Request processing failed; nested exception is javax.persistence.PersistenceException: No Persistence provider for EntityManager named blocks
      org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1014)
      org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:909)
      javax.servlet.http.HttpServlet.service(HttpServlet.java:652)
      org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:883)
      javax.servlet.http.HttpServlet.service(HttpServlet.java:733)
      org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)
  Root Cause
  
  javax.persistence.PersistenceException: No Persistence provider for EntityManager named blocks
      javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:85)
      javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:54)
      com.gerald.ryan.blocks.dbConnection.DBConnection.connect(DBConnection.java:12)
      com.gerald.ryan.blocks.Dao.UserDao.addUser(UserDao.java:16)
      com.gerald.ryan.blocks.Service.UserService.addUserService(UserService.java:22)
      com.gerald.ryan.blocks.controller.RegistrationController.registerUser(RegistrationController.java:40)
      sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      java.lang.reflect.Method.invoke(Method.java:498)
      org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:197)
      org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:141)
      org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:106)
      org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:894)
      org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:808)
      org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87)
      org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1060)
      org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:962)
      org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1006)
      org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:909)
      javax.servlet.http.HttpServlet.service(HttpServlet.java:652)
      org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:883)
      javax.servlet.http.HttpServlet.service(HttpServlet.java:733)
      org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)
  </code></pre>
  <p>What possible dependency or configuration could I be missing or what tools and techniques could help me learn more?</p>
  <p>Jaws DB dashboard- worked correctly connecting via Localhost
  <a href="https://i.stack.imgur.com/qVJ5l.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/qVJ5l.png" alt="JawsDB Dashboard" /></a></p>