http://blog.csdn.net/seuxiaoqi/article/details/6003549
应用启动tomcat时报错:
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'commonProcessBean': Autowiring of fields failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private com.taobao.relationrecommend.biz.ao.RecommendCollection com.taobao.relationrecommend.biz.util.share.CommonProcessBean.recommendCollection; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'recommendCollection' defined in class path resource [biz/csk-relationrecommend.xml]: Cannot resolve reference to bean 'i2i023' while setting bean property 'initDaoBean' with key [0]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'i2i023': Autowiring of fields failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: com.taobao.relationrecommend.biz.bo.csk.CollectItemRecommendManager com.taobao.relationrecommend.biz.dao.Item2Item023.collectItemRecommendManager; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'collectitem': Autowiring of fields failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: protected com.taobao.relationrecommend.biz.util.ItemLoader com.taobao.relationrecommend.biz.bo.csk.CollectItemRecommendManager.itemLoader; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'itemLoader': Autowiring of fields failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private com.taobao.forest.service.StdCategoryServices com.taobao.relationrecommend.biz.util.ItemLoader.stdCategoryServices; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'forestServices' defined in class path resource [biz/forest-relationrecommend-client.xml]: Invocation of init method failed; nested exception is java.lang.StackOverflowError
解决办法:
Windows下在catalina.bat最前面加入
set JAVA_OPTS=-server -Xmx1152M -Xms1152M -Xmn512M -XX:PermSize=300M -XX:MaxPermSize=300M -Xss1024K -XX:+DisableExplicitGC -XX:SurvivorRatio=1 -XX:+UseConcMarkSweepGC -XX:+UseParNewGC -XX:+CMSParallelRemarkEnabled -XX:+UseCMSCompactAtFullCollection -XX:CMSFullGCsBeforeCompaction=0 -XX:+CMSClassUnloadingEnabled -XX:LargePageSizeInBytes=128M -XX:+UseFastAccessorMethods -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=d:/tmp/log/jvm/java.hprof -verbose:gc -Xloggc:d:/tmp/log/jvm/gc.log -XX:+PrintGCDetails -XX:+PrintGCDateStamps