title: Cannot initialize PersistenceManager
body: <p>I am trying to run on local machine app engine project. I have defined in <code>web/WEB-INF/META-INF/jdoconfig.xml</code>:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;jdoconfig xmlns="http://java.sun.com/xml/ns/jdo/jdoconfig"
             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
             xsi:noNamespaceSchemaLocation="http://java.sun.com/xml/ns/jdo/jdoconfig"&gt;
  
      &lt;persistence-manager-factory name="transactions-optional"&gt;
          &lt;property name="javax.jdo.PersistenceManagerFactoryClass"
                    value="org.datanucleus.api.jdo.JDOPersistenceManagerFactory"/&gt;
          &lt;property name="javax.jdo.option.ConnectionURL" value="appengine"/&gt;
          &lt;property name="javax.jdo.option.NontransactionalRead" value="true"/&gt;
          &lt;property name="javax.jdo.option.NontransactionalWrite" value="true"/&gt;
          &lt;property name="javax.jdo.option.RetainValues" value="true"/&gt;
          &lt;property name="datanucleus.appengine.autoCreateDatastoreTxns" value="true"/&gt;
          &lt;property name="datanucleus.appengine.singletonPMFForName" value="true"/&gt;
          &lt;property name="datanucleus.appengine.datastoreReadConsistency" value="EVENTUAL" /&gt;
      &lt;/persistence-manager-factory&gt;
  &lt;/jdoconfig&gt;
  </code></pre>
  
  <p><strong>Error:</strong></p>
  
  <pre><code>    Caused by:
  
  javax.jdo.JDOFatalUserException: A property named javax.jdo.PersistenceManagerFactoryClass must be specified, or a jar file with a META-INF/services/javax.jdo.PersistenceManagerFactory entry must be in the classpath, or a property named javax.jdo.option.PersistenceUnitName must be specified.
      at javax.jdo.JDOHelper.getPersistenceManagerFactory(JDOHelper.java:861)
      at javax.jdo.JDOHelper.getPersistenceManagerFactory(JDOHelper.java:1099)
      at javax.jdo.JDOHelper.getPersistenceManagerFactory(JDOHelper.java:919)
      at dao.PMF.&lt;clinit&gt;(PMF.java:7)
      at java.lang.Class.forName0(Native Method)
      at java.lang.Class.forName(Class.java:190)
      at com.google.appengine.tools.development.agent.runtime.RuntimeHelper.checkRestricted(RuntimeHelper.java:70)
      at com.google.appengine.tools.development.agent.runtime.Runtime.checkRestricted(Runtime.java:64)
      at dao.ImageDAO.insertImage(ImageDAO.java:21)
      at UploadServlet.doPost(UploadServlet.java:60)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
      at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:511)
      at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1166)
      at com.google.appengine.api.socket.dev.DevSocketFilter.doFilter(DevSocketFilter.java:74)
      at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
      at com.google.appengine.tools.development.ResponseRewriterFilter.doFilter(ResponseRewriterFilter.java:127)
      at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
      at com.google.appengine.tools.development.HeaderVerificationFilter.doFilter(HeaderVerificationFilter.java:34)
      at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
      at com.google.appengine.api.blobstore.dev.ServeBlobFilter.doFilter(ServeBlobFilter.java:63)
      at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
      at com.google.apphosting.utils.servlet.TransactionCleanupFilter.doFilter(TransactionCleanupFilter.java:43)
      at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
      at com.google.appengine.tools.development.StaticFileFilter.doFilter(StaticFileFilter.java:125)
      at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
      at com.google.appengine.tools.development.DevAppServerModulesFilter.doDirectRequest(DevAppServerModulesFilter.java:366)
      at com.google.appengine.tools.development.DevAppServerModulesFilter.doDirectModuleRequest(DevAppServerModulesFilter.java:349)
      at com.google.appengine.tools.development.DevAppServerModulesFilter.doFilter(DevAppServerModulesFilter.java:116)
      at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
      at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:388)
      at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
      at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182)
      at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765)
      at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:418)
      at com.google.appengine.tools.development.DevAppEngineWebAppContext.handle(DevAppEngineWebAppContext.java:98)
      at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
      at com.google.appengine.tools.development.JettyContainerService$ApiProxyHandler.handle(JettyContainerService.java:490)
      at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
      at org.mortbay.jetty.Server.handle(Server.java:326)
      at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542)
      at org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:938)
      at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:755)
      at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:218)
      at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
      at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:409)
      at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:582)
  </code></pre>
  
  <p>How to fix it?</p>
  
  <hr>
  
  <p><strong>UPDATE:</strong></p>
  
  <p>New error</p>
  
  <pre><code>Could not initialize class dao.PMF
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/0icgC.png" alt="enter image description here"></p>