Issue 1:
Andriy Rosa opened SPR-9819 and commented

For each method invocation for not-singleton scope bean

Interceptor got bean from bean-factory by using AbstractBeanFactory.getBean

But before getting required bean inside method getBean we have cheeking

Object sharedInstance = getSingleton(beanName);

if (sharedInstance != null && args == null) {

Inside getSingleton we have synchronized blocks.

considering that in high-load project we can have a lot of scoped-beans methods invocations, getSingleton lock all threads, and performance gone to very poor.

I'm not very good in spring-core architecture, however by my mean the most obvious solution - it push into args argument of getBean method specific arg, which will show, that we request not singleton bean for sure

P.S.: Take my apologies for my bad English.

Affects: 3.1.1

Issue Links:

#10033 Threads bottlenecking in DefaultSingletonBeanRegistry when using Wicket's @SpringBean annotation for injection ("is duplicated by")

#13117 Performance bottleneck and potential thread deadlock in DefaultSingletonBeanRegistry

#14414 AbstractBeanFactory#markBeanAsCreated performance issue due to lock contention

#15302 DefaultSingletonBeanRegistry::getSingleton(String beanName) attempts to create bean when it shouldn't

#16864 Further locking optimizations for the retrieval of non-singleton beans

0 votes, 5 watchers

Issue 2:
Jing Xue opened SPR-3273 and commented

After upgrading from 2.0.2 to 2.0.3, I'm getting the following exception during the loading of every context file, because my app doesn't use groovy. I know they are harmless and ignored, but it would be nice if DefaultNamespaceHandlerResolver could just not log the whole stack trace.

02:21:58,130 DEBUG [main] org.springframework.beans.factory.xml.DefaultNamespaceHandlerResolver - Ignoring handler [org.springframework.scripting.config.LangNamespaceHandler]: problem with class file or dependent class

java.lang.NoClassDefFoundError: org/codehaus/groovy/control/CompilationFailedException

at java.lang.Class.forName0(Native Method)

at java.lang.Class.forName(Class.java:169)

at org.springframework.scripting.config.LangNamespaceHandler.class$(LangNamespaceHandler.java:45)

at org.springframework.scripting.config.LangNamespaceHandler.init(LangNamespaceHandler.java:45)

at org.springframework.beans.factory.xml.DefaultNamespaceHandlerResolver.initHandlerMappings(DefaultNamespaceHandlerResolver.java:123)

at org.springframework.beans.factory.xml.DefaultNamespaceHandlerResolver.<init>(DefaultNamespaceHandlerResolver.java:96)

at org.springframework.beans.factory.xml.DefaultNamespaceHandlerResolver.<init>(DefaultNamespaceHandlerResolver.java:82)

at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.createDefaultNamespaceHandlerResolver(XmlBeanDefinitionReader.java:489)

at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.createReaderContext(XmlBeanDefinitionReader.java:478)

at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.registerBeanDefinitions(XmlBeanDefinitionReader.java:458)

at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:353)

at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:303)

at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:280)

at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:131)

at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:147)

at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:124)

at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:92)

at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:100)

at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:298)

at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:241)

at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:184)

at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:49)

Affects: 2.0.3

Issue Links:

#7935 LangNamespaceHandler cannot be registered in DefaultNamespaceHandlerResolver when thrid party library is not found ("duplicates")