[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.rt.eclipselink] Re: Unknown entity type

James пишет:
This is an odd error, it seems your classpath may be corrupt, or have issues. Are you in a basic JSE environment, or are you using something like Spring or OSGI?

no additional frameworks


EclipseLink 2.0 has been extensively tested in a JSE environment, so there is something wrong with your configuration. Is your persistence unit in a jar? It should be deployed in a jar with the persistence.xml in the META-INF directory and the entity classes inside their correct packages in the jar.

Yes persistence.xml is in jar in META-INF and entity classes also. As packaging shouldn't change after switch to other providers and switch to el 1.1.2 also and in case of other providers all woks fine in exactrly the same project, also Eclipse first log message about successful login to persistence unit before fail on Entity class.



Your error says, "select object(o) from DiscountCode as o"

there may be some issues in named queries, I don't use them in my application, I can list my code which use my entity also, see attached project (without libraries attached, need derbyclient.jar, eclipselink.jar, javax.persistence.jar(jpa 2.0)) with libraries it should be enough to use
'ant run'
from command line. or I can attach built project (approx 5M).



But your code has, "SELECT d FROM DiscountCode d"

So it seems your have your classes on the classpath twice, or something is corrupt in your environment.
may some class be duplicated in eclipselink.jar and javax.persistence.jar(2.0)? I see there are same javax.persistence.* packages in both but don't know if there are duplicated in classes.


Perhaps try one of the EclipseLink examples first.
will look tomorrow, also will try to reverify what I wrote above.


--- James



Attachment: JavaApplication5.zip
Description: Zip compressed data