Dali fails with Entity's from JAR [message #610577] |
Sat, 24 May 2008 05:10 |
Jason Drake Messages: 13 Registered: July 2009 |
Junior Member |
|
|
I have an issue which so far I have not been able to resolve. I am using
Toplink JPA.
I have a series of Persistence beans annotated with the @Entity annotation
in an Eclipse Project. This eclipse project does not contain a
persistence.xml (other than in the src_test folder but this never leaves
the project). The project is my bean/services module which contains my
backend services code and common persistent beans (used by other
applications: a swing app and a WEB-app serving my mobile devices....).
Lets call the output of this module "Model.jar"
I created a Dynamic Web Project (The WEB-app project mentioned above) and
I included "Java Persistence" support in the project facet. After the
project is created, I reference the "Model.jar" in my dynamic project. I
also create a persistence.xml which includes
<class>mypackage.myBean</class> statements for each of my persistent beans
present in the Model.jar. However I will get the error:
Class "mypackage.myBean" is not annotated as a persistent class
for each of the beans. The project compiles and runs perfectly. I can
access my persistent beans and my servlet uses a listener to obtain a
persistence context on startup. I am convinced this is because my beans
are in an external jar, however the @Entity annotation is a runtime
evaluated annotation so it should be available to Dali. It is almost like
any entities outside the project are not recognized.
Is there a way I can resolve these errors? If I "Synchronize Classes" it
will remove the <class/> statements (which will cause my listener to fail
to get an EntityManagerFactory)
I am using WTP 2.0 with the latest updates available for Dali.
Thanks
Jason Drake
|
|
|
Powered by
FUDForum. Page generated in 0.03112 seconds