For the past years I have been working with Java EE 6 and simpler application structures, where only one ejb and one war project were present.
Now we have a more complex project, where I need to have additional modules: - JPA package - client interfaces for an automated tester application
So I have started creating the following projects in eclipse:
- Client project
- JPA project referencing the client project
- EJB project referencing both client and JPA projects
- WAR project, that should use services from the EJB project and pojo classes from JPA project
- EAR project holding all of this
Packing the project together, I am facing different problems:
- "A cycle was detected in the build path of project..." because multiple projects are referencing the client project, and it is packaged to the EAR
- Error in annotation processing: {0}. java.lang.NoClassDefFoundError
I was trying to solve these problems. I have come up with solutions, but neither of them works. Ex 1.: I have simplified the packing to only the JPA + Client + EAR, but this also gives me the cycle detected error. When I turn the error off, I get the 2nd error.
Ex 2.: Tried to simplify build path dependencies, but no luck.
I have also been thinking of merging the EJB + JPA projects, maybe that will work.
But my question is: using Eclipse for development, what is the desired (project and dependency) structure for an EAR app containing client interfaces, ejbs, jpa entities and a standalone tester app using only the client interfaces?
Thanks for your help!