circular reference as soon as i put in net/bull/javamelody/monitoring-spring.xml

374 views
Skip to first unread message

logemann

unread,
Apr 5, 2012, 5:54:58 AM4/5/12
to javamelody
I am just on the way setting up javamelody in my spring based java web
app.
As soon as i am inserting net/bull/javamelody/monitoring-spring.xml in
first place in contextConfigLocation, i am getting the stack below
(unneeded stuff removed).

I really cant get into details of all my beans but shouldnt the
inclusion of our custom appContext file be somehow non-intrusive?
Somehow i am hesitant to change my bean definitions because
javamelody, everything is fine.

Thanks for infos.

Marc


Stacktrace....

org.springframework.beans.factory.BeanCreationException: Error
creating bean with name 'ACLDaoImpl': Injection of resource
dependencies failed; nested exception is
org.springframework.beans.factory.BeanCurrentlyInCreationException:
Error creating bean with name 'clientDaoImpl': Bean with name
'clientDaoImpl' has been injected into other beans
[logisticProviderManagerImpl] in its raw version as part of a circular
reference, but has eventually been wrapped. This means that said other
beans do not use the final version of the bean. This is often the
result of over-eager type matching - consider using
'getBeanNamesOfType' with the 'allowEagerInit' flag turned off, for
example.
at
org.springframework.context.annotation.CommonAnnotationBeanPostProcessor.postProcessPropertyValues(CommonAnnotationBeanPostProcessor.java:
300)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:
1074)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:
517)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:
456)
at org.springframework.beans.factory.support.AbstractBeanFactory
$1.getObject(AbstractBeanFactory.java:291)
at
org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:
222)
at
org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:
288)
at
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:
190)
at
org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:
580)
at
org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:
895)
at
org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:
425)
at
org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:
276)
at
org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:
197)
at
org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:
47)
at
org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:
4206)
at
org.apache.catalina.core.StandardContext.start(StandardContext.java:
4705)
at
org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:
799)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:
779)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:
601)
at
org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:
675)
at
org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java:
601)
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:
502)
at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1317)
at
org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:
324)
at
org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:
142)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:
1065)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:840)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:
1057)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:
463)
at
org.apache.catalina.core.StandardService.start(StandardService.java:
525)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:
754)
at org.apache.catalina.startup.Catalina.start(Catalina.java:595)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:
57)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:
43)
at java.lang.reflect.Method.invoke(Method.java:613)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)
Caused by:
org.springframework.beans.factory.BeanCurrentlyInCreationException:
Error creating bean with name 'clientDaoImpl': Bean with name
'clientDaoImpl' has been injected into other beans
[logisticProviderManagerImpl] in its raw version as part of a circular
reference, but has eventually been wrapped. This means that said other
beans do not use the final version of the bean. This is often the
result of over-eager type matching - consider using
'getBeanNamesOfType' with the 'allowEagerInit' flag turned off, for
example.

Vernat Emeric

unread,
Apr 9, 2012, 8:38:54 AM4/9/12
to javam...@googlegroups.com

Hi Marc,

The content of the monitoring-spring.xml file can be seen here:
http://code.google.com/p/javamelody/source/browse/trunk/javamelody-core/src/main/resources/net/bull/javamelody/monitoring-spring.xml

It includes
"org.springframework.aop.framework.autoproxy.DefaultAdvisorAutoProxyCreator"
which is perhaps an issue depending on your configuration.

You may try the simpler monitoring-spring-datasource.xml file (requires
v1.36) or the monitoring-spring-aspectj.xml file, instead of the
monitoring-spring.xml.
http://code.google.com/p/javamelody/source/browse/trunk/javamelody-core/src/main/resources/net/bull/javamelody/monitoring-spring-datasource.xml
http://code.google.com/p/javamelody/source/browse/trunk/javamelody-core/src/main/resources/net/bull/javamelody/monitoring-spring-aspectj.xml

Of course, you can also use javamelody without monitoring-spring.xml, or
you can submit a patch if you think of another solution.

bye,
Emeric


Le 05/04/2012 11:54, logemann a �crit :

Reply all
Reply to author
Forward
0 new messages