2

我正在使用 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
4

1 回答 1

1

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

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

可以在春天开始编织工作。我建议从 Tomcat 之外的 Spring 教程之一开始,然后慢慢增加复杂性,直到它在 Tomcat 中运行。

于 2012-07-03T13:07:48.063 回答