Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [eclipselink-users] How to use EclipseLink Native API with JPA

Please include the full stack trace for the exception.

In general every JPA provider that I know of does some form of byte-code
weaving or dynamic subclass generation (OpenJPA and Hibernate require this). 
EclipseLink is the only provider that I know of where this is optional, as
you can turn weaving off with EclipseLink and still run (lazy relationship
just become eager).  I have never had any issues with debugging weaved
classes, the main issues is getting it to work in environments that don't
let you use an agent, but for these cases you can use static weaving.



gsilverman wrote:
> 
> I appreciate all the replies, but when I try to use Eclipselink sessions
> and unitOfWork to create or modify a managed entity, I get the following
> error:
> 
> Local Exception Stack: 
> Exception [EclipseLink-7009] (Eclipse Persistence Services - 1.0 (Build
> 1.0 - 20080707)): org.eclipse.persistence.exceptions.ValidationException
> Exception Description: Missing descriptor for [class java.lang.Class]. 
> Verify that the descriptor has been properly registered with the Session.
> 
> I can get sessions and acquire unitOfWork from the JPA EntityManager, and
> I can even query for entities without any problem. However, when I try to
> use transactions and call commit on a session or unitOfWork, I get the
> error noted above.
> 
> This leads me to believe you can't use EclipseLink extensions using just
> persistence.xml, annotations and orm to describe your persistence
> entities. It seems you also have to use sessions.xml and project.xml and
> Eclipselink descriptor files - an XML nightmare I'd rather avoid. Is the
> documentation wrong on this?
> 
> As for the issue of weaving, if the JPA spec already includes the
> capability for lazy loading of entities, why is weaving necessary if
> Eclipselink is my persistence provider? Is this true of other persistence
> providers? I don't recall ever having to use it for the original TopLink
> implementation in Java EE. I don't believe it's required for OpenJPA or
> Hibernate, either. Weaving seems to me to be a serious problem for
> developers, since it modifies original code, with who-knows-what side
> affects, and makes debugging practically impossible.
> 
> Maybe it's a Spring thing?
> 


-----
---
http://wiki.eclipse.org/User:James.sutherland.oracle.com James Sutherland 
http://www.eclipse.org/eclipselink/
 EclipseLink ,  http://www.oracle.com/technology/products/ias/toplink/
TopLink 
Wiki:  http://wiki.eclipse.org/EclipseLink EclipseLink , 
http://wiki.oracle.com/page/TopLink TopLink 
Forums:  http://forums.oracle.com/forums/forum.jspa?forumID=48 TopLink , 
http://www.nabble.com/EclipseLink-f26430.html EclipseLink 
Book:  http://en.wikibooks.org/wiki/Java_Persistence Java Persistence 
-- 
View this message in context: http://www.nabble.com/How-to-use-EclipseLink-Native-API-with-JPA-tp19761716p19839500.html
Sent from the EclipseLink - Users mailing list archive at Nabble.com.



Back to the top