gpt4 book ai didi

tomcat - Spring 框架 Tomcat LoadTimeWeaving

转载 作者:行者123 更新时间:2023-11-28 22:00:24 26 4
gpt4 key购买 nike

我正在使用 tomcat 作为我的网络服务器,并且想使用 fetch = FetchType.lazy我所有@OneToOne 注释的注释,但 spring 恢复了我的惰性设置,给我 eclipselink 警告:

Reverting the lazy setting on the OneToOne or ManyToOne attribute [student] for the entity class [class org.bixin.dugsi.domain.Registration] since weaving was not enabled or did not occur.

我必须对 tomcat 做些什么才能使编织工作,以便我可以使用延迟获取或者是否有任何其他替代延迟加载关系的方法。我遇到了巨大的性能问题?

我现在正尝试添加加载时织入,我已将 spring-instruments.jar 和 spring-aspects.jar 添加到我的 tomcat/lib 并在添加全局 <context:load-time-weaver/> 之后到我的 applicationContext.xml 文件,我得到一个

ClassLoader [sun.misc.Launcher$AppClassLoader] does NOT provide an 'addTransformer(ClassFileTransformer)' method. Specify a custom LoadTimeWeaver or start your Java virtual machine with Spring's agent: -javaagent:org.springframework.instrument.jar

最佳答案

我建议改用静态编织,看,

http://wiki.eclipse.org/EclipseLink/UserGuide/JPA/Advanced_JPA_Development/Performance/Weaving/Static_Weaving

可以在 Spring 中进行织入。我建议从 Tomcat 之外的 Spring 教程之一开始,然后慢慢增加复杂性,直到您可以在 Tomcat 中使用它。

关于tomcat - Spring 框架 Tomcat LoadTimeWeaving,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11302732/

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