tomcat发布war项目启动异常!
异常如下:
2014-1-5 11:54:23 org.apache.catalina.core.ApplicationContext log
信息: Initializing Spring root WebApplicationContext
2014-1-5 11:54:35 org.apache.catalina.core.StandardContext listenerStart
严重: 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.security.authentication.ProviderManager#0': Cannot create inner bean '(inner bean)' of type [org.springframework.security.config.authentication.AuthenticationManagerFactoryBean] while setting bean property 'parent'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name '(inner bean)#1': FactoryBean threw exception on object creation; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.security.authenticationManager': Cannot resolve reference to bean 'org.springframework.security.authentication.dao.DaoAuthenticationProvider#0' while setting bean property 'providers' with key [0]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.security.authentication.dao.DaoAuthenticationProvider#0': Cannot resolve reference to bean 'userDetailsService' while setting bean property 'userDetailsService'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userDetailsService': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private com.sinosoft.ebusiness.service.user.personal.service.facade.GeUserPersonalService com.sinosoft.ebusiness.service.user.personal.service.spring.UserDetailsServiceImpl.geUserPersonalService; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'geUserPersonalService' defined in URL [jar:file:/E:/tomcat7/webapps/online/WEB-INF/lib/user-0.0.2-SNAPSHOT.jar!/spring/applicationContext-user.xml]: Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'bizCommonService' defined in URL [jar:file:/E:/tomcat7/webapps/online/WEB-INF/lib/basicBizInfo-0.0.2-SNAPSHOT.jar!/spring/applicationContext-basicBizInfo.xml]: Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'gePortalInterfaceExtraService' defined in URL [jar:file:/E:/tomcat7/webapps/online/WEB-INF/lib/interfacePortal-0.0.2-SNAPSHOT.jar!/spring/applicationContext-interfacePortal.xml]: Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in file [E:\tomcat7\webapps\online\WEB-INF\classes\spring\applicationContext-hibernate.xml]: Invocation of init method failed; nested exception is org.hibernate.HibernateException: 'hibernate.dialect' must be set when no Connection avalable
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveInnerBean(BeanDefinitionValueResolver.java:281)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:125)
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:4939)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5434)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549)
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:619)
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name '(inner bean)#1': FactoryBean threw exception on object creation; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.security.authenticationManager': Cannot resolve reference to bean 'org.springframework.security.authentication.dao.DaoAuthenticationProvider#0' while setting bean property 'providers' with key [0]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.security.authentication.dao.DaoAuthenticationProvider#0': Cannot resolve reference to bean 'userDetailsService' while setting bean property 'userDetailsService'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userDetailsService': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private com.sinosoft.ebusiness.service.user.personal.service.facade.GeUserPersonalService com.sinosoft.ebusiness.service.user.personal.service.spring.UserDetailsServiceImpl.geUserPersonalService; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'geUserPersonalService' defined in URL [jar:file:/E:/tomcat7/webapps/online/WEB-INF/lib/user-0.0.2-SNAPSHOT.jar!/spring/applicationContext-user.xml]: Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'bizCommonService' defined in URL [jar:file:/E:/tomcat7/webapps/online/WEB-INF/lib/basicBizInfo-0.0.2-SNAPSHOT.jar!/spring/applicationContext-basicBizInfo.xml]: Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'gePortalInterfaceExtraService' defined in URL [jar:file:/E:/tomcat7/webapps/online/WEB-INF/lib/interfacePortal-0.0.2-SNAPSHOT.jar!/spring/applicationContext-interfacePortal.xml]: Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in file [E:\tomcat7\webapps\online\WEB-INF\classes\spring\applicationContext-hibernate.xml]: Invocation of init method failed; nested exception is org.hibernate.HibernateException: 'hibernate.dialect' must be set when no Connection avalable
at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.doGetObjectFromFactoryBean(FactoryBeanRegistrySupport.java:149)
at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.getObjectFromFactoryBean(FactoryBeanRegistrySupport.java:109)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveInnerBean(BeanDefinitionValueResolver.java:274)
... 25 more
这里的异常是驱动加载失败,把你数据库连接代码检查一下,看看是否正确。
[解决办法]
建议楼主使用ojdbc14.jar包,比class12.jar功能更全面而且稳定。
[解决办法]
为什么会出现这种驱动包的问题呢?你建项目的时候就应该从对应版本的项目copy jar包
[解决办法]
嗯,兄弟真棒,加油哦
[解决办法]
class12.jar为JDK1.4及以前版本JAVA与Oracle10g相连驱动包,ojdbc14.jar为JDK1.4以后版本JAVA与Oracle10g相连驱动包。相应的驱动包在Oracle安装目录下能够找到。