Question

I am using tomcat as my webserver and would like to use the fetch = FetchType.lazy annotation for all my @OneToOne annotations but spring reverts my lazy settings give me eclipselink warnings :

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.

What do i have to do to tomcat to get weaving working so i can use lazy fetching or is there any other alternatives to lazy load relationships. I am having huge performance problems?

I am now attempting to add loadtime weaving, i have added both spring-instruments.jar and spring-aspects.jar to my tomcat/lib and after adding the global <context:load-time-weaver/> to my applicationContext.xml file, i get an

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
Était-ce utile?

La solution

I would recommend using static weaving instead, see,

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

It is possible to get weaving working in Spring. I would recommend starting with one of the Spring tutorials outside of Tomcat, and slowly add complexity until you have it working inside Tomcat.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top