我想做的事:
我所做的:
不起作用的是:
其他资料:
我想知道的是:
* Tomcat 6启动时的例外情况:
Caused by: java.lang.IllegalStateException: ClassLoader [org.apache.catalina.loader.WebappClassLoader] does NOT provide an 'addTransformer(ClassFileTransformer)' method. Specify a custom LoadTimeWeaver or start your Java virtual machine with Spring's agent: -javaagent:spring-agent.jar
at org.springframework.context.weaving.DefaultContextLoadTimeWeaver.setBeanClassLoader(DefaultContextLoadTimeWeaver.java:82)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1322)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:473)
... 41 more发布于 2009-06-08 22:10:39
您是否在项目的方面路径中添加了spring-aspects.jar?
在项目属性中,在'AspectJ Build‘->’方面路径‘下,尝试添加Springaspects.jar并清理项目构建。
抱歉,你可能已经这么做了-但你没提。
发布于 2009-06-10 18:56:01
编译时编织似乎不起作用。尝试将下面的行添加到applicationcontext.xml中
<context:load-time-weaver />
<context:spring-configured/>您可能还希望将以下xsd添加到xml文件中
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-2.5.xsd
有关详情,请参阅:
http://static.springframework.org/spring/docs/2.5.x/reference/aop.html#aop-aj-ltw
发布于 2009-06-26 05:58:19
您可以在不使用AspectJ的情况下使用@Transactional。您的配置文件应该包含如下内容以使其工作:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:tx="http://www.springframework.org/schema/tx"
xmlns:util="http://www.springframework.org/schema/util"
xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop-2.0.xsd
http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx-2.0.xsd
http://www.springframework.org/schema/util
http://www.springframework.org/schema/util/spring-util-2.5.xsd"
>
<tx:annotation-driven/>告诉spring在创建配置bean的实例时查找@事务性注释。在找到这样的注释后,spring会向应用程序代码返回bean的一个动态代理。这个动态代理确保每当调用带注释的方法时,spring都能够拦截它以提供预期的事务行为。但是基于代理的AOP要求您根据接口而不是具体的类编写代码。
https://stackoverflow.com/questions/967143
复制相似问题