I am attempting to get EclipseLink JPA working inside the Spring dm Server OSGi environment.
Relevant frameworks and libraries downloaded from the Spring Enterprise Bundle Repository include:
- dm Server 1.0.2.SR02
- AspectJ Runtime 1.6.3
- AspectJ Weaver 1.6.3
- Spring Framework 2.5.6.A
- Eclipse Persistence 1.1.0
- Javax Persistence API 1.99.0
I followed the same structure as presented in the PetClinic-1.5.0 example for setting up EclipseLink JPA. Everything works until lazy-fetching is enabled (which requires proxied objects).
Once lazy-fetching is enabled, the following error suggests that load-time-weaving is not working correctly.
---- (truncated for readability)
Exception [EclipseLink-60] (Eclipse Persistence Services - 1.1.0.r3634): org.eclipse.persistence.exceptions.DescriptorExcep tion Exception Description: The method [_persistence_setcustomer_vh] or [_persistence_getcustomer_vh] is not defined in the object [net.fractech.fds.backoffice.Job]. Internal Exception: java.lang.NoSuchMethodException: net.fractech.fds.backoffice.Job._persistence_getcu stomer_vh() Mapping: org.eclipse.persistence.mappings.OneToOneMapping[customer] Descriptor: RelationalDescriptor(net.fractech.fds.backoffice.J ob --> [DatabaseTable(JOBS)])
This shows that the _persistence_getcustomer_vh() and _persistence_setcustomer_vh() methods were not automatically weaved into the Job domain object.
Questions
1.) How do I determine if load-time-weaving is actually working; moreover, how do I log which load time weaving agent and weaver was started? How do I pass switches to this weaver to have it output debugging information?
I assume I started load-time-weaving with <context:load-time-weaver aspectj-weaving="on" />
2.) Many searches have revealed that I do not need to pass the -javaagent parameter to the jvm when using dm Server. Is this correct?
3.) I have assured that my domain objects in another bundle have access to the eclipse persistence classes by asserting com.springsource.org.eclipse.persistence;version="[1.1.0,1.1.0]";import-scope:=application in my eclipselink bundle and including all application bundles within a PAR. Are there any other configurations needed to enable EclipseLink JPA in Spring dm Server?