GAE Eclipse: Cross-Modules Referencing

72 Views Asked by At

I have a project setup with an EAR and two WAR projects (=modules) in Eclipse for Google AppEngine (GAE). I would like to reference classes from module A in module B. How do I do this?

What I have done so far:

I have added module A to the build path of module B. This solves the problem with the compiler, but it does not solve the problem of referencing classes during runtime. I receive a java.lang.NoClassDefFoundError.

Context:

GAE modules share the same datastore, so I want to access the same persistence classes. These classes are defined and enhanced in module A. What is the best practive with this regard?

1

There are 1 best solutions below

1
On BEST ANSWER

Unfortunately, you have to export your module A into a jar and add it to the war/WEB-INF/lib directory of module B.