警告: Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'pooledDataSource' defined in class path resource [applicationcontext.xml]: Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanExpressionException: Expression parsing failed; nested exception is org.springframework.expression.spel.SpelEvaluationException: EL1008E:(pos 0): Property or field 'jdbc' cannot be found on object of type 'org.springframework.beans.factory.config.BeanExpressionContext' - maybe not public?
Jan 11, 2023 12:08:28 AM org.springframework.test.context.TestContextManager prepareTestInstance
严重: Caught exception while allowing TestExecutionListener [org.springframework.test.context.web.ServletTestExecutionListener@617c74e5] to prepare test instance [com.crud.test.MapperTest@4671115f]
java.lang.IllegalStateException: Failed to load ApplicationContext
Caused by: org.springframework.beans.factory.BeanExpressionException: Expression parsing failed; nested exception is org.springframework.expression.spel.SpelEvaluationException: EL1008E:(pos 0): Property or field 'jdbc' cannot be found on object of type 'org.springframework.beans.factory.config.BeanExpressionContext' - maybe not public?
Caused by: org.springframework.expression.spel.SpelEvaluationException: EL1008E:(pos 0): Property or field 'jdbc' cannot be found on object of type 'org.springframework.beans.factory.config.BeanExpressionContext' - maybe not public?
你引入了jdbc的依赖,就要在配置文件配置jdbc的链接,要不然就排除这个类
程序发送在初始化时报错,报错信息是applicationcontext.xml里面的'jdbc'找不到。 要看下你的jdbc的配置哦
F:\Java\jdk1.8.0_66\bin\java.exe -javaagent:F:\idea2018\Idea\Idea\ideaIU-2018.1.1.win\lib\idea_rt.jar=6604:F:\idea2018\Idea\Idea\ideaIU-2018.1.1.win\bin -Dfile.encoding=UTF-8 -classpath F:\Java\jdk1.8.0_66\jre\lib\charsets.jar;F:\Java\jdk1.8.0_66\jre\lib\deploy.jar;F:\Java\jdk1.8.0_66\jre\lib\ext\access-bridge-64.jar;F:\Java\jdk1.8.0_66\jre\lib\ext\cldrdata.jar;F:\Java\jdk1.8.0_66\jre\lib\ext\dnsns.jar;F:\Java\jdk1.8.0_66\jre\lib\ext\jaccess.jar;F:\Java\jdk1.8.0_66\jre\lib\ext\jfxrt.jar;F:\Java\jdk1.8.0_66\jre\lib\ext\localedata.jar;F:\Java\jdk1.8.0_66\jre\lib\ext\nashorn.jar;F:\Java\jdk1.8.0_66\jre\lib\ext\sunec.jar;F:\Java\jdk1.8.0_66\jre\lib\ext\sunjce_provider.jar;F:\Java\jdk1.8.0_66\jre\lib\ext\sunmscapi.jar;F:\Java\jdk1.8.0_66\jre\lib\ext\sunpkcs11.jar;F:\Java\jdk1.8.0_66\jre\lib\ext\zipfs.jar;F:\Java\jdk1.8.0_66\jre\lib\javaws.jar;F:\Java\jdk1.8.0_66\jre\lib\jce.jar;F:\Java\jdk1.8.0_66\jre\lib\jfr.jar;F:\Java\jdk1.8.0_66\jre\lib\jfxswt.jar;F:\Java\jdk1.8.0_66\jre\lib\jsse.jar;F:\Java\jdk1.8.0_66\jre\lib\management-agent.jar;F:\Java\jdk1.8.0_66\jre\lib\plugin.jar;F:\Java\jdk1.8.0_66\jre\lib\resources.jar;F:\Java\jdk1.8.0_66\jre\lib\rt.jar;F:\workspaceStudy\My_Spring_Demo\target\classes;F:\JavaTool\apache-maven-3.5.4-bin\repository\repository\org\springframework\spring-context\5.0.2.RELEASE\spring-context-5.0.2.RELEASE.jar;F:\JavaTool\apache-maven-3.5.4-bin\repository\repository\org\springframework\spring-aop\5.0.2.RELEASE\spring-aop-5.0.2.RELEASE.jar;F:\JavaTool\apache-maven-3.5.4-bin\repository\repository\org\springframework\spring-beans\5.0.2.RELEASE\spring-beans-5.0.2.RELEASE.jar;F:\JavaTool\apache-maven-3.5.4-bin\repository\repository\org\springframework\spring-core\5.0.2.RELEASE\spring-core-5.0.2.RELEASE.jar;F:\JavaTool\apache-maven-3.5.4-bin\repository\repository\org\springframework\spring-jcl\5.0.2.RELEASE\spring-jcl-5.0.2.RELEASE.jar;F:\JavaTool\apache-maven-3.5.4-bin\repository\repository\org\springframework\spring-expression\5.0.2.RELEASE\spring-expression-5.0.2.RELEASE.jar com.cumd.servlet.Client
十月 07, 2019 10:37:02 上午 org.springframework.context.support.AbstractApplicationContext prepareRefresh
信息: Refreshing org.springframework.context.support.ClassPathXmlApplicationContext@736e9adb: startup date [Mon Oct 07 10:37:02 CST 2019]; root of context hierarchy
十月 07, 2019 10:37:02 上午 org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions
信息: Loading XML bean definitions from class path resource [applicationContext.xml]
十月 07, 2019 10:37:02 上午 org.springframework.context.support.AbstractApplicationContext refresh
警告: Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'accountService' defined in class path resource [applicationContext.xml]: Error setting property values; nested exception is org.springframework.beans.NotWritablePropertyException: Invalid property 'names' of bean class [com.cumd.service.impl.AccountServiceImpl]: Bean property 'names' is not writable or has an invalid setter method. Does the parameter type of the setter match the return type of the getter?
Exception in thread "main" org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'accountService' defined in class path resource [applicationContext.xml]: Error setting property values; nested exception is org.springframework.beans.NotWritablePropertyException: Invalid property 'names' of bean class [com.cumd.service.impl.AccountServiceImpl]: Bean property 'names' is not writable or has an invalid setter method. Does the parameter type of the setter match the return type of the getter?
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1650)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1357)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:582)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:502)
at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:312)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:228)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:310)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:200)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:758)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:868)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:549)
at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:144)
at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:85)
at com.cumd.servlet.Client.main(Client.java:15)
Caused by: org.springframework.beans.NotWritablePropertyException: Invalid property 'names' of bean class [com.cumd.service.impl.AccountServiceImpl]: Bean property 'names' is not writable or has an invalid setter method. Does the parameter type of the setter match the return type of the getter?
at org.springframework.beans.BeanWrapperImpl.createNotWritablePropertyException(BeanWrapperImpl.java:247)
at org.springframework.beans.AbstractNestablePropertyAccessor.processLocalProperty(AbstractNestablePropertyAccessor.java:426)
at org.springframework.beans.AbstractNestablePropertyAccessor.setPropertyValue(AbstractNestablePropertyAccessor.java:278)
at org.springframework.beans.AbstractNestablePropertyAccessor.setPropertyValue(AbstractNestablePropertyAccessor.java:266)
at org.springframework.beans.AbstractPropertyAccessor.setPropertyValues(AbstractPropertyAccessor.java:97)
at org.springframework.beans.AbstractPropertyAccessor.setPropertyValues(AbstractPropertyAccessor.java:77)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1646)
... 13 more
Process finished with exit code 1
解决方案:配置文件的错误,修改配置文件