Estou recebendo erro ao anotar a classe com @Transaction:
Estou usando o WildFly com Postgres para Spring MVC, o código está igual ao do curso:
15:48:33,915 WARN [org.springframework.web.context.support.AnnotationConfigWebApplicationContext] (ServerService Thread Pool -- 121) Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'produtosController': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private br.com.daos.ProdutoDAO br.com.controller.ProdutosController.produtoDAO; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'produtoDAO' defined in "/home/notebook-n/wildfly-20.0.1.Final/standalone/deployments/cursoSpring.war/WEB-INF/classes/br/com/daos/ProdutoDAO.class": Initialization of bean failed; nested exception is org.springframework.aop.framework.AopConfigException: Could not generate CGLIB subclass of class [class br.com.daos.ProdutoDAO]: Common causes of this problem include using a final class or a non-visible class; nested exception is org.springframework.cglib.core.CodeGenerationException: java.lang.reflect.InvocationTargetException-->null
Caused by: org.springframework.beans.factory.BeanCreationException: Could not autowire field: private br.com.daos.ProdutoDAO br.com.controller.ProdutosController.produtoDAO; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'produtoDAO' defined in "/home/notebook-n/wildfly-20.0.1.Final/standalone/deployments/cursoSpring.war/WEB-INF/classes/br/com/daos/ProdutoDAO.class": Initialization of bean failed; nested exception is org.springframework.aop.framework.AopConfigException: Could not generate CGLIB subclass of class [class br.com.daos.ProdutoDAO]: Common causes of this problem include using a final class or a non-visible class; nested exception is org.springframework.cglib.core.CodeGenerationException: java.lang.reflect.InvocationTargetException-->null
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'produtoDAO' defined in "/home/notebook-n/wildfly-20.0.1.Final/standalone/deployments/cursoSpring.war/WEB-INF/classes/br/com/daos/ProdutoDAO.class": Initialization of bean failed; nested exception is org.springframework.aop.framework.AopConfigException: Could not generate CGLIB subclass of class [class br.com.daos.ProdutoDAO]: Common causes of this problem include using a final class or a non-visible class; nested exception is org.springframework.cglib.core.CodeGenerationException: java.lang.reflect.InvocationTargetException-->null
Caused by: org.springframework.aop.framework.AopConfigException: Could not generate CGLIB subclass of class [class br.com.daos.ProdutoDAO]: Common causes of this problem include using a final class or a non-visible class; nested exception is org.springframework.cglib.core.CodeGenerationException: java.lang.reflect.InvocationTargetException-->null
Caused by: org.springframework.cglib.core.CodeGenerationException: java.lang.reflect.InvocationTargetException-->null
Caused by: java.lang.LinkageError: loader (instance of org/jboss/modules/ModuleClassLoader): attempted duplicate class definition for name: "br/com/daos/ProdutoDAO$$EnhancerBySpringCGLIB$$1077e15a"