|
From: Adrian C. <adr...@in...> - 2006-05-04 09:36:41
|
Could this also explain the log warning you were seeing? > Why do I get this log warning? > > 2006-05-03 15:09:06,004 [] [] [] WARN [ BeanFactory has not be set on > [org.springframework.beans.factory.aspectj.AnnotationBeanConfigurerAsp=20= > ect]: > Make sure this configurer runs in a Spring container. For example, add > it to a Spring application context as an XML bean definition. ] at > org.springframework.beans.factory.wiring.BeanConfigurerSupport.configu=20= > reBean(BeanConfigurerSupport.java:89) > If the new operator was called before Spring was initialized, the =20 aspect would try to inject the new object, but fail because Spring =20 won't yet have configured the aspect itself. The reason it is a warning rather than an error is that this allows =20 for independent testing of the domain objects without Spring around. > Using loadtime weaving and a weaver option in aop.xml setup to just > weave one package with 6 files in it, startup time with tomcat goes > from 22s to 42s... is this normal? That doesn't totally surprise me. There is a *lot* more work going on =20= when you load-time weave than when you simply load an existing class. =20= The whole aspect weaver has to be fired up, byte codes loaded into =20 memory and examined, then possibly transformed before being defined. =20 We're continually working on ways to reduce LTW footprint and weave =20 times (AspectJ 1.5.1 is better than 1.5.0 in this regard, and we have =20= more to do in 1.5.2), but LTW will always be more expensive than =20 straight class loading. Regards, Adrian. On 4 May 2006, at 10:00, Magnus Heino wrote: >> It's not being injected. Why? > > Ok, I found out about this one. Spring was not initialized by the time > the new operator was called the first time, so there was nothing to > inject. The explicit <bean> declaration made spring create an instance > when there was something to inject. > > -- > > /Magnus Heino > > > ------------------------------------------------------- > Using Tomcat but need to do more? Need to support web services, =20 > security? > Get stuff done quickly with pre-integrated technology to make your =20 > job easier > Download IBM WebSphere Application Server v.1.0.1 based on Apache =20 > Geronimo > http://sel.as-us.falkag.net/sel?cmd=3Dlnk&kid=120709&bid&3057&dat=121642= > _______________________________________________ > Springframework-developer mailing list > Spr...@li... > https://lists.sourceforge.net/lists/listinfo/springframework-developer -- Adrian adr...@in... |