11:05:20.732 [localhost-startStop-1]调试o.s.b.f.s.DefaultListableBeanFactory-创建单例bean'dataSource'的共享实例 11:05:20.748 [localhost-startStop-1]警告oswcsXmlWebApplicationContext-上下文初始化期间遇到异常-取消刷新尝试:org.springframework.beans.factory.BeanCreationException:创建名称为'propertyConfigurer'的Bean时在ServletContext资源中定义了错误[/ WEB-INF / classes / applicationContext.xml]:在设置bean属性“ properties”时无法创建类型为[org.apache.commons.configuration2.ConfigurationConverter]的内部bean“ org.apache.commons.configuration2.ConfigurationConverter#23c78cc”;嵌套的异常是org.springframework.beans.factory.BeanCreationException:在ServletContext资源[/WEB-INF/classes/applicationContext.xml]中定义的名称为'org.apache.commons.configuration2.ConfigurationConverter#23c78cc'的bean创建时出错。在设置构造函数参数时引用bean'domainConfiguration';嵌套的异常是org.springframework.beans.factory.BeanCreationException:创建在ServletContext资源[/WEB-INF/classes/applicationContext.xml]中定义的名称为“ domainConfiguration”的bean时出错:设置bean属性时无法解析对bean“ dataSource”的引用'数据源';嵌套的异常是org.springframework.beans.factory.BeanCreationException:创建在ServletContext资源[/WEB-INF/classes/applicationContext.xml]中定义的名称为'dataSource'的bean时出错:设置属性值时出错;嵌套的异常是org.springframework.beans.PropertyBatchUpdateException;嵌套的PropertyAccessExceptions(1)是: PropertyAccessException 1:org.springframework.beans.MethodInvocationException:属性'driverClassName'抛出异常;嵌套异常为java.lang.IllegalStateException:无法加载JDBC驱动程序类[oracle.jdbc.driver.OracleDriver] 11:05:20.759 [localhost-startStop-1]错误o.s.web.context.ContextLoader-上下文初始化失败 org.springframework.beans.factory.BeanCreationException:创建在ServletContext资源[/WEB-INF/classes/applicationContext.xml]中定义的名称为'propertyConfigurer'的bean时出错:无法创建内部bean'org.apache.commons.configuration2.ConfigurationConverter#设置bean属性'properties'时,类型为[org.apache.commons.configuration2.ConfigurationConverter]的23c78cc';嵌套的异常是org.springframework.beans.factory.BeanCreationException:在ServletContext资源[/WEB-INF/classes/applicationContext.xml]中定义的名称为'org.apache.commons.configuration2.ConfigurationConverter#23c78cc'的bean创建时出错。在设置构造函数参数时引用bean'domainConfiguration';嵌套的异常是org.springframework.beans.factory.BeanCreationException:在ServletContext资源[/WEB-INF/classes/applicationContext.xml]中定义名称为“ domainConfiguration”的bean创建时出错:设置bean属性时无法解析对bean“ dataSource”的引用'数据源';嵌套的异常是org.springframework.beans.factory.BeanCreationException:创建在ServletContext资源[/WEB-INF/classes/applicationContext.xml]中定义的名称为'dataSource'的bean时出错:设置属性值时出错;嵌套的异常是org.springframework.beans.PropertyBatchUpdateException;嵌套的PropertyAccessExceptions(1)是: PropertyAccessException 1:org.springframework.beans.MethodInvocationException:属性'driverClassName'抛出异常;嵌套异常为java.lang.IllegalStateException:无法加载JDBC驱动程序类[oracle.jdbc.driver.OracleDriver] 在org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveInnerBean(BeanDefinitionValueResolver.java:361)〜[spring-beans-5.1.8.RELEASE.jar:5.1.8.RELEASE] 在org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:124)〜[spring-beans-5.1.8.RELEASE.jar:5.1.8.RELEASE] 在org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1681)〜[spring-beans-5.1.8.RELEASE.jar:5.1.8.RELEASE] 在org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1433)〜[spring-beans-5.1.8.RELEASE.jar:5.1.8.RELEASE] 在org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:592)〜[spring-beans-5.1.8.RELEASE.jar:5.1.8.RELEASE] 在org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:515)〜[spring-beans-5.1.8.RELEASE.jar:5.1.8.RELEASE] 在org.springframework.beans.factory.support.AbstractBeanFactory.lambda $ doGetBean $ 0(AbstractBeanFactory.java:320)〜[spring-beans-5.1.8.RELEASE.jar:5.1.8.RELEASE] 在org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)〜[spring-beans-5.1.8.RELEASE.jar:5.1.8.RELEASE] 在org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:318)〜[spring-beans-5.1.8.RELEASE.jar:5.1.8.RELEASE] 在org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:204)〜[spring-beans-5.1.8.RELEASE.jar:5.1.8.RELEASE] 在org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:154)〜[spring-context-5.1.8.RELEASE.jar:5.1.8.RELEASE] 在org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:705)〜[spring-context-5.1.8.RELEASE.jar:5.1.8.RELEASE] 在org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:531)〜[spring-context-5.1.8.RELEASE.jar:5.1.8.RELEASE] 在org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:400)〜[spring-web-5.1.8.RELEASE.jar:5.1.8.RELEASE] 在org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:291)〜[spring-web-5.1.8.RELEASE.jar:5.1.8.RELEASE] 在org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:103)上[spring-web-5.1.8.RELEASE.jar:5.1.8.RELEASE] 在org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4812)[catalina.jar:8.0.32] 在org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5255)[catalina.jar:8.0.32] 在org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:147)[catalina.jar:8.0.32] 在org.apache.catalina.core.ContainerBase $ StartChild.call(ContainerBase.java:1408)[catalina.jar:8.0.32] 在org.apache.catalina.core.ContainerBase $ StartChild.call(ContainerBase.java:1398)[catalina.jar:8.0.32] 在java.util.concurrent.FutureTask.run(FutureTask.java:266)[na:1.8.0_231] 在java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)[na:1.8.0_231] 在java.util.concurrent.ThreadPoolExecutor $ Worker.run(ThreadPoolExecutor.java:624)[na:1.8.0_231] 在java.lang.Thread.run(Thread.java:748)[na:1.8.0_231] 由以下原因引起:org.springframework.beans.factory.BeanCreationException:在ServletContext资源[/WEB-INF/classes/applicationContext.xml]中定义的名称为'org.apache.commons.configuration2.ConfigurationConverter#23c78cc'的bean创建时出错。在设置构造函数参数时引用bean'domainConfiguration';嵌套的异常是org.springframework.beans.factory.BeanCreationException:创建在ServletContext资源[/WEB-INF/classes/applicationContext.xml]中定义的名称为“ domainConfiguration”的bean时出错:设置bean属性时无法解析对bean“ dataSource”的引用'数据源';嵌套的异常是org.springframework.beans.factory.BeanCreationException:创建在ServletContext资源[/WEB-INF/classes/applicationContext.xml]中定义的名称为'dataSource'的bean时出错:设置属性值时出错;嵌套的异常是org.springframework.beans.PropertyBatchUpdateException;嵌套的PropertyAccessExceptions(1)是: PropertyAccessException 1:org.springframework.beans.MethodInvocationException:属性'driverClassName'抛出异常;嵌套异常为java.lang.IllegalStateException:无法加载JDBC驱动程序类[oracle.jdbc.driver.OracleDriver] 在org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:314)〜[spring-beans-5.1.8.RELEASE.jar:5.1.8.RELEASE] 在org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:110)〜[spring-beans-5.1.8.RELEASE.jar:5.1.8.RELEASE] 在org.springframework.beans.factory.support.ConstructorResolver.resolveConstructorArguments(ConstructorResolver.java:676)〜[spring-beans-5.1.8.RELEASE.jar:5.1.8.RELEASE] 在org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:479)〜[spring-beans-5.1.8.RELEASE.jar:5.1.8.RELEASE] 在org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1321)〜[spring-beans-5.1.8.RELEASE.jar:5.1.8.RELEASE] 在org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1160)〜[spring-beans-5.1.8.RELEASE.jar:5.1.8.RELEASE]
答案 0 :(得分:0)
您收到此错误:Cannot resolve reference to bean 'dataSource' while setting bean property 'dataSource';
对于Property 'driverClassName' threw exception; nested exception is java.lang.IllegalStateException: Could not load JDBC driver class [oracle.jdbc.driver.OracleDriver] at
在application.properteis或application.yml中检查您的driverClassName。还要在tomcat中检查oracle驱动程序jar。