Results 1 to 4 of 4

Thread: dm Server, AspectJ LTW, EclipseLink JPA

  1. #1

    Default dm Server, AspectJ LTW, EclipseLink JPA

    I followed the PetClinic-1.5.0 example in setting up EclipseLink JPA for my persistent layer. I get the error below when lazy fetching is enabled. After multiple forum and web searches, it appears this error is due to a failure in load-time-weaving. Based on this, can I get help with

    1.) How do I enable verbose logging or debug output to help me determine if load-time-weaving has been properly enabled?

    I am using the context namespace configuration <context:load-time-weaver aspectj-weaving="on" />. Also, when not using lazy fetching, the transaction support is working as expected (I assume this also uses load-time-weaving since I configure it with <tx:annotation-driven mode="aspectj" />).

    2.) To ensure that dependencies on com.springsource.org.eclipse.persistence are satisfied, I also use import-scope:=application. Is there any other subtle configuration that I need to make this work in an OSGi environment like dm Server?

    3.) I tried modifying dm Server's startup to include a -javaagent:spring-agent.jar argument; however, my searches have indicated this is really not necessary. This change did not fix the error.

    The relevant exception I believe is

    ---- (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)])

    ----

    Which shows that the _persistence_getcustomer_vh() and _persistence_setcustomer_vh() methods were not automatically weaved into the Job domain object.

    I am using springsource-dm-server-1.0.2.SR02, EclipseLink 1.1.0, AspectJ 1.6.3. I tried upgrading to the latest AspectJ (1.6.6) but I received conflicting package exports with the Spring Library (2.5.6.A).

    Thanks for the help.

    Regards,
    Marshall

  2. #2
    Join Date
    Oct 2008
    Posts
    493

    Default

    Quote Originally Posted by marshallmccain View Post
    1.) How do I enable verbose logging or debug output to help me determine if load-time-weaving has been properly enabled?
    You'll need to edit the server.config file to change the trace level for the package(s) you're interested in. There's some details on this in the user guide.

    I am using the context namespace configuration <context:load-time-weaver aspectj-weaving="on" />. Also, when not using lazy fetching, the transaction support is working as expected (I assume this also uses load-time-weaving since I configure it with <tx:annotation-driven mode="aspectj" />).

    2.) To ensure that dependencies on com.springsource.org.eclipse.persistence are satisfied, I also use import-scope:=application. Is there any other subtle configuration that I need to make this work in an OSGi environment like dm Server?
    No, I believe that should be sufficient

    3.) I tried modifying dm Server's startup to include a -javaagent:spring-agent.jar argument; however, my searches have indicated this is really not necessary. This change did not fix the error.
    dm Server plugs an OSGi-aware implementation of Spring's LoadTimeWeaver into your application context when you configure it to use load-time weaving which negates the need for the spring-agent.

    Let us know how you get on with the debug output and, if you're still having problems, we'll try to take a more detailed look.
    Andy Wilkinson
    SpringSource

  3. #3

    Default

    Andy,

    Thanks for the help. My latest debug output seems to indicate that the weaver is working... at least I see weaving log messages as the transaction aspects are applied. I'm still getting the same error though. I've attached a trace file for you to skim through. Once we determine it is not a problem with the weaver, maybe you can suggest a forum for me to further my investigation.

    BTW, if I turn off LAZY fetching, everything works as expected.

    The following link may be relevant. Is it necessary to enable a OSGi framework extension for JPA weaving to occur?
    http://wiki.eclipse.org/EclipseLink/...ing_is_Working

    This link indicates that byte code weaving is only supported by Eclipse Persistence 1.1.2 (Galileo). The bundle repository only contains up to 1.1.0 from what I can tell.


    Thanks,
    Marshall

    attachment
    Attached Files Attached Files
    Last edited by marshallmccain; Oct 27th, 2009 at 01:37 PM.

  4. #4
    Join Date
    Jun 2008
    Posts
    6

    Default

    Hi marshallmccain,

    I'm currently seeing the same behavior. Did you get to the bottom of this? My transaction weaving is all working fine etc. I only get problems when I try to use lazy fetches. I'm currently using Eclipselink 2.0 on DM Server 2.0.

    Thanks
    Last edited by rukkus; Feb 17th, 2010 at 09:56 AM.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •