1

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?

Phil C
  • 303
  • 2
  • 10

1 Answers1

0

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

Andrei Volgin
  • 40,755
  • 6
  • 49
  • 58
  • I see. Do you know whether this is possible to achieve with a Maven project setup? I came across these two articles: The first one talks about a "common project": https://code.google.com/p/googleappengine/issues/detail?id=10652 In the second one you can see a Maven dependency across modules: http://stackoverflow.com/questions/19431412/using-jdo-persistent-classes-from-a-separate-module-with-datanucleus-maven-plugi – Phil C May 31 '14 at 10:25