gpt4 book ai didi

tomcat中的javaagent错误

转载 作者:行者123 更新时间:2023-11-28 23:30:40 28 4
gpt4 key购买 nike

错误:

 SEVERE: Exception sending context initialized event to listener instance 
of class org.springframework.web.context.ContextLoaderListener

org.springframework.beans.factory.BeanCreationException: Error creating
bean with name
'org.springframework.context.weaving.AspectJWeavingEnabler#0':
Initialization of bean failed; nested exception is
org.springframework.beans.factory.BeanCreationException: Error creating
bean with name 'loadTimeWeaver': Initialization of bean failed; nested
\exception is 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

但是我的 tomcat VM 参数中有 javaagent

 -Dext.prop.dir="/home/gopi/Desktop/REST_CONFIG" -javaagent:/home/gopi/.m2
/repository/org/springframework/spring-agent/2.5.6/spring-agent-
2.5.6.jar -Dcatalina.base="/opt/apache-tomcat-7.0.62"
-Dcatalina.home="/opt/apache-tomcat-7.0.62" -Dwtp.deploy="/opt/apache-
tomcat-7.0.62/wtpwebapps" -Djava.endorsed.dirs="/opt/apache-tomcat-
7.0.62/endorsed"

-Dext.prop.dir 和-javaagent 是我添加的,其余是默认的。我该如何解决这个问题?有什么想法吗?

最佳答案

我想您需要在下面给出指定要使用的 loadTimeWeaver。参见 here了解详情。

 <context:load-time-weaver
weaver-class="org.springframework.instrument.classloading.ReflectiveLoadTimeWeaver"/>

</beans>

关于tomcat中的javaagent错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30612220/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com