So I recently upgraded to STS 2.5.2 and Roo 1.1.1 (from 1.1.0) and had a heckuva day getting my project to work again. I thought I'd share some of the trouble and what I did to fix it so that any googling out there might stumble across this.
My biggest issue was that exception translation was dead. It was evidenced by this type of warning for every entity in my domain:
Now, supposedly, this shouldn't have been an issue, but it was. I found some threads that said I needed to have "Outxml" checked under the Aspect Compiler -> Other section of my project settings. However, it was already checked. Took me a while, but I finally figured out a "fix," which was to create a file named aop.xml and put it in src/main/resources/META-INF with this content:Code:error aspect 'org.springframework.orm.jpa.aspectj.JpaExceptionTranslatorAspect' woven into 'com.foo.domain.SomeEntity' must be defined to the weaver (placed on the aspectpath, or defined in an aop.xml file if using LTW).
Oh, the other aspect mentioned in that block was also giving me similar warnings in my log.Code:<aspectj> <aspects> <aspect name="org.springframework.mock.staticmock.AnnotationDrivenStaticEntityMockingControl"/> <aspect name="org.springframework.orm.jpa.aspectj.JpaExceptionTranslatorAspect"/> </aspects> </aspectj>
I hope this helps someone in desperate need to get back to a productive day. I'm not sure why moving from Roo 1.1.0 to Roo 1.1.1 caused this problem. If anyone has any insight into the root cause, please do post.


Reply With Quote
But, I will say that I am still using AspectJ 1.6.10 with Roo 1.1.1. (In other words, I did not upgrade AspectJ when upgrading Roo.) Maybe I will give 1.6.11.M1 a shot. An aop-ajc.xml is indeed being created but with no entry for either JpaExceptionTranslatorAspect or AnnotationDrivenStaticEntityMockingControl. All the other Roo aspects, however, are in that generated file. Here is the aop.xml file that is packaged within sprint-aspects-3.0.5.jar: