Making the swap from JDO to Objectify for several reasons, one of
which is speed. I'm using Eclipse, but not the Google Plugin (maven2
instead to build/deploy) so I'm bringing in all of the App Engine Jar
files by script. And so begins a few questions, some specific to
Objectify, others to App Engine:
1. There are several (6?) Jar files, but I have no idea what they
do. I get the sense that if I use Objectify, I don't need anything
related to JPA/JDO/Datanucleus. Is that the case? I have a lot of
migrating still to do, so I haven't actually compiled the project yet.
2. I tried removing all the jar files and realized that Eclipse
didn't recognize javax.persistence annotations. I guess I took it for
granted that they were always there, but I suppose they've always been
provided by something else (e.g. in the past, I've used Hibernate).
So, I brought back in geronimo-jpa-blah.jar which solved the Eclipse
error, but what *is* geronimo-jpa-blah.jar exactly?
3. Is there any location that describes the GAE/J jar files? Stubs,
Labs, Agent, Runtime, etc. I feel like I shouldn't need all of them
to run my project - I certainly haven't been bringing them all in up
to this point with JDO.
Thanks! Looking forward to an enjoyable transition!
Jake
On 1 Apr 2010, at 19:00, Jake wrote:
> Hey all,
>
> Making the swap from JDO to Objectify for several reasons, one of
> which is speed. I'm using Eclipse, but not the Google Plugin (maven2
> instead to build/deploy) so I'm bringing in all of the App Engine Jar
> files by script. And so begins a few questions, some specific to
> Objectify, others to App Engine:
>
> 1. There are several (6?) Jar files, but I have no idea what they
> do. I get the sense that if I use Objectify, I don't need anything
> related to JPA/JDO/Datanucleus. Is that the case? I have a lot of
> migrating still to do, so I haven't actually compiled the project yet.
>
I use (but I haven't exactly checked that I really need them all) - see my dependency xml attached:
objectify
persistence-api
appengine-api-1.0-sdk
appengine-api-labs
appengine-api-stubs
appengine-testing (scope test)
> 2. I tried removing all the jar files and realized that Eclipse
> didn't recognize javax.persistence annotations. I guess I took it for
> granted that they were always there, but I suppose they've always been
> provided by something else (e.g. in the past, I've used Hibernate).
> So, I brought back in geronimo-jpa-blah.jar which solved the Eclipse
> error, but what *is* geronimo-jpa-blah.jar exactly?
Geronimo is a j2ee server. Since sun failed utterly to provide their jars through maven central repo, the geronimo api jars have become a de facto standard implementation of many of java standard APIs (typically because many projects only want to rely on central repo). You quite often see the geronimo version of servlet api, jsp api being used. The geronimo version of the persistence-api works fine, but for this particular API the a sun version also exist in central repo.
> 3. Is there any location that describes the GAE/J jar files? Stubs,
> Labs, Agent, Runtime, etc. I feel like I shouldn't need all of them
> to run my project - I certainly haven't been bringing them all in up
> to this point with JDO.
>
> Thanks! Looking forward to an enjoyable transition!
GAE is about lean and mean. Datanucleus sits like a gigantic lard ball in your pom.xml soup. You'll never look back :)
Cheers,
Martin
------------------------------------------------------------------------------------
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>2.5</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.servlet.jsp</groupId>
<artifactId>jsp-api</artifactId>
<version>2.1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.persistence</groupId>
<artifactId>persistence-api</artifactId>
<version>1.0</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.4</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.googlecode.objectify</groupId>
<artifactId>objectify</artifactId>
<version>2.1</version>
</dependency>
<!-- GAE stuff below *********************************************** -->
<dependency>
<groupId>com.google.appengine</groupId>
<artifactId>appengine-api-1.0-sdk</artifactId>
<version>${gae.version}</version>
</dependency>
<dependency>
<groupId>com.google.appengine</groupId>
<artifactId>appengine-api-labs</artifactId>
<version>${gae.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.google.appengine</groupId>
<artifactId>appengine-api-stubs</artifactId>
<version>${gae.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.google.appengine</groupId>
<artifactId>appengine-testing</artifactId>
<version>${gae.version}</version>
<scope>test</scope>
</dependency>
As Martin said, geronimo-jpa_3.0_spec-1.1.1.jar contains all the files
defined by the JPA spec - mostly annotations like
javax.persistence.Id.
Unfortunately there isn't any single document that explains what each
of the GAE jars does. You can look inside each of the jars with
Eclipse to check up, but here's a rough guide:
appengine-api-1.0-sdk-1.3.1.jar, appengine-api-labs-1.3.1.jar: you
will need these, they are the low-level APIs for GAE
appengine-jsr107cache-1.3.1.jar: you will want this, adapts the
memcache service to the standard java cache api.
datanucleus-*: you will not need any of these, they contain the DN
implementation that powers JDO
geronimo-*: you will need these, they contain basic API annotations for J2EE
jdo2-api-2.3-eb.jar: you will not need this file it's the standard JDO
API which you aren't using
jsr107cache-1.1.jar: you will probably want this, it's not related to
Objectify but gives you the (inferior, IMNSHO) standard java API to
the memcache service
In addition, you'll want the following files added to your project if
you want to run unit tests as described in
http://code.google.com/appengine/docs/java/tools/localunittesting.html
appengine-api.jar
appengine-api-labs.jar
appengine-api-stubs.jar
appengine-testing.jar
These jars are only needed at test-time and shouldn't be in your WEB-INF/lib.
Jeff
> --
> To unsubscribe, reply using "remove me" as the subject.
>
Wow. Most helpful, timely reply ever found on a google group. Of
course, you know, this means I will be coming back when I have more
questions :)
Thanks!
Jake
On Apr 1, 1:59 pm, Jeff Schnitzer <j...@infohazard.org> wrote:
> Matt, would you add geronimo-jpa_3.0_spec-1.1.1.jar as a maven
> dependency to the pom? Maybe the basic GAE jars too? Assuming there
> is some sort of central maven repo for the GAE artifacts, of course.
>
> As Martin said, geronimo-jpa_3.0_spec-1.1.1.jar contains all the files
> defined by the JPA spec - mostly annotations like
> javax.persistence.Id.
>
> Unfortunately there isn't any single document that explains what each
> of the GAE jars does. You can look inside each of the jars with
> Eclipse to check up, but here's a rough guide:
>
> appengine-api-1.0-sdk-1.3.1.jar, appengine-api-labs-1.3.1.jar: you
> will need these, they are the low-level APIs for GAE
>
> appengine-jsr107cache-1.3.1.jar: you will want this, adapts the
> memcache service to the standard java cache api.
>
> datanucleus-*: you will not need any of these, they contain the DN
> implementation that powers JDO
>
> geronimo-*: you will need these, they contain basic API annotations for J2EE
>
> jdo2-api-2.3-eb.jar: you will not need this file it's the standard JDO
> API which you aren't using
>
> jsr107cache-1.1.jar: you will probably want this, it's not related to
> Objectify but gives you the (inferior, IMNSHO) standard java API to
> the memcache service
>
> In addition, you'll want the following files added to your project if
> you want to run unit tests as described inhttp://code.google.com/appengine/docs/java/tools/localunittesting.html
>
> appengine-api.jar
> appengine-api-labs.jar
> appengine-api-stubs.jar
> appengine-testing.jar
>
> These jars are only needed at test-time and shouldn't be in your WEB-INF/lib.
>
> Jeff
>
Will do.
Why use the Geronimo version when jpa got a "proper" javax version in
central repo?
Martin
Hmmmm.
I suspect this is a question better asked of the Appengine team. Not
that I expect there to be any differences between the jars of
equivalent j2ee spec versions, but I just feel safer knowing that
we're using the exact same jars that GAE uses.
Jeff