title: Eclipselink no suitable driver found for jdbc:mysql
body: <p><strong>The error</strong></p>
  
  <p>No suitable driver found for jdbc:mysql://localhost:3306/mazedb</p>
  
  <p><strong>The complete error</strong></p>
  
  <pre><code>INFO: [EL Info]: 2012-01-03
  23:27:35.522--ServerSession(11375975)--EclipseLink, version: Eclipse
  Persistence Services - 2.3.0.v20110604-r9504
  
  INFO: [EL Severe]: 2012-01-03
  23:27:35.528--ServerSession(11375975)--Local Exception Stack: 
  Exception [EclipseLink-4002] (Eclipse Persistence Services -
  2.3.0.v20110604-r9504): org.eclipse.persistence.exceptions.DatabaseException Internal
  Exception: java.sql.SQLException: No suitable driver found for
  jdbc:mysql://localhost:3306/mazedb Error Code: 0    at
  org.eclipse.persistence.exceptions.DatabaseException.sqlException(DatabaseException.java:324)
      at
  org.eclipse.persistence.exceptions.DatabaseException.sqlException(DatabaseException.java:319)
      at
  org.eclipse.persistence.sessions.DefaultConnector.connect(DefaultConnector.java:138)
      at
  org.eclipse.persistence.sessions.DatasourceLogin.connectToDatasource(DatasourceLogin.java:162)
      at
  org.eclipse.persistence.internal.sessions.DatabaseSessionImpl.loginAndDetectDatasource(DatabaseSessionImpl.java:582)
      at
  org.eclipse.persistence.internal.jpa.EntityManagerFactoryProvider.login(EntityManagerFactoryProvider.java:206)
      at
  org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl.deploy(EntityManagerSetupImpl.java:472)
      at
  org.eclipse.persistence.internal.jpa.EntityManagerFactoryDelegate.getDatabaseSession(EntityManagerFactoryDelegate.java:188)
      at
  org.eclipse.persistence.internal.jpa.EntityManagerFactoryDelegate.createEntityManagerImpl(EntityManagerFactoryDelegate.java:277)
      at
  org.eclipse.persistence.internal.jpa.EntityManagerFactoryImpl.createEntityManagerImpl(EntityManagerFactoryImpl.java:290)
      at
  org.eclipse.persistence.internal.jpa.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:268)
      at
  com.maze.service.AccountService.validateLogin(AccountService.java:18)
      at
  com.maze.controller.AccountController.performLogin(AccountController.java:31)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)  at
  sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at
  sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)     at
  com.sun.el.parser.AstValue.invoke(AstValue.java:234)    at
  com.sun.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:297)
      at
  com.sun.faces.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:105)
      at
  javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:88)
      at
  com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:102)
      at javax.faces.component.UICommand.broadcast(UICommand.java:315)    at
  javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:794)
      at
  javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:1259)
      at
  com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:81)
      at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)    at
  com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
      at javax.faces.webapp.FacesServlet.service(FacesServlet.java:593)   at
  org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1539)
      at
  org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:281)
      at
  org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
      at
  org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:655)
      at
  org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:595)
      at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:98)   at
  com.sun.enterprise.web.PESessionLockingStandardPipeline.invoke(PESessionLockingStandardPipeline.java:91)
      at
  org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:162)
      at
  org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:330)
      at
  org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:231)
      at
  com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:174)
      at
  com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:828)
      at
  com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:725)
      at
  com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1019)
      at
  com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:225)
      at
  com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137)
      at
  com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104)
      at
  com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90)
      at
  com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79)
      at
  com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54)
      at
  com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59)
      at com.sun.grizzly.ContextTask.run(ContextTask.java:71)     at
  com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532)
      at
  com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513)
      at java.lang.Thread.run(Thread.java:662) Caused by:
  java.sql.SQLException: No suitable driver found for
  jdbc:mysql://localhost:3306/mazedb  at
  java.sql.DriverManager.getConnection(DriverManager.java:602)    at
  java.sql.DriverManager.getConnection(DriverManager.java:154)    at
  org.eclipse.persistence.sessions.DefaultConnector.connect(DefaultConnector.java:98)
      ... 51 more
  
  WARNING: #{accountController.performLogin}:
  javax.persistence.PersistenceException: Exception [EclipseLink-4002]
  (Eclipse Persistence Services - 2.3.0.v20110604-r9504):
  org.eclipse.persistence.exceptions.DatabaseException Internal
  Exception: java.sql.SQLException: No suitable driver found for
  jdbc:mysql://localhost:3306/mazedb Error Code: 0
  javax.faces.FacesException: #{accountController.performLogin}:
  javax.persistence.PersistenceException: Exception [EclipseLink-4002]
  (Eclipse Persistence Services - 2.3.0.v20110604-r9504):
  org.eclipse.persistence.exceptions.DatabaseException Internal
  Exception: java.sql.SQLException: No suitable driver found for
  jdbc:mysql://localhost:3306/mazedb Error Code: 0    at
  com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:118)
      at javax.faces.component.UICommand.broadcast(UICommand.java:315)    at
  javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:794)
      at
  javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:1259)
      at
  com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:81)
      at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)    at
  com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
      at javax.faces.webapp.FacesServlet.service(FacesServlet.java:593)   at
  org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1539)
      at
  org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:281)
      at
  org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
      at
  org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:655)
      at
  org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:595)
      at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:98)   at
  com.sun.enterprise.web.PESessionLockingStandardPipeline.invoke(PESessionLockingStandardPipeline.java:91)
      at
  org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:162)
      at
  org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:330)
      at
  org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:231)
      at
  com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:174)
      at
  com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:828)
      at
  com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:725)
      at
  com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1019)
      at
  com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:225)
      at
  com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137)
      at
  com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104)
      at
  com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90)
      at
  com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79)
      at
  com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54)
      at
  com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59)
      at com.sun.grizzly.ContextTask.run(ContextTask.java:71)     at
  com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532)
      at
  com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513)
      at java.lang.Thread.run(Thread.java:662) Caused by:
  javax.faces.el.EvaluationException:
  javax.persistence.PersistenceException: Exception [EclipseLink-4002]
  (Eclipse Persistence Services - 2.3.0.v20110604-r9504):
  org.eclipse.persistence.exceptions.DatabaseException Internal
  Exception: java.sql.SQLException: No suitable driver found for
  jdbc:mysql://localhost:3306/mazedb Error Code: 0    at
  javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:102)
      at
  com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:102)
      ... 32 more Caused by: javax.persistence.PersistenceException:
  Exception [EclipseLink-4002] (Eclipse Persistence Services -
  2.3.0.v20110604-r9504): org.eclipse.persistence.exceptions.DatabaseException Internal
  Exception: java.sql.SQLException: No suitable driver found for
  jdbc:mysql://localhost:3306/mazedb Error Code: 0    at
  org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl.deploy(EntityManagerSetupImpl.java:501)
      at
  org.eclipse.persistence.internal.jpa.EntityManagerFactoryDelegate.getDatabaseSession(EntityManagerFactoryDelegate.java:188)
      at
  org.eclipse.persistence.internal.jpa.EntityManagerFactoryDelegate.createEntityManagerImpl(EntityManagerFactoryDelegate.java:277)
      at
  org.eclipse.persistence.internal.jpa.EntityManagerFactoryImpl.createEntityManagerImpl(EntityManagerFactoryImpl.java:290)
      at
  org.eclipse.persistence.internal.jpa.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:268)
      at
  com.maze.service.AccountService.validateLogin(AccountService.java:18)
      at
  com.maze.controller.AccountController.performLogin(AccountController.java:31)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)  at
  sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at
  sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)     at
  com.sun.el.parser.AstValue.invoke(AstValue.java:234)    at
  com.sun.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:297)
      at
  com.sun.faces.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:105)
      at
  javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:88)
      ... 33 more Caused by: Exception [EclipseLink-4002] (Eclipse
  Persistence Services - 2.3.0.v20110604-r9504):
  org.eclipse.persistence.exceptions.DatabaseException Internal
  Exception: java.sql.SQLException: No suitable driver found for
  jdbc:mysql://localhost:3306/mazedb Error Code: 0    at
  org.eclipse.persistence.exceptions.DatabaseException.sqlException(DatabaseException.java:324)
      at
  org.eclipse.persistence.exceptions.DatabaseException.sqlException(DatabaseException.java:319)
      at
  org.eclipse.persistence.sessions.DefaultConnector.connect(DefaultConnector.java:138)
      at
  org.eclipse.persistence.sessions.DatasourceLogin.connectToDatasource(DatasourceLogin.java:162)
      at
  org.eclipse.persistence.internal.sessions.DatabaseSessionImpl.loginAndDetectDatasource(DatabaseSessionImpl.java:582)
      at
  org.eclipse.persistence.internal.jpa.EntityManagerFactoryProvider.login(EntityManagerFactoryProvider.java:206)
      at
  org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl.deploy(EntityManagerSetupImpl.java:472)
      ... 47 more Caused by: java.sql.SQLException: No suitable driver
  found for jdbc:mysql://localhost:3306/mazedb    at
  java.sql.DriverManager.getConnection(DriverManager.java:602)    at
  java.sql.DriverManager.getConnection(DriverManager.java:154)    at
  org.eclipse.persistence.sessions.DefaultConnector.connect(DefaultConnector.java:98)
      ... 51 more
  
  INFO: Exit : invoke_application 5 WARNING: StandardWrapperValve[Faces
  Servlet]: PWC1406: Servlet.service() for servlet Faces Servlet threw
  exception javax.faces.el.EvaluationException:
  javax.persistence.PersistenceException: Exception [EclipseLink-4002]
  (Eclipse Persistence Services - 2.3.0.v20110604-r9504):
  org.eclipse.persistence.exceptions.DatabaseException Internal
  Exception: java.sql.SQLException: No suitable driver found for
  jdbc:mysql://localhost:3306/mazedb Error Code: 0    at
  javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:102)
      at
  com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:102)
      at javax.faces.component.UICommand.broadcast(UICommand.java:315)    at
  javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:794)
      at
  javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:1259)
      at
  com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:81)
      at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)    at
  com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
      at javax.faces.webapp.FacesServlet.service(FacesServlet.java:593)   at
  org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1539)
      at
  org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:281)
      at
  org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
      at
  org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:655)
      at
  org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:595)
      at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:98)   at
  com.sun.enterprise.web.PESessionLockingStandardPipeline.invoke(PESessionLockingStandardPipeline.java:91)
      at
  org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:162)
      at
  org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:330)
      at
  org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:231)
      at
  com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:174)
      at
  com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:828)
      at
  com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:725)
      at
  com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1019)
      at
  com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:225)
      at
  com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137)
      at
  com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104)
      at
  com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90)
      at
  com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79)
      at
  com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54)
      at
  com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59)
      at com.sun.grizzly.ContextTask.run(ContextTask.java:71)     at
  com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532)
      at
  com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513)
      at java.lang.Thread.run(Thread.java:662) Caused by:
  javax.persistence.PersistenceException: Exception [EclipseLink-4002]
  (Eclipse Persistence Services - 2.3.0.v20110604-r9504):
  org.eclipse.persistence.exceptions.DatabaseException Internal
  Exception: java.sql.SQLException: No suitable driver found for
  jdbc:mysql://localhost:3306/mazedb Error Code: 0    at
  org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl.deploy(EntityManagerSetupImpl.java:501)
      at
  org.eclipse.persistence.internal.jpa.EntityManagerFactoryDelegate.getDatabaseSession(EntityManagerFactoryDelegate.java:188)
      at
  org.eclipse.persistence.internal.jpa.EntityManagerFactoryDelegate.createEntityManagerImpl(EntityManagerFactoryDelegate.java:277)
      at
  org.eclipse.persistence.internal.jpa.EntityManagerFactoryImpl.createEntityManagerImpl(EntityManagerFactoryImpl.java:290)
      at
  org.eclipse.persistence.internal.jpa.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:268)
      at
  com.maze.service.AccountService.validateLogin(AccountService.java:18)
      at
  com.maze.controller.AccountController.performLogin(AccountController.java:31)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)  at
  sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at
  sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)     at
  com.sun.el.parser.AstValue.invoke(AstValue.java:234)    at
  com.sun.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:297)
      at
  com.sun.faces.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:105)
      at
  javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:88)
      ... 33 more Caused by: Exception [EclipseLink-4002] (Eclipse
  Persistence Services - 2.3.0.v20110604-r9504):
  org.eclipse.persistence.exceptions.DatabaseException Internal
  Exception: java.sql.SQLException: No suitable driver found for
  jdbc:mysql://localhost:3306/mazedb Error Code: 0    at
  org.eclipse.persistence.exceptions.DatabaseException.sqlException(DatabaseException.java:324)
      at
  org.eclipse.persistence.exceptions.DatabaseException.sqlException(DatabaseException.java:319)
      at
  org.eclipse.persistence.sessions.DefaultConnector.connect(DefaultConnector.java:138)
      at
  org.eclipse.persistence.sessions.DatasourceLogin.connectToDatasource(DatasourceLogin.java:162)
      at
  org.eclipse.persistence.internal.sessions.DatabaseSessionImpl.loginAndDetectDatasource(DatabaseSessionImpl.java:582)
      at
  org.eclipse.persistence.internal.jpa.EntityManagerFactoryProvider.login(EntityManagerFactoryProvider.java:206)
      at
  org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl.deploy(EntityManagerSetupImpl.java:472)
      ... 47 more Caused by: java.sql.SQLException: No suitable driver
  found for jdbc:mysql://localhost:3306/mazedb    at
  java.sql.DriverManager.getConnection(DriverManager.java:602)    at
  java.sql.DriverManager.getConnection(DriverManager.java:154)    at
  org.eclipse.persistence.sessions.DefaultConnector.connect(DefaultConnector.java:98)
      ... 51 more
  </code></pre>
  
  <p><strong>persistence.xml</strong></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;persistence version="2.0" xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
          xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd"&gt;
  
      &lt;persistence-unit name="Maze" transaction-type="RESOURCE_LOCAL"&gt;
          &lt;properties&gt;
              &lt;property name="javax.persistence.jdbc.url" value="jdbc:mysql://localhost:3306/mazedb"/&gt;
              &lt;property name="javax.persistence.jdbc.driver" value="com.mysql.jdbc.Driver"/&gt;
              &lt;property name="javax.persistence.jdbc.user" value="maze"/&gt;
              &lt;property name="javax.persistence.jdbc.password" value="maze"/&gt;
          &lt;/properties&gt;
  
      &lt;/persistence-unit&gt;
  &lt;/persistence&gt;
  </code></pre>
  
  <p>The mysql connector is included in the build path</p>