Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Dali » Dali fails with Entity's from JAR
Dali fails with Entity's from JAR [message #434915] Sat, 24 May 2008 05:10 Go to next message
Jason Drake is currently offline Jason DrakeFriend
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
Re: Dali fails with Entity's from JAR [message #434916 is a reply to message #434915] Tue, 27 May 2008 22:34 Go to previous message
Neil Hauge is currently offline Neil HaugeFriend
Messages: 475
Registered: July 2009
Senior Member
Jason,

We do not yet support validating entities in a JAR, and as a result our
facet is not going to be of much help in this scenario. Given our current
support, in your case it would be best not to add the JPA Facet to your
Dynamic Web Project. You can use Dali in your "Model" project to develop
the entities of course, but we aren't much help once the entities are
packaged in a JAR. This is documented in bug 197069
(https://bugs.eclipse.org/bugs/show_bug.cgi?id=197069). We plan on adding
this support in the next release of Dali (after the upcoming June release).

So for now I would recommend you remove the JPA facet via the project
properties from the Dynamic Web Project to avoid the error messages.

Neil
Re: Dali fails with Entity's from JAR [message #610581 is a reply to message #434915] Tue, 27 May 2008 22:34 Go to previous message
Neil Hauge is currently offline Neil HaugeFriend
Messages: 475
Registered: July 2009
Senior Member
Jason,

We do not yet support validating entities in a JAR, and as a result our
facet is not going to be of much help in this scenario. Given our current
support, in your case it would be best not to add the JPA Facet to your
Dynamic Web Project. You can use Dali in your "Model" project to develop
the entities of course, but we aren't much help once the entities are
packaged in a JAR. This is documented in bug 197069
(https://bugs.eclipse.org/bugs/show_bug.cgi?id=197069). We plan on adding
this support in the next release of Dali (after the upcoming June release).

So for now I would recommend you remove the JPA facet via the project
properties from the Dynamic Web Project to avoid the error messages.

Neil
Previous Topic:Problems with Eclipse Europa and DB2
Next Topic:embedding JPQL in a typesafe manner
Goto Forum:
  


Current Time: Fri Apr 26 02:47:06 GMT 2024

Powered by FUDForum. Page generated in 0.03541 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top