Getting this odd error during changeover from MySql to Oracle. Everything worked fine until I switched over to an Oracle driver. The autowired class SessionFactory is now failing, but with this odd String error:
Nov 5, 2012 4:52:06 PM org.apache.catalina.core.StandardContext listenerStart
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 'services': Cannot create inner bean 'com.capitalone.api.socialdata.SocialDataApi#2f729e' of type [com.capitalone.api.socialdata.SocialDataApi] while setting bean property 'serviceBeans' with key [0]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'com.capitalone.api.socialdata.SocialDataApi#2f729e': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private com.capitalone.api.socialdata.service.SocialDataService com.capitalone.api.socialdata.SocialDataApi.socialDataService; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'com.capitalone.api.socialdata.service.SocialDataServiceImpl#0': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private com.capitalone.api.socialdata.dao.ProfileDAO com.capitalone.api.socialdata.service.SocialDataServiceImpl.profileDAO; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'com.capitalone.api.socialdata.dao.ProfileDAOImpl#0': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private org.hibernate.SessionFactory com.capitalone.api.socialdata.dao.ProfileDAOImpl.sessionFactory; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in ServletContext resource [/WEB-INF/beans.xml]: Invocation of init method failed; nested exception is java.lang.StringIndexOutOfBoundsException: String index out of range: 13068
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveInnerBean(BeanDefinitionValueResolver.java:281)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:120)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveManagedList(BeanDefinitionValueResolver.java:353)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:153)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1325)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1086)
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:4779)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5273)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1566)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1556)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'com.capitalone.api.socialdata.SocialDataApi#2f729e': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private com.capitalone.api.socialdata.service.SocialDataService com.capitalone.api.socialdata.SocialDataApi.socialDataService; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'com.capitalone.api.socialdata.service.SocialDataServiceImpl#0': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private com.capitalone.api.socialdata.dao.ProfileDAO com.capitalone.api.socialdata.service.SocialDataServiceImpl.profileDAO; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'com.capitalone.api.socialdata.dao.ProfileDAOImpl#0': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private org.hibernate.SessionFactory com.capitalone.api.socialdata.dao.ProfileDAOImpl.sessionFactory; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in ServletContext resource [/WEB-INF/beans.xml]: Invocation of init method failed; nested exception is java.lang.StringIndexOutOfBoundsException: String index out of range: 13068
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:285)
Columns mapped in DAO files like such:
#Column(name="CHANNEL_NAME")
private String name;
jdbc.properties has these lines:
jdbc.driverClassName=oracle.jdbc.driver.OracleDriver
jdbc.dialect=org.hibernate.dialect.OracleDialect
jdbc.databaseurl=jdbc:oracle:thin:#localhost:3306:MYDB
.pom file has this dependency:
com.oracle
ojdbc5
11.2.0.3
Injection of autowired dependencies failed; did you update your dependencies in all the right places?
# character in jdbc.properties file seemed to be causing the String out of bounds exception:
I changed:
jdbc.databaseurl=jdbc:oracle:thin:#localhost:3306:MYDB
to:
jdbc.databaseurl=jdbc:oracle:thin://localhost:3306:MYDB
Related
I am trying to convert this http://websystique.com/spring-security/spring-security-4-remember-me-example-with-hibernate/ into Spring, Spring Security and Mybatis, here is the project structure I have:
Since I using Java configuration, and I want to get rid the xml file. But when I run the project, I got following issues:
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 'securityConfiguration': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: org.springframework.security.core.userdetails.UserDetailsService com.vincent.configuration.SecurityConfiguration.userDetailsService; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'customUserDetailsService': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private com.vincent.service.UserService com.vincent.service.CustomUserDetailsService.userService; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userService': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private com.vincent.dao.UserDAO com.vincent.service.UserServiceImpl.dao; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userDAO': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private com.vincent.mapper.UserMapper com.vincent.dao.UserDAOImpl.userMapper; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'userMapper' defined in file [V:\Programming\SpringMVC\.metadata\.plugins\org.eclipse.wst.server.core\tmp4\wtpwebapps\SpringSecurityTest\WEB-INF\classes\com\vincent\mapper\UserMapper.class]: Unsatisfied dependency expressed through bean property 'sqlSessionFactory': Error creating bean with name 'sqlSessionFactory' defined in com.vincent.configuration.DatabaseConfig: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.apache.ibatis.session.SqlSessionFactory]: Factory method 'sqlSessionFactory' threw exception; nested exception is java.lang.NullPointerException; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlSessionFactory' defined in com.vincent.configuration.DatabaseConfig: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.apache.ibatis.session.SqlSessionFactory]: Factory method 'sqlSessionFactory' threw exception; nested exception is java.lang.NullPointerException
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:334)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1214)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:543)
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:772)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:839)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:538)
at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:444)
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:326)
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:107)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4736)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5181)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1408)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1398)
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)
(More and more log after)
I try to fix the problem, but I don't know how to fix....
The full code is in: https://github.com/zhengye1/SpringSecurityTest
Updated:
After I try the solution that llya provided, I got new exception
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 'securityConfiguration': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: org.springframework.security.core.userdetails.UserDetailsService com.vincent.configuration.SecurityConfiguration.userDetailsService; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'customUserDetailsService': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private com.vincent.service.UserService com.vincent.service.CustomUserDetailsService.userService; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userService': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private com.vincent.dao.UserDAO com.vincent.service.UserServiceImpl.dao; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userDAO': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private com.vincent.mapper.UserMapper com.vincent.dao.UserDAOImpl.userMapper; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userMapper' defined in file [V:\Programming\SpringMVC\.metadata\.plugins\org.eclipse.wst.server.core\tmp4\wtpwebapps\SpringSecurityTest\WEB-INF\classes\com\vincent\mapper\UserMapper.class]: Initialization of bean failed; nested exception is java.lang.NoClassDefFoundError: org/apache/ibatis/cursor/Cursor
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:334)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1214)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:543)
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:772)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:839)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:538)
at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:444)
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:326)
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:107)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4736)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5181)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1408)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1398)
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)
You have NPE cause environment is not autowired. I don't know exact reason but you can do workaraound as follows (got from here):
#Configuration
#EnableTransactionManagement
#ComponentScan({ "com.vincent.configuration" })
#MapperScan(basePackages="com.vincent.mapper")
#PropertySource(value = { "classpath:application.properties" })
public class DatabaseConfig implements EnvironmentAware {
private Environment environment;
#Override
public void setEnvironment(Environment arg0) {
this.environment = arg0;
}
//skipped code here
}
UPD
There is another exception: ClassNotFoundException: org.apache.ibatis.cursor.Cursor because org.mybatis:mybatis-spring:jar:1.3.0 require org.mybatis:mybatis:jar:3.4.0, so upgrade org.mybatis:mybatis from 3.1.1 to 3.4.0. There will be one more exception Failed to parse expression 'isAuthenticated())' cause there is unnecessary right brace ) in 'isAuthenticated())' on SecurityConfiguration:49
Did you Add "#Service" tag start of your CurrentUserDetailsService class?
#Service
public class CurrentUserDetailsService implements UserDetailsService
I have two wars both using one specific jar (ehcache-core.jar). I did put the jar under <Tomcat_Home>\lib.
But when I start the server, my application throws below error where class exists under ehcache-core.jar
Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.cache.interceptor.CacheInterceptor#0': Cannot resolve reference to bean 'cacheManager' while setting bean property 'cacheManager'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'cacheManager' defined in URL [jar:file:/F:/codeBase_all/codeBase_Custom/applications/customer-portal/target/customer-webapp-public-1.0-Snapshot/WEB-INF/lib/co-common-1.0-Snapshot.jar!/META-INF/cgi-spring/utils/util-services-bean.xml]: Cannot resolve reference to bean 'ehcache' while setting bean property 'cacheManager'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'ehcache' defined in URL [jar:file:/F:/codeBase_all/codeBase_Custom/applications/customer-portal/target/customer-webapp-public-1.0-Snapshot/WEB-INF/lib/co-common-1.0-Snapshot.jar!/META-INF/cgi-spring/utils/util-services-bean.xml]: Invocation of init method failed; nested exception is java.lang.NoClassDefFoundError: Could not initialize class net.sf.ehcache.CacheManager
Related cause: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.beans.factory.config.MethodInvokingFactoryBean#1' defined in URL [jar:file:/F:/codeBase_all/codeBase_Custom/applications/customer-portal/target/customer-webapp-public-1.0-Snapshot/WEB-INF/lib/enrollment-1.5.jar!/META-INF/spring/enrollment-beans.xml]: Cannot resolve reference to bean 'applicationService1' while setting bean property 'arguments' with key [0]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'applicationService1': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private com.tesing.plan.service.PlanService com.tesing.enrollment.service.ApplicationServiceImpl.planService; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'planService': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private com.tesing.plan.orm.dao.PlanPremiumRateLookupDAO com.tesing.plan.service.PlanServiceImpl.planPremiumRateLookupDAO; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'planPremiumRateLookupDAO' defined in URL [jar:file:/F:/codeBase_all/codeBase_Custom/applications/customer-portal/target/customer-webapp-public-1.0-Snapshot/WEB-INF/lib/plan-management-1.5.jar!/META-INF/spring/plan-management-service.xml]: Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.cache.interceptor.CacheInterceptor#0': Cannot resolve reference to bean 'cacheManager' while setting bean property 'cacheManager'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'cacheManager' defined in URL [jar:file:/F:/codeBase_all/codeBase_Custom/applications/customer-portal/target/customer-webapp-public-1.0-Snapshot/WEB-INF/lib/co-common-1.0-Snapshot.jar!/META-INF/cgi-spring/utils/util-services-bean.xml]: Cannot resolve reference to bean 'ehcache' while setting bean property 'cacheManager'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'ehcache' defined in URL [jar:file:/F:/codeBase_all/codeBase_Custom/applications/customer-portal/target/customer-webapp-public-1.0-Snapshot/WEB-INF/lib/co-common-1.0-Snapshot.jar!/META-INF/cgi-spring/utils/util-services-bean.xml]: Invocation of init method failed; nested exception is java.lang.NoClassDefFoundError: Could not initialize class net.sf.ehcache.CacheManager
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:287)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1106)
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:294)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:225)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:291)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)
at org.springframework.context.support.AbstractApplicationContext.registerBeanPostProcessors(AbstractApplicationContext.java:745)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:454)
at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:383)
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:283)
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:111)
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(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
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: Could not autowire field: protected com.tesing.utils.picklistprovider.PickListProvider com.tesing.utils.web.action.BaseController.pickListProvider; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'queryBasedPickListProvider' defined in file [F:\codeBase_all\codeBase_Custom\applications\customer-portal\target\customer-webapp-public-1.0-Snapshot\WEB-INF\classes\META-INF\spring\picklist-service.xml]: Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.cache.interceptor.CacheInterceptor#0': Cannot resolve reference to bean 'cacheManager' while setting bean property 'cacheManager'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'cacheManager' defined in URL [jar:file:/F:/codeBase_all/codeBase_Custom/applications/customer-portal/target/customer-webapp-public-1.0-Snapshot/WEB-INF/lib/co-common-1.0-Snapshot.jar!/META-INF/cgi-spring/utils/util-services-bean.xml]: Cannot resolve reference to bean 'ehcache' while setting bean property 'cacheManager'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'ehcache' defined in URL [jar:file:/F:/codeBase_all/codeBase_Custom/applications/customer-portal/target/customer-webapp-public-1.0-Snapshot/WEB-INF/lib/co-common-1.0-Snapshot.jar!/META-INF/cgi-spring/utils/util-services-bean.xml]: Invocation of init method failed; nested exception is java.lang.NoClassDefFoundError: Could not initialize class net.sf.ehcache.CacheManager
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:506)
at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:87)
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:284)
... 36 more
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'queryBasedPickListProvider' defined in file [F:\codeBase_all\codeBase_Custom\applications\customer-portal\target\customer-webapp-public-1.0-Snapshot\WEB-INF\classes\META-INF\spring\picklist-service.xml]: Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.cache.interceptor.CacheInterceptor#0': Cannot resolve reference to bean 'cacheManager' while setting bean property 'cacheManager'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'cacheManager' defined in URL [jar:file:/F:/codeBase_all/codeBase_Custom/applications/customer-portal/target/customer-webapp-public-1.0-Snapshot/WEB-INF/lib/co-common-1.0-Snapshot.jar!/META-INF/cgi-spring/utils/util-services-bean.xml]: Cannot resolve reference to bean 'ehcache' while setting bean property 'cacheManager'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'ehcache' defined in URL [jar:file:/F:/codeBase_all/codeBase_Custom/applications/customer-portal/target/customer-webapp-public-1.0-Snapshot/WEB-INF/lib/co-common-1.0-Snapshot.jar!/META-INF/cgi-spring/utils/util-services-bean.xml]: Invocation of init method failed; nested exception is java.lang.NoClassDefFoundError: Could not initialize class net.sf.ehcache.CacheManager
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:527)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:294)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:225)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:291)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.findAutowireCandidates(DefaultListableBeanFactory.java:876)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:818)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:735)
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:478)
... 38 more
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.cache.interceptor.CacheInterceptor#0': Cannot resolve reference to bean 'cacheManager' while setting bean property 'cacheManager'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'cacheManager' defined in URL [jar:file:/F:/codeBase_all/codeBase_Custom/applications/customer-portal/target/customer-webapp-public-1.0-Snapshot/WEB-INF/lib/co-common-1.0-Snapshot.jar!/META-INF/cgi-spring/utils/util-services-bean.xml]: Cannot resolve reference to bean 'ehcache' while setting bean property 'cacheManager'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'ehcache' defined in URL [jar:file:/F:/codeBase_all/codeBase_Custom/applications/customer-portal/target/customer-webapp-public-1.0-Snapshot/WEB-INF/lib/co-common-1.0-Snapshot.jar!/META-INF/cgi-spring/utils/util-services-bean.xml]: Invocation of init method failed; nested exception is java.lang.NoClassDefFoundError: Could not initialize class net.sf.ehcache.CacheManager
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:328)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:106)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1360)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1118)
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:294)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:225)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:291)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)
at org.springframework.aop.support.AbstractBeanFactoryPointcutAdvisor.getAdvice(AbstractBeanFactoryPointcutAdvisor.java:85)
at org.springframework.aop.aspectj.AspectJProxyUtils.isAspectJAdvice(AspectJProxyUtils.java:67)
at org.springframework.aop.aspectj.AspectJProxyUtils.makeAdvisorChainAspectJCapableIfNecessary(AspectJProxyUtils.java:49)
at org.springframework.aop.aspectj.autoproxy.AspectJAwareAdvisorAutoProxyCreator.extendAdvisors(AspectJAwareAdvisorAutoProxyCreator.java:101)
at org.springframework.aop.framework.autoproxy.AbstractAdvisorAutoProxyCreator.findEligibleAdvisors(AbstractAdvisorAutoProxyCreator.java:88)
at org.springframework.aop.framework.autoproxy.AbstractAdvisorAutoProxyCreator.getAdvicesAndAdvisorsForBean(AbstractAdvisorAutoProxyCreator.java:68)
at org.springframework.aop.framework.autoproxy.AbstractAutoProxyCreator.wrapIfNecessary(AbstractAutoProxyCreator.java:359)
at org.springframework.aop.framework.autoproxy.AbstractAutoProxyCreator.postProcessAfterInitialization(AbstractAutoProxyCreator.java:322)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsAfterInitialization(AbstractAutowireCapableBeanFactory.java:407)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1461)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)
... 47 more
The error message is saying:
Could not initialize class net.sf.ehcache.CacheManager
Check further back in the logfile, and there should be a stacktrace for some exception that was thrown during the initialization of CacheManager or one of its dependent classes. Fix the cause of that exception, and this problem will be solved as well.
I need a method of my bean be be executed asynchronously. For that, I added the #Async annotation to my bean method and #EnableAsync on #Configuration annotated class but since then, my project has stopped loading with the following error:
ERROR 2014-12-10 17:03:26 org.springframework.web.context.ContextLoader:331 - Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'webSecurityConfig': Injection of autowired dependencies failed; nested exception is
org.springframework.beans.factory.BeanCreationException: Could not autowire field: com.softech.dms.service.DetailService com.softech.dms.config.WebSecurityConfig.detailService; nested exception is
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'detailService': Injection of autowired dependencies failed; nested exception is
org.springframework.beans.factory.BeanCreationException: Could not autowire field: com.softech.dms.service.UserService com.softech.dms.service.DetailService.userService; nested exception is
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userServiceImpl': Injection of autowired dependencies failed; nested exception is
org.springframework.beans.factory.BeanCreationException: Could not autowire field: com.softech.dms.service.CustomerService com.softech.dms.service.impl.UserServiceImpl.customerService; nested exception is
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'customerServiceImpl': Injection of autowired dependencies failed; nested exception is
org.springframework.beans.factory.BeanCreationException: Could not autowire field: com.softech.dms.service.FolderServicecom.softech.dms.service.impl.CustomerServiceImpl.folderService; nested exception is
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'folderServiceImpl': Injection of autowired dependencies failed; nested exception is
org.springframework.beans.factory.BeanCreationException: Could not autowire field: private com.softech.dms.service.BookmarkService com.softech.dms.service.impl.FolderServiceImpl.bookmarkFolderService; nested exception is
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'bookmarkServiceImpl': Injection of autowired dependencies failed; nested exception is
org.springframework.beans.factory.BeanCreationException: Could not autowire field: private com.softech.dms.service.DocumentService com.softech.dms.service.impl.BookmarkServiceImpl.documentService; nested exception is
org.springframework.beans.factory.BeanCurrentlyInCreationException: Error creating bean with name 'documentServiceImpl': Bean with name 'documentServiceImpl' has been injected into other beans
[documentHistoryServiceImpl,sharedDocumentServiceImpl] 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.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:289)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1146)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:458)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:296)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:223)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:293)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:628)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:932)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:479)
at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:410)
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:306)
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:112)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4779)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5273)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1566)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1556)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
at java.util.concurrent.FutureTask.run(FutureTask.java:166)
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:724)
When I remove #EnableAsync annotation, everything works perfectly again. Please suggest if I am missing something here.
Try putting lazy annotation to the object where you are autowiring. It solved for me
#Autowired
#Lazy(value=true)
MyService servObj;
Try to add default-lazy-init="true" to your xml configuration file.
This article give some directions about the circular dependency problem:
http://java.dzone.com/articles/resolve-circular-dependency
don't use #Lazy(value=true).
There are two important cases for implement #Async annotation.
you should use #Async for public methods.
You should call the public method from another class. You shouldn't call the public
method from same class of the public method.
When I try to start the apache tomcat 7 via a command line I have this error:
nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'markedStringEncryptor' defined in URL [jar:file:/home/stage/apache-tomcat-7.0.52/webapps/ROOT/WEB-INF/lib/hq-server-5.0.2.jar!/META-INF/spring/app-context.xml]: Invocation of init method failed; nested exception is java.lang.NullPointerException
at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:730)
... 95 more
Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'serverManagerImpl' defined in URL [jar:file:/home/stage/apache-tomcat-7.0.52/webapps/ROOT/WEB-INF/lib/hq-server-5.0.2.jar!/org/hyperic/hq/appdef/server/session/ServerManagerImpl.class]: Unsatisfied dependency expressed through constructor argument with index 10 of type [org.hyperic.hq.appdef.shared.ServiceManager]: : Error creating bean with name 'serviceManagerImpl' defined in URL [jar:file:/home/stage/apache-tomcat-7.0.52/webapps/ROOT/WEB-INF/lib/hq-server-5.0.2.jar!/org/hyperic/hq/appdef/server/session/ServiceManagerImpl.class]: Unsatisfied dependency expressed through constructor argument with index 11 of type [org.hyperic.hq.measurement.shared.MeasurementManager]: : Error creating bean with name 'measurementManagerImpl': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private org.hyperic.hq.measurement.server.session.MeasurementDAO org.hyperic.hq.measurement.server.session.MeasurementManagerImpl.measurementDAO; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'measurementDAO': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private org.jasypt.hibernate.encryptor.HibernatePBEStringEncryptor org.hyperic.hq.measurement.server.session.MeasurementDAO.hibernateStringEncryptor; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'hibernateStringEncryptor' defined in URL [jar:file:/home/stage/apache-tomcat-7.0.52/webapps/ROOT/WEB-INF/lib/hq-server-5.0.2.jar!/META-INF/spring/app-context.xml]: Cannot resolve reference to bean 'markedStringEncryptor' while setting bean property 'encryptor'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'markedStringEncryptor' defined in URL [jar:file:/home/stage/apache-tomcat-7.0.52/webapps/ROOT/WEB-INF/lib/hq-server-5.0.2.jar!/META-INF/spring/app-context.xml]: Invocation of init method failed; nested exception is java.lang.NullPointerException; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'measurementManagerImpl': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private org.hyperic.hq.measurement.server.session.MeasurementDAO org.hyperic.hq.measurement.server.session.MeasurementManagerImpl.measurementDAO; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'measurementDAO': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private org.jasypt.hibernate.encryptor.HibernatePBEStringEncryptor org.hyperic.hq.measurement.server.session.MeasurementDAO.hibernateStringEncryptor; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'hibernateStringEncryptor' defined in URL [jar:file:/home/stage/apache-tomcat-7.0.52/webapps/ROOT/WEB-INF/lib/hq-server-5.0.2.jar!/META-INF/spring/app-context.xml]: Cannot resolve reference to bean 'markedStringEncryptor' while setting bean property 'encryptor'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'markedStringEncryptor' defined in URL [jar:file:/home/stage/apache-tomcat-7.0.52/webapps/ROOT/WEB-INF/lib/hq-server-5.0.2.jar!/META-INF/spring/app-context.xml]: Invocation of init method failed; nested exception is java.lang.NullPointerException; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'serviceManagerImpl' defined in URL [jar:file:/home/stage/apache-tomcat-7.0.52/webapps/ROOT/WEB-INF/lib/hq-server-5.0.2.jar!/org/hyperic/hq/appdef/server/session/ServiceManagerImpl.class]: Unsatisfied dependency expressed through constructor argument with index 11 of type [org.hyperic.hq.measurement.shared.MeasurementManager]: : Error creating bean with name 'measurementManagerImpl': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private org.hyperic.hq.measurement.server.session.MeasurementDAO org.hyperic.hq.measurement.server.session.MeasurementManagerImpl.measurementDAO; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'measurementDAO': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private org.jasypt.hibernate.encryptor.HibernatePBEStringEncryptor org.hyperic.hq.measurement.server.session.MeasurementDAO.hibernateStringEncryptor; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'hibernateStringEncryptor' defined in URL [jar:file:/home/stage/apache-tomcat-7.0.52/webapps/ROOT/WEB-INF/lib/hq-server-5.0.2.jar!/META-INF/spring/app-context.xml]: Cannot resolve reference to bean 'markedStringEncryptor' while setting bean property 'encryptor'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'markedStringEncryptor' defined in URL [jar:file:/home/stage/apache-tomcat-7.0.52/webapps/ROOT/WEB-INF/lib/hq-server-5.0.2.jar!/META-INF/spring/app-context.xml]: Invocation of init method failed; nested exception is java.lang.NullPointerException; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'measurementManagerImpl': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private org.hyperic.hq.measurement.server.session.MeasurementDAO org.hyperic.hq.measurement.server.session.MeasurementManagerImpl.measurementDAO; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'measurementDAO': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private org.jasypt.hibernate.encryptor.HibernatePBEStringEncryptor org.hyperic.hq.measurement.server.session.MeasurementDAO.hibernateStringEncryptor; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'hibernateStringEncryptor' defined in URL [jar:file:/home/stage/apache-tomcat-7.0.52/webapps/ROOT/WEB-INF/lib/hq-server-5.0.2.jar!/META-INF/spring/app-context.xml]: Cannot resolve reference to bean 'markedStringEncryptor' while setting bean property 'encryptor'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'markedStringEncryptor' defined in URL [jar:file:/home/stage/apache-tomcat-7.0.52/webapps/ROOT/WEB-INF/lib/hq-server-5.0.2.jar!/META-INF/spring/app-context.xml]: Invocation of init method failed; nested exception is java.lang.NullPointerException
at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:730)
org.springframework.beans.factory.support.ConstructorResolver.resolveAutowiredArgument(ConstructorResolver.java:795)
at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:723)
... 109 more
Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'serviceManagerImpl' defined in URL [jar:file:/home/stage/apache-tomcat-7.0.52/webapps/ROOT/WEB-INF/lib/hq-server-5.0.2.jar!/org/hyperic/hq/appdef/server/session/ServiceManagerImpl.class]: Unsatisfied dependency expressed through constructor argument with index 11 of type [org.hyperic.hq.measurement.shared.MeasurementManager]: : Error creating bean with name 'measurementManagerImpl': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private org.hyperic.hq.measurement.server.session.MeasurementDAO org.hyperic.hq.measurement.server.session.MeasurementManagerImpl.measurementDAO; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'measurementDAO': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private org.jasypt.hibernate.encryptor.HibernatePBEStringEncryptor org.hyperic.hq.measurement.server.session.MeasurementDAO.hibernateStringEncryptor; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'hibernateStringEncryptor' defined in URL [jar:file:/home/stage/apache-tomcat-7.0.52/webapps/ROOT/WEB-INF/lib/hq-server-5.0.2.jar!/META-INF/spring/app-context.xml]: Cannot resolve reference to bean 'markedStringEncryptor' while setting bean property 'encryptor'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'markedStringEncryptor' defined in URL [jar:file:/home/stage/apache-tomcat-7.0.52/webapps/ROOT/WEB-INF/lib/hq-server-5.0.2.jar!/META-INF/spring/app-context.xml]: Invocation of init method failed; nested exception is java.lang.NullPointerException; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'measurementManagerImpl': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private org.hyperic.hq.measurement.server.session.MeasurementDAO org.hyperic.hq.measurement.server.session.MeasurementManagerImpl.measurementDAO; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'measurementDAO': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private org.jasypt.hibernate.encryptor.HibernatePBEStringEncryptor org.hyperic.hq.measurement.server.session.MeasurementDAO.hibernateStringEncryptor; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'hibernateStringEncryptor' defined in URL [jar:file:/home/stage/apache-tomcat-7.0.52/webapps/ROOT/WEB-INF/lib/hq-server-5.0.2.jar!/META-INF/spring/app-context.xml]: Cannot resolve reference to bean 'markedStringEncryptor' while setting bean property 'encryptor'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'markedStringEncryptor' defined in URL [jar:file:/home/stage/apache-tomcat-7.0.52/webapps/ROOT/WEB-INF/lib/hq-server-5.0.2.jar!/META-INF/spring/app-context.xml]: Invocation of init method failed; nested exception is java.lang.NullPointerException
at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:730)
... 123 more
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'measurementManagerImpl': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private org.hyperic.hq.measurement.server.session.MeasurementDAO org.hyperic.hq.measurement.server.session.MeasurementManagerImpl.measurementDAO; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'measurementDAO': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private org.jasypt.hibernate.encryptor.HibernatePBEStringEncryptor org.hyperic.hq.measurement.server.session.MeasurementDAO.hibernateStringEncryptor; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'hibernateStringEncryptor' defined in URL [jar:file:/home/stage/apache-tomcat-7.0.52/webapps/ROOT/WEB-INF/lib/hq-server-5.0.2.jar!/META-INF/spring/app-context.xml]: Cannot resolve reference to bean 'markedStringEncryptor' while setting bean property 'encryptor'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'markedStringEncryptor' defined in URL [jar:file:/home/stage/apache-tomcat-7.0.52/webapps/ROOT/WEB-INF/lib/hq-server-5.0.2.jar!/META-INF/spring/app-context.xml]: Invocation of init method failed; nested exception is java.lang.NullPointerException
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:285)
at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:723)
... 137 more
Caused by: org.springframework.beans.factory.BeanCreationException: Could not autowire field: private org.hyperic.hq.measurement.server.session.MeasurementDAO org.hyperic.hq.measurement.server.session.MeasurementManagerImpl.measurementDAO; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'measurementDAO': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private org.jasypt.hibernate.encryptor.HibernatePBEStringEncryptor org.hyperic.hq.measurement.server.session.MeasurementDAO.hibernateStringEncryptor; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'hibernateStringEncryptor' defined in URL [jar:file:/home/stage/apache-tomcat-7.0.52/webapps/ROOT/WEB-INF/lib/hq-server-5.0.2.jar!/META-INF/spring/app-context.xml]: Cannot resolve reference to bean 'markedStringEncryptor' while setting bean property 'encryptor'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'markedStringEncryptor' defined in URL [jar:file:/home/stage/apache-tomcat-7.0.52/webapps/ROOT/WEB-INF/lib/hq-server-5.0.2.jar!/META-INF/spring/app-context.xml]: Invocation of init method failed; nested exception is java.lang.NullPointerException
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:502)
at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:84)
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:282)
... 149 more
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'measurementDAO': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private org.jasypt.hibernate.encryptor.HibernatePBEStringEncryptor org.hyperic.hq.measurement.server.session.MeasurementDAO.hibernateStringEncryptor; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'hibernateStringEncryptor' defined in URL [jar:file:/home/stage/apache-tomcat-7.0.52/webapps/ROOT/WEB-INF/lib/hq-server-5.0.2.jar!/META-INF/spring/app-context.xml]: Cannot resolve reference to bean 'markedStringEncryptor' while setting bean property 'encryptor'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'markedStringEncryptor' defined in URL [jar:file:/home/stage/apache-tomcat-7.0.52/webapps/ROOT/WEB-INF/lib/hq-server-5.0.2.jar!/META-INF/spring/app-context.xml]: Invocation of init method failed; nested exception is java.lang.NullPointerException
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:285)
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)
... 162 more
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'hibernateStringEncryptor' defined in URL [jar:file:/home/stage/apache-tomcat-7.0.52/webapps/ROOT/WEB-INF/lib/hq-server-5.0.2.jar!/META-INF/spring/app-context.xml]: Cannot resolve reference to bean 'markedStringEncryptor' while setting bean property 'encryptor'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'markedStringEncryptor' defined in URL [jar:file:/home/stage/apache-tomcat-7.0.52/webapps/ROOT/WEB-INF/lib/hq-server-5.0.2.jar!/META-INF/spring/app-context.xml]: Invocation of init method failed; nested exception is java.lang.NullPointerException
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:328)
... 184 more
12 mars 2014 15:02:50 org.apache.catalina.core.StandardContext startInternal
GRAVE: Error listenerStart
12 mars 2014 15:02:50 org.apache.catalina.core.StandardContext startInternal
GRAVE: Erreur de démarrage du contexte [] suite aux erreurs précédentes
12 mars 2014 15:02:50 org.apache.catalina.loader.WebappClassLoader clearReferencesJdbc
GRAVE: The web application [] registered the JDBC driver [org.postgresql.Driver] but failed to unregister it when the web application was stopped. To prevent a memory leak, the JDBC Driver has been forcibly unregistered.
12 mars 2014 15:02:50 org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
GRAVE: The web application [] appears to have started a thread named [Timer-0] but has failed to stop it. This is very likely to create a memory leak.
12 mars 2014 15:02:50 org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
GRAVE: The web application [] appears to have started a thread named [ZeventProcessor] but has failed to stop it. This is very likely to create a memory leak.
12 mars 2014 15:02:50 org.apache.catalina.startup.HostConfig deployDirectory
INFO: Déploiement du répertoire /home/stage/apache-tomcat-7.0.52/webapps/docs de l'application web
12 mars 2014 15:02:50 org.apache.catalina.startup.HostConfig deployDirectory
INFO: Déploiement du répertoire /home/stage/apache-tomcat-7.0.52/webapps/manager de l'application web
12 mars 2014 15:02:50 org.apache.catalina.startup.HostConfig deployDirectory
INFO: Déploiement du répertoire /home/stage/apache-tomcat-7.0.52/webapps/host-manager de l'application web
12 mars 2014 15:02:50 org.apache.catalina.startup.HostConfig deployDirectory
INFO: Déploiement du répertoire /home/stage/apache-tomcat-7.0.52/webapps/examples de l'application web
12 mars 2014 15:02:50 org.apache.catalina.startup.Catalina start
INFO: Server startup in 30733 ms
Can anyone help me please ?
i have a problem with a project that i want to run with maven, in with i use spring and hibernate, i'm new to these technokogies by the way. just if someone can hepl me solve the problem, on post me an example which cab be runned easly , thnas you
this is my exception :
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'contactController': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private net.viralpatel.contact.service.ContactService net.viralpatel.contact.controller.ContactController.contactService; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'contactServiceImpl': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private net.viralpatel.contact.dao.ContactDAO net.viralpatel.contact.service.ContactServiceImpl.contactDAO; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'contactDAOImpl': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private org.hibernate.SessionFactory net.viralpatel.contact.dao.ContactDAOImpl.sessionFactory; nested exception is java.lang.NoClassDefFoundError: Lorg/hibernate/cache/CacheProvider;
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:286)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1064)
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)
it's caused by :
Caused by: org.springframework.beans.factory.BeanCreationException: Could not autowire field: private net.viralpatel.contact.service.ContactService net.viralpatel.contact.controller.ContactController.contactService; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'contactServiceImpl': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private net.viralpatel.contact.dao.ContactDAO net.viralpatel.contact.service.ContactServiceImpl.contactDAO; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'contactDAOImpl': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private org.hibernate.SessionFactory net.viralpatel.contact.dao.ContactDAOImpl.sessionFactory; nested exception is java.lang.NoClassDefFoundError: Lorg/hibernate/cache/CacheProvider;
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'contactServiceImpl': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private net.viralpatel.contact.dao.ContactDAO net.viralpatel.contact.service.ContactServiceImpl.contactDAO; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'contactDAOImpl': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private org.hibernate.SessionFactory net.viralpatel.contact.dao.ContactDAOImpl.sessionFactory; nested exception is java.lang.NoClassDefFoundError: Lorg/hibernate/cache/CacheProvider;
....
thank you for help
java.lang.NoClassDefFoundError: Lorg/hibernate/cache/CacheProvider;
Seems like you are missing hibernate-core.jar in your project. Add it to your CLASSPATH. Pick version that is compatible with the rest of your stack.
Try adding this to pom.xml :
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-core</artifactId>
<version>4.1.2.Final</version>
</dependency>
I can see couple of posts on the same issue. You can check below links and if that doesnt solve your problem then can put the configuration xml file you use to integrate spring with hibernate.
Exception NoClassDefFoundError for CacheProvider
java.lang.ClassNotFoundException: org.hibernate.cache.CacheProvider exception while integrating spring and hiberate