I have Grails test:
class GormTests extends GroovyTestCase {
static transactional = false
...
}
I’m trying to mark method as transactional by org.springframework.transaction.annotation.Transactional annotation but following exception arises:
org.springframework.aop.framework.AopConfigException: Could not generate CGLIB subclass of class [class GormTests]: Common causes of this problem include using a final class or a non-visible class; nested exception is net.sf.cglib.core.CodeGenerationException: java.lang.reflect.InvocationTargetException-->null
How can I fix it?
@Transactionalis only for Spring beans – test classes aren’t beans. Your best bet is to split the test class into two, one with non-transactional tests and one with.