Announcement Announcement Module
No announcement yet.
JpaExceptionTranslatorAspect clashes with PersistenceExceptionTranslationInterceptor Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • JpaExceptionTranslatorAspect clashes with PersistenceExceptionTranslationInterceptor

    Just moved to use CTW with maven-aspect-plugin in order to get better handling on @Transactional.

    I've got failing test because PersistenceExceptionTranslationInterceptor doesn't do its job properly anymore: the exceptions it is supposed to manage get transformed by JpaExceptionTranslatorAspect first, which does a far worse job, and transform the exception into something PersistenceExceptionTranslationInterceptor cannot in turn translate properly anymore.

    Basically, it relies on EntityManagerFactoryUtils to translate and doesn't get into the Dialect impl itself, which knows precisely how to translate.

    Hope I'm making sense for someone here.

    I was hoping to just exclude the Aspect from the CTW with


    in the maven-aspectj-plugin.
    I've tried different matching pattern, but it always get woven.

    Is it because I specify spring-aspects in AspectLibrairies?

    here's my config:


    hope someone can help
    Last edited by Jean; Mar 22nd, 2011, 05:13 AM.

  • #2
    Hi Jean,

    Did you find any solution? I have the same problem. The exclude is ignored by the aspectj maven plugin.
    I played around with the xmlConfigured option but this is not well documented and also worked not for me.

    Anyone else have a solution? The problem is i want to use Compile Time Weaving with eclipse and maven and spring but the the JpaExceptionTranslatorAspect is woven into my classes which i do not want.

    cheers tom


    • #3
      hi tom,

      unfortunately I've given up on CTW because of this problem.
      I started to look into aspectj maven plugin sources to see what I could do to get the exclusion working but ran out of time, and never got back to the problem.

      I was hoping it would get solve with the new releases of the aspectj maven plugin, but if you still have the problem, exclusion is probably still not working for this case.

      Which version of the plugin did you use?


      • #4
        Hi jean,

        I used for everything the latest version spring (3.2), aspectj maven plugin 1.4 ( AspectJ 1.7.2, also tried with 1.6.11.

        Its a pitty that such a "simple" feature like exclude is not working
        I know simple requirement, big change

        Dont have time to hack the aspectj maven plugin. Maybe this is the corresponding issue?

        These are the issues I have found

        As i am new to AspectJ i dont have the whole understanding how Eclipse AJDT, the ajc and the aspectj maven plugin is working together.

        But it seems there is no solution ready yet
        Still have to find a way to prevent Eclipse from using the JpaExceptionTranslatorAspect located in the spring-aspectj-xxx.jar when using CTW

        cheers tom
        Last edited by spring-tom; Apr 3rd, 2013, 11:12 AM.


        • #5
          Also found some interesting JIRA discussion:
          And this discussion:
          Last edited by spring-tom; Apr 3rd, 2013, 12:05 PM.