Environment: Eclipse, Maven
I have been following the Datanucleus JDO Tutorial to no avail as I am stuck at Step 4. It has “information”, but with no clear way to find it given I am new to Maven and new to Datanucleus.
All I wanted to do was switch a functioning project from AppEngine&Objectify and port it to target a Linode (using a persistence layer like Hibernate or Datanucleus). This has been far from the “Straight Forward™” claimed on the tutorial.
I get the following error when the code is executing JDOHelper.getPersistenceManagerFactory("datanucleus.properties"):
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 myproject.HelloWorld.handle(HelloWorld.java:45)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:116)
at org.eclipse.jetty.server.Server.handle(Server.java:365)
at org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:485)
at org.eclipse.jetty.server.AbstractHttpConnection.headerComplete(AbstractHttpConnection.java:926)
at org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.headerComplete(AbstractHttpConnection.java:988)
at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:635)
at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:235)
at org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:82)
at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:628)
at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:52)
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:608)
at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:543)
at java.lang.Thread.run(Thread.java:722)
It would be nice to progress on from this as it just seems like it might require a few more days of reading up on all the required technologies to figure out what is going on, but I actually just want to get started, so if it is a day or two of “figuring out” I will need to just pick a “solution”, which looks like it will be Hibernate at the moment.
I have made various modifications to the pom.xml, such as including ${basedir} as an extra classpath for the exec:java configuration, and copied in the Datanucleus maven settings.
Seems to me that the error message is explicit
So “datanucleus.properties” isn’t at the root of the CLASSPATH maybe? or you haven’t got jdo-api.jar in the CLASSPATH, or datanucleus-api-jdo.jar maybe, or other jars. It would be a simple task to actually print out the CLASSPATH and present it in your “problem description”, and with that the directory structure under that.
You don’t say what you’re entering on Step 4, because the provided README files tell you what to do and are verified to work; the provided Maven pom.xml works out of the box with the provided samples. As you say, you’re “adapting it (TM)” to your own application, and you don’t present what you’ve changed and why, where your code is etc.