views:

170

answers:

2

Hi all,

I've been trying to create a single project which can run both on sql and gae (where the 'datanucleus.properties' file needs to be changed) under a single maven folder structure. I first tried to get the Greeting example on the GAE website using mysql (this now works). Then, inspiring myself from beardedgeeks tutorial, I have tried to add the required dependencies so as to run the stuff on gae. By typing in mvn gae:run, however, I get the following error, posted at http://pastebin.com/fJ7c7xfx. I have spent a large amount of time searching google etc. for answers, but haven't been able to advance my case.

I would be glad to get some pointers. Cheers, manojo

A: 

This question is tagged [JDO] but the following trace:

Caused by: java.lang.ClassNotFoundException: javax.persistence.InheritanceType
    at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
    at com.google.appengine.tools.development.IsolatedAppClassLoader.loadClass(IsolatedAppClassLoader.java:151)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
    ... 77 more

suggests that you're missing the JPA API jar (provided by org.apache.geronimo.specs:geronimo-jpa_1.0_spec:1.1.1).

<dependency>
  <groupId>org.apache.geronimo.specs</groupId>
  <artifactId>geronimo-jpa_3.0_spec</artifactId>
  <version>1.1.1</version>
</dependency>

Since you're not using JPA, you shouldn't have to do that but it appears that the JPA API is somehow referenced by the datanucleus appengine plugin as explained by @Datanucleus.

Pascal Thivent
Hi, thanks for the response. I was only able to post one link, and indeed, I am not using jpa. Here's my pom.xml : http://pastebin.com/2Y7gC2b0. Hope it helps. Please let me know if anything more is needed.Cheers, Manojo
manojo
@manojo: I don't know why you get complains about JPA and can't investigate or try to reproduce right now.
Pascal Thivent
A: 

The people at Google unwisely put a reference in to that JPA class in their plugin and so it requires that you have the jpa.jar (the Geronimo one will do) in your CLASSPATH. An issue was raised on them a long time ago to fix it, but sadly they don't actively maintain their plugin.

DataNucleus
After including the jpa jars, it does indeed work, thank you very much :).
manojo