creating shiroFilter faild - spring-mvc

When I added Shiro to my project, it encounters a problem that said creating shiroFilter failed.
The following is my error log.
严重: Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'shiroFilter' defined in class path resource [applicationContext.xml]: Cannot resolve reference to bean 'securityManager' while setting bean property 'securityManager'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'securityManager' defined in class path resource [applicationContext.xml]: Cannot resolve reference to bean 'myShiroRealm' while setting bean property 'realm'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'myShiroRealm': Injection of resource dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'realmService': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private ccu.springDataDao.system.UserInfoRepo ccu.service.RealmServiceImpl.userInfoRepo; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [ccu.springDataDao.system.UserInfoRepo] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {#org.springframework.beans.factory.annotation.Autowired(required=true)}
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:336)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:108)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1456)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1197)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:537)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:475)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:304)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:228)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:300)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:200)
at org.springframework.context.support.PostProcessorRegistrationDelegate.registerBeanPostProcessors(PostProcessorRegistrationDelegate.java:232)
at org.springframework.context.support.AbstractApplicationContext.registerBeanPostProcessors(AbstractApplicationContext.java:618)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:467)
at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:403)
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:306)
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:106)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4772)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5196)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1409)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1399)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'securityManager' defined in class path resource [applicationContext.xml]: Cannot resolve reference to bean 'myShiroRealm' while setting bean property 'realm'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'myShiroRealm': Injection of resource dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'realmService': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private ccu.springDataDao.system.UserInfoRepo ccu.service.RealmServiceImpl.userInfoRepo; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [ccu.springDataDao.system.UserInfoRepo] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {#org.springframework.beans.factory.annotation.Autowired(required=true)}
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:336)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:108)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1456)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1197)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:537)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:475)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:304)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:228)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:300)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:195)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:328)
... 24 more
And this is Shiro setup:
<bean id="shiroFilter" class="org.apache.shiro.spring.web.ShiroFilterFactoryBean">
<property name="securityManager" ref="securityManager"/>
<property name="filters">
<map><entry key="authc" value-ref="formAuthenticationFilter"/></map>
</property>
<property name="filterChainDefinitions">
<value>
/LoginCtr/**=anon
/areaMessagectr/**=authc
/checkcepairplanctr/**=authc
/acceptancectr/**=authc
/schedulectr/**=authc
/maintenance/**=authc
/maintenanceapplicationctr/**=authc
/postmaintenanceplanctr/**=authc
</value>
</property>
</bean>

Related

Spring ShedLock in xml based configuration

I've a legacy code base and need to implement Spring Shedlock
I found many article like shedlock-spring but my scheduler is already written in xml configuration.
<task:scheduled-tasks scheduler="guiSchedular">
<task:scheduled ref="guiSchedularBean" method="fetchData" fixed-delay="60000" />
</task:scheduled-tasks>
<task:scheduler id="guiSchedular"/>
How can I use below annotations in xml
#EnableScheduling
#EnableSchedulerLock(defaultLockAtMostFor = "1000")
#Scheduled(fixedDelayString = "1000")
#SchedulerLock(name = "scheduledTaskName", lockAtMostFor = "1000", lockAtLeastFor = "1000")
having exception when adding this annotation:
#EnableSchedulerLock(defaultLockAtMostFor = "PT30S")
SEVERE: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.context.event.internalEventListenerProcessor': Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.transaction.config.internalTransactionAdvisor': Cannot resolve reference to bean 'org.springframework.transaction.annotation.AnnotationTransactionAttributeSource#0' while setting bean property 'transactionAttributeSource'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.transaction.annotation.AnnotationTransactionAttributeSource#0': Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'proxyScheduledLockAopBeanPostProcessor' defined in class path resource [net/javacrumbs/shedlock/spring/aop/MethodProxyLockConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [net.javacrumbs.shedlock.spring.aop.MethodProxyScheduledLockAdvisor]: Factory method 'proxyScheduledLockAopBeanPostProcessor' threw exception; nested exception is java.lang.NoSuchMethodError: org.springframework.aop.support.annotation.AnnotationMatchingPointcut.<init>(Ljava/lang/Class;Ljava/lang/Class;Z)V
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:564)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:483)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:761)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:866)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:542)
at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:443)
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:325)
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:107)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3972)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4467)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:722)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
at org.apache.catalina.core.StandardService.start(StandardService.java:516)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
at org.apache.catalina.startup.Catalina.start(Catalina.java:593)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
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.BeanCreationException: Error creating bean with name 'org.springframework.transaction.config.internalTransactionAdvisor': Cannot resolve reference to bean 'org.springframework.transaction.annotation.AnnotationTransactionAttributeSource#0' while setting bean property 'transactionAttributeSource'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.transaction.annotation.AnnotationTransactionAttributeSource#0': Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'proxyScheduledLockAopBeanPostProcessor' defined in class path resource [net/javacrumbs/shedlock/spring/aop/MethodProxyLockConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [net.javacrumbs.shedlock.spring.aop.MethodProxyScheduledLockAdvisor]: Factory method 'proxyScheduledLockAopBeanPostProcessor' threw exception; nested exception is java.lang.NoSuchMethodError: org.springframework.aop.support.annotation.AnnotationMatchingPointcut.<init>(Ljava/lang/Class;Ljava/lang/Class;Z)V
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:359)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:108)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1531)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1276)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:553)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:483)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202)
at org.springframework.aop.framework.autoproxy.BeanFactoryAdvisorRetrievalHelper.findAdvisorBeans(BeanFactoryAdvisorRetrievalHelper.java:92)
at org.springframework.aop.framework.autoproxy.AbstractAdvisorAutoProxyCreator.findCandidateAdvisors(AbstractAdvisorAutoProxyCreator.java:102)
at org.springframework.aop.framework.autoproxy.AbstractAdvisorAutoProxyCreator.findEligibleAdvisors(AbstractAdvisorAutoProxyCreator.java:88)
at org.springframework.aop.framework.autoproxy.AbstractAdvisorAutoProxyCreator.getAdvicesAndAdvisorsForBean(AbstractAdvisorAutoProxyCreator.java:70)
at org.springframework.aop.framework.autoproxy.AbstractAutoProxyCreator.wrapIfNecessary(AbstractAutoProxyCreator.java:346)
at org.springframework.aop.framework.autoproxy.AbstractAutoProxyCreator.postProcessAfterInitialization(AbstractAutoProxyCreator.java:298)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsAfterInitialization(AbstractAutowireCapableBeanFactory.java:423)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1633)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:555)
... 26 more
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.transaction.annotation.AnnotationTransactionAttributeSource#0': Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'proxyScheduledLockAopBeanPostProcessor' defined in class path resource [net/javacrumbs/shedlock/spring/aop/MethodProxyLockConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [net.javacrumbs.shedlock.spring.aop.MethodProxyScheduledLockAdvisor]: Factory method 'proxyScheduledLockAopBeanPostProcessor' threw exception; nested exception is java.lang.NoSuchMethodError: org.springframework.aop.support.annotation.AnnotationMatchingPointcut.<init>(Ljava/lang/Class;Ljava/lang/Class;Z)V
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:564)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:483)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:351)
... 44 more
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'proxyScheduledLockAopBeanPostProcessor' defined in class path resource [net/javacrumbs/shedlock/spring/aop/MethodProxyLockConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [net.javacrumbs.shedlock.spring.aop.MethodProxyScheduledLockAdvisor]: Factory method 'proxyScheduledLockAopBeanPostProcessor' threw exception; nested exception is java.lang.NoSuchMethodError: org.springframework.aop.support.annotation.AnnotationMatchingPointcut.<init>(Ljava/lang/Class;Ljava/lang/Class;Z)V
at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:599)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1173)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1067)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:513)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:483)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202)
at org.springframework.aop.framework.autoproxy.BeanFactoryAdvisorRetrievalHelper.findAdvisorBeans(BeanFactoryAdvisorRetrievalHelper.java:92)
at org.springframework.aop.framework.autoproxy.AbstractAdvisorAutoProxyCreator.findCandidateAdvisors(AbstractAdvisorAutoProxyCreator.java:102)
at org.springframework.aop.framework.autoproxy.AbstractAdvisorAutoProxyCreator.findEligibleAdvisors(AbstractAdvisorAutoProxyCreator.java:88)
at org.springframework.aop.framework.autoproxy.AbstractAdvisorAutoProxyCreator.getAdvicesAndAdvisorsForBean(AbstractAdvisorAutoProxyCreator.java:70)
at org.springframework.aop.framework.autoproxy.AbstractAutoProxyCreator.wrapIfNecessary(AbstractAutoProxyCreator.java:346)
at org.springframework.aop.framework.autoproxy.AbstractAutoProxyCreator.postProcessAfterInitialization(AbstractAutoProxyCreator.java:298)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsAfterInitialization(AbstractAutowireCapableBeanFactory.java:423)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1633)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:555)
... 50 more
Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [net.javacrumbs.shedlock.spring.aop.MethodProxyScheduledLockAdvisor]: Factory method 'proxyScheduledLockAopBeanPostProcessor' threw exception; nested exception is java.lang.NoSuchMethodError: org.springframework.aop.support.annotation.AnnotationMatchingPointcut.<init>(Ljava/lang/Class;Ljava/lang/Class;Z)V
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:189)
at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:588)
... 67 more
Caused by: java.lang.NoSuchMethodError: org.springframework.aop.support.annotation.AnnotationMatchingPointcut.<init>(Ljava/lang/Class;Ljava/lang/Class;Z)V
at net.javacrumbs.shedlock.spring.aop.MethodProxyScheduledLockAdvisor.methodPointcutFor(MethodProxyScheduledLockAdvisor.java:47)
at net.javacrumbs.shedlock.spring.aop.MethodProxyScheduledLockAdvisor.<init>(MethodProxyScheduledLockAdvisor.java:36)
at net.javacrumbs.shedlock.spring.aop.MethodProxyLockConfiguration.proxyScheduledLockAopBeanPostProcessor(MethodProxyLockConfiguration.java:36)
at net.javacrumbs.shedlock.spring.aop.MethodProxyLockConfiguration$$EnhancerBySpringCGLIB$$5ebf9881.CGLIB$proxyScheduledLockAopBeanPostProcessor$0(<generated>)
at net.javacrumbs.shedlock.spring.aop.MethodProxyLockConfiguration$$EnhancerBySpringCGLIB$$5ebf9881$$FastClassBySpringCGLIB$$34f58626.invoke(<generated>)
at org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:228)
at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:358)
at net.javacrumbs.shedlock.spring.aop.MethodProxyLockConfiguration$$EnhancerBySpringCGLIB$$5ebf9881.proxyScheduledLockAopBeanPostProcessor(<generated>)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:162)
... 68 more
ShedLock supported XML configuration up to version 2.6.0. If you really can't use Java configuration (I wonder why) you can get the old version and find the documentation in Git history.

OpenJDK11 and JiBX

Why do I get error below using OpenJDK11, Spring 5.2.3 and JiBX bcel-6.4.1.jar, jibx-bind-1.1.6.jar, jibx-run-1.1.6.jar
Invocation of init method failed; nested exception is java.lang.VerifyError: Expecting a stackmap frame at branch target 20
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'crossSearchSessionFacade' defined in ServletContext resource [/WEB-INF/config/gis/spring/spring-business-layer.xml]: Cannot resolve reference to bean 'mlSearchSessionFacade' while setting bean property 'mlSearchSessionFacade'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'mlSearchSessionFacade' defined in ServletContext resource [/WEB-INF/config/gis/spring/spring-business-layer.xml]: Cannot resolve reference to bean 'configurationSessionFacade' while setting bean property 'configurationSessionFacade'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'configurationSessionFacade' defined in ServletContext resource [/WEB-INF/config/gis/spring/spring-business-layer.xml]: Cannot resolve reference to bean 'gisSaleableUnitsConfigurationService' while setting bean property 'gisSaleableUnitsConfigurationService'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'gisSaleableUnitsConfigurationService' defined in ServletContext resource [/WEB-INF/config/gis/spring/spring-business-layer.xml]: Cannot resolve reference to bean 'jibxSaleableUnitsConfigUnmarshaller' while setting bean property 'jibxSaleableUnitsConfigUnmarshaller'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'jibxSaleableUnitsConfigUnmarshaller' defined in ServletContext resource [/WEB-INF/config/gis/spring/spring-business-layer.xml]: Invocation of init method failed; nested exception is java.lang.VerifyError: Expecting a stackmap frame at branch target 20
Exception Details:
Location:
com/proquest/business/configuration/datamodel/saleableunit/GisSaleableUnitsCollection.JiBX_Proquest_Business_binding_unmarshal_1_0(Lorg/jibx/runtime/impl/UnmarshallingContext;)Lcom/proquest/business/configuration/datamodel/saleableunit/GisSaleableUnitsCollection; #12: ifnonnull
Reason:
Expected stackmap frame at this location.
Bytecode:
0000000: 2b2a b600 c52a 2a2a b400 3459 c700 0857
0000010: 2bb8 00ca 2bb8 00ce b500 342b b600 d12a
0000020: b0
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:342)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:113)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1699)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1444)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:594)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:517)
at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:323)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:321)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:879)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:878)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:550)
at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:401)
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:292)
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:103)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4685)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5146)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1384)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1374)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
at java.base/java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:140)
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:909)
at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:841)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1384)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1374)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
at java.base/java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:140)
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:909)
at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:262)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.core.StandardService.startInternal(StandardService.java:421)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:930)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.startup.Catalina.start(Catalina.java:633)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:343)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:474)
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'mlSearchSessionFacade' defined in ServletContext resource [/WEB-INF/config/gis/spring/spring-business-layer.xml]: Cannot resolve reference to bean 'configurationSessionFacade' while setting bean property 'configurationSessionFacade'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'configurationSessionFacade' defined in ServletContext resource [/WEB-INF/config/gis/spring/spring-business-layer.xml]: Cannot resolve reference to bean 'gisSaleableUnitsConfigurationService' while setting bean property 'gisSaleableUnitsConfigurationService'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'gisSaleableUnitsConfigurationService' defined in ServletContext resource [/WEB-INF/config/gis/spring/spring-business-layer.xml]: Cannot resolve reference to bean 'jibxSaleableUnitsConfigUnmarshaller' while setting bean property 'jibxSaleableUnitsConfigUnmarshaller'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'jibxSaleableUnitsConfigUnmarshaller' defined in ServletContext resource [/WEB-INF/config/gis/spring/spring-business-layer.xml]: Invocation of init method failed; nested exception is java.lang.VerifyError: Expecting a stackmap frame at branch target 20
Exception Details:

'java.lang.IllegalStateException: A ServletContext is required to access the javax.websocket.server.ServerContainer instance' Error occurs

I have this error when run junit test in spring mvc project.
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'createWebSocketContainer' defined in net.ebaolife.tpa.websocket.WebSocketConfig: Invocation of init method failed; nested exception is java.lang.IllegalStateException: A ServletContext is required to access the javax.websocket.server.ServerContainer instance
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1583)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:545)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:482)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:732)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:861)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:541)
at org.springframework.test.context.support.AbstractGenericContextLoader.loadContext(AbstractGenericContextLoader.java:128)
at org.springframework.test.context.support.AbstractGenericContextLoader.loadContext(AbstractGenericContextLoader.java:60)
at org.springframework.test.context.support.AbstractDelegatingSmartContextLoader.delegateLoading(AbstractDelegatingSmartContextLoader.java:108)
at org.springframework.test.context.support.AbstractDelegatingSmartContextLoader.loadContext(AbstractDelegatingSmartContextLoader.java:251)
at org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContextInternal(DefaultCacheAwareContextLoaderDelegate.java:98)
at org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContext(DefaultCacheAwareContextLoaderDelegate.java:116)
... 24 more
Caused by: java.lang.IllegalStateException: A ServletContext is required to access the javax.websocket.server.ServerContainer instance
at org.springframework.util.Assert.state(Assert.java:392)
at org.springframework.web.socket.server.standard.ServletServerContainerFactoryBean.afterPropertiesSet(ServletServerContainerFactoryBean.java:102)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1642)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1579)
... 39 more
I have add below jar. And spring version is 4.3.3.RELEASE
<dependency>
<groupId>org.apache.tomcat.embed</groupId>
<artifactId>tomcat-embed-websocket</artifactId>
<version>8.0.28</version>
<scope>test</scope>
</dependency>
I found this bug in spring forum https://jira.spring.io/browse/SPR-14367.
But it only provided a workaround in spring boot, and it says it is fixed in spring 4.3.1 .
Test class is :
#RunWith(SpringJUnit4ClassRunner.class)
#ContextConfiguration({ "classpath*:applicationContext*.xml" })
public class Test {
...
}
In test class add annotation #WebAppConfiguration, this error is gone.

Arquillian Test

I am getting the following exception:
org.jboss.arquillian.container.spi.client.container.DeploymentException: Cannot deploy: test.war
at org.jboss.as.arquillian.container.ArchiveDeployer.deployInternal(ArchiveDeployer.java:83)
...
at org.jboss.arquillian.junit.Arquillian.run(Arquillian.java:166)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:675)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192)Caused by: java.lang.Exception: {"JBAS014671: Failed services" => {"jboss.deployment.unit.\"test.war\".WeldStartService" => "org.jboss.msc.service.StartException in service jboss.deployment.unit.\"test.war\".WeldStartService: Failed to start service
Caused by: org.jboss.weld.exceptions.DeploymentException: WELD-001414: Bean name is ambiguous. Name enumBean resolves to beans:-Managed Bean [class br.mil.eb.cds.sil.comum.interfaces.EnumBean] with qualifiers [#Any #Default],- Managed Bean [class br.mil.eb.cds.sil.comum.interfaces.EnumBean] with qualifiers [#Any #Default]"}}
at org.jboss.as.controller.client.helpers.standalone.impl.ServerDeploymentPlanResultFuture.getActionResult(ServerDeploymentPlanResultFuture.java:134)
at org.jboss.as.controller.client.helpers.standalone.impl.ServerDeploymentPlanResultFuture.getResultFromNode(ServerDeploymentPlanResultFuture.java:123)
at org.jboss.as.controller.client.helpers.standalone.impl.ServerDeploymentPlanResultFuture.get(ServerDeploymentPlanResultFuture.java:85)
at org.jboss.as.controller.client.helpers.standalone.impl.ServerDeploymentPlanResultFuture.get(ServerDeploymentPlanResultFuture.java:42)
at org.jboss.as.controller.client.helpers.standalone.ServerDeploymentHelper.deploy(ServerDeploymentHelper.java:55)
at org.jboss.as.arquillian.container.ArchiveDeployer.deployInternal(ArchiveDeployer.java:77)
... 88 more
I am using arquillian platform for automated-tests.
I am using WildFly 8.2 Final is released!
Does anyone know what can it be?

No qualifying bean ... spring-webmvc: bean defined in applicationContext is not visible in ServletContext

I have problems with beans defined in APplicationContext. (May be my problems is understanding of Application~Servlet contexts ?)
So, I define < bean id="messageSource" in :
applicationContext.xml
<beans
xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:jpa="http://www.springframework.org/schema/data/jpa"
xmlns:tx="http://www.springframework.org/schema/tx"
xmlns:mvc="http://www.springframework.org/schema/mvc"
xsi:schemaLocation="http://www.springframework.org/schema/mvc
http://www.springframework.org/schema/mvc/spring-mvc-4.1.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.1.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.1.xsd
http://www.springframework.org/schema/data/jpa http://www.springframework.org/schema/data/jpa/spring-jpa-1.3.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-4.0.
<!-- // configure manage of transactions using annotations #Transactional // -->
<tx:annotation-driven />
<!-- // SPRING-SECURITY // -->
<import resource="security-servlet.xml" />
<!-- // DB1 - Database Configuration // -->
<context:property-placeholder location="/WEB-INF/spring/db.config/jdbc-db1.properties" />
<import resource="./db.config/DataSource-db1.xml" />
<import resource="./db.config/jpa-config-db1.xml" />
<!-- Auto scan the components -->
<context:annotation-config />
<!-- // common beans for rest & mvc // -->
<context:component-scan base-package="abc.def.data" />
<bean
id="messageSource"
class="org.springframework.context.support.ResourceBundleMessageSource"
>
<property
name="basename"
value="validation" />
</bean>
also I have mvc-servlet.xml defines in web.xml as :
<!-- // MVC // -->
<servlet>
<servlet-name>mvc</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<init-param>
<param-name>contextConfigLocation</param-name>
<param-value>WEB-INF/spring/mvc-servlet.xml</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>mvc</servlet-name>
<url-pattern>*.htm</url-pattern>
</servlet-mapping>
In my #controller I use bean messageSource such way :
#Controller
#RequestMapping( value = "/admin/su" )
public class AdminSuController {
private final Logger LOG = LoggerFactory.getLogger( getClass() );
.....
#Autowired
private ResourceBundleMessageSource messageSource;
WHEN I define bean in mvc-servlet.xml - no problems
as soon as I move it to (as I understand root context for servletContext) ApplicationContext.xml (I do that to use this beans in REST-servlet.xml and other #controller-s ) I get :
#19:41:26.594 [localhost-startStop-1] ERROR
o.s.web.servlet.DispatcherServlet - Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error
creating bean with name 'addressController': Injection of autowired
dependencies failed; nested exception is
org.springframework.beans.factory .BeanCreationException: Could not
autowire field: private
org.springframework.context.support.ResourceBundleMessageSource
abc.def.rest.controller.AddressController.messageSource; nested
exception is org.sp
ringframework.beans.factory.NoSuchBeanDefinitionException: No
qualifying bean of type
[org.springframework.context.support.ResourceBundleMessageSource]
found for dependency: expected at least 1 bean which qualifies as
autowire candidate for this dependency. Dependency annotations:
{#org.springframework.beans.factory.annotation.Autowired(required=true)}
at
org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:334)
~[spring-beans-4.1.4.RELEASE.jar:4.1.4.RELEASE ] at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1202)
~[spring-beans-4.1.4.RELEASE.jar:4.1.4.RELEASE] at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:537)
~[spring-beans-4.1.4.RELEASE.jar:4.1.4.RELEASE] at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:476)
~[spring-beans-4.1.4.RELEASE.jar:4.1.4.RELEASE] at
org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:303)
~[spring-beans-4.1.4.RELEASE.jar:4.1.4.RELEASE] at
org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
~[spring-beans-4.1.4.RELEASE.jar:4.1.4.RELEASE] at
org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:299)
~[spring-beans-4.1.4.RELEASE.jar:4.1.4.RELEASE] at
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)
~[spring-beans-4.1.4.RELEASE.jar:4.1.4.RELEASE] at
org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:762)
~[spring-beans-4.1.4.RELEASE.jar:4.1.4.RELEASE] at
org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:757)
~[spring-context-4.1.4.RELEASE.jar:4.1.4.RELEASE] at
org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:480)
~[spring-context-4.1.4.RELEASE.jar:4.1.4.RELEASE] at
org.springframework.web.servlet.FrameworkServlet.configureAndRefreshWebApplicationContext(FrameworkServlet.java:663)
~[spring-webmvc-4.1.4.RELEASE.jar:4.1.4.RELEASE] at
org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:629)
~[spring-webmvc-4.1.4.RELEASE.jar:4.1.4.RELEASE] at
org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:677)
~[spring-webmvc-4.1.4.RELEASE.jar:4.1.4.RELEASE] at
org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:548)
~[spring-webmvc-4.1.4.RELEASE.jar:4.1.4.RELEASE] at
org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:489)
~[spring-webmvc-4.1.4.RELEASE.jar:4.1.4.RELEASE] at
org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:136)
[spring-webmvc-4.1.4.RELEASE.jar:4.1.4.RELEASE] at
javax.servlet.GenericServlet.init(GenericServlet.java:158)
[servlet-api.jar:3.0.FR] at
org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1284)
[catalina.jar:7.0.59] at
org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1197)
[catalina.jar:7.0.59] at
org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1087)
[catalina.jar:7.0.59] at
org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:5262)
[catalina.jar:7.0.59] at
org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5550)
[catalina.jar:7.0.59] at
org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
[catalina.jar:7.0.59] at
org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901)
[catalina.jar:7.0.59] at
org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)
[catalina.jar:7.0.59] at
org.apache.catalina.core.StandardHost.addChild(StandardHost.java:649)
[catalina.jar:7.0.59] at
org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1245)
[catalina.jar:7.0.59] at
org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1895)
[catalina.jar:7.0.59] at
java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
[na:1.7.0] at
java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
[na:1.7.0] at
java.util.concurrent.FutureTask.run(FutureTask.java:166) [na:1.7.0]
at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
[na:1.7.0] at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
[na:1.7.0] at java.lang.Thread.run(Thread.java:722) [na:1.7.0] Caused
by: org.springframework.beans.factory.BeanCreationException: Could not
autowire field: private
org.springframework.context.support.ResourceBundleMessageSource
abc.def.rest.controller.AddressControll er.messageSource; nested
exception is
org.springframework.beans.factory.NoSuchBeanDefinitionException: No
qualifying bean of type
[org.springframework.context.support.ResourceBundleMessageSource]
found for dependency: expected at least 1 bean which qualifies as
autowire candidate for this dependency. Dependency annotations:
{#org.springframework.beans.factory.annotation.Autowired(required=true)}
at
org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:561)
~[spring-beans-4.1.4.RELEASE.jar:4.1.4.RELE ASE] at
org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:88)
~[spring-beans-4.1.4.RELEASE.jar:4.1.4.RELEASE] at
org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:331)
~[spring-beans-4.1.4.RELEASE.jar:4.1.4.RELEASE ] ... 34 common frames
omitted Caused by:
org.springframework.beans.factory.NoSuchBeanDefinitionException: No
qualifying bean of type
[org.springframework.context.support.ResourceBundleMessageSource]
found for dependency: expected at le ast 1 bean which qualifies as
autowire candidate for this dependency. Dependency annotations:
{#org.springframework.beans.factory.annotation.Autowired(required=true)}
at
org.springframework.beans.factory.support.DefaultListableBeanFactory.raiseNoSuchBeanDefinitionException(DefaultListableBeanFactory.java:1308)
~[spring-beans-4.1.4.RELEASE.jar:4.1.4.RELEASE] at
org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1054)
~[spring-beans-4.1.4.RELEASE.jar:4.1.4.RELEASE] at
org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:949)
~[spring-beans-4.1.4.RELEASE.jar:4.1.4.RELEASE] at
org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:533)
~[spring-beans-4.1.4.RELEASE.jar:4.1.4.RELE ASE] ... 36 common frames
omitted
Thanks https://stackoverflow.com/users/2843242/oerlien
here is answer Moving messageSource to applicationContext causes the default messageSource not to be visible in dispatcher-servlet context
In your applicationContext.xml:
<bean id="baseMessageSource" class="org.springframework...YourMessageSourceClass">
...
</bean>
In your xxx-servlet.xml:
<bean id="messageSource" parent="baseMessageSource" />

Resources