700字范文,内容丰富有趣,生活中的好帮手!
700字范文 > methodinvocationexception: property ‘driverclassname‘ threw exception; nested exception is java.lang

methodinvocationexception: property ‘driverclassname‘ threw exception; nested exception is java.lang

时间:2019-11-03 02:04:19

相关推荐

methodinvocationexception: property ‘driverclassname‘ threw exception; nested exception is java.lang

抛出异常:

"D:\Program Files\Java\jdk1.8.0_131\bin\java.exe" "-javaagent:D:\Program Files (x86)\IntelliJ IDEA .1.1\lib\idea_rt.jar=1029:D:\Program Files (x86)\IntelliJ IDEA .1.1\bin" -Dfile.encoding=UTF-8 -classpath "D:\Program Files\Java\jdk1.8.0_131\jre\lib\charsets.jar;D:\Program Files\Java\jdk1.8.0_131\jre\lib\deploy.jar;D:\Program Files\Java\jdk1.8.0_131\jre\lib\ext\access-bridge-64.jar;D:\Program Files\Java\jdk1.8.0_131\jre\lib\ext\cldrdata.jar;D:\Program Files\Java\jdk1.8.0_131\jre\lib\ext\dnsns.jar;D:\Program Files\Java\jdk1.8.0_131\jre\lib\ext\jaccess.jar;D:\Program Files\Java\jdk1.8.0_131\jre\lib\ext\jfxrt.jar;D:\Program Files\Java\jdk1.8.0_131\jre\lib\ext\localedata.jar;D:\Program Files\Java\jdk1.8.0_131\jre\lib\ext\nashorn.jar;D:\Program Files\Java\jdk1.8.0_131\jre\lib\ext\sunec.jar;D:\Program Files\Java\jdk1.8.0_131\jre\lib\ext\sunjce_provider.jar;D:\Program Files\Java\jdk1.8.0_131\jre\lib\ext\sunmscapi.jar;D:\Program Files\Java\jdk1.8.0_131\jre\lib\ext\sunpkcs11.jar;D:\Program Files\Java\jdk1.8.0_131\jre\lib\ext\zipfs.jar;D:\Program Files\Java\jdk1.8.0_131\jre\lib\javaws.jar;D:\Program Files\Java\jdk1.8.0_131\jre\lib\jce.jar;D:\Program Files\Java\jdk1.8.0_131\jre\lib\jfr.jar;D:\Program Files\Java\jdk1.8.0_131\jre\lib\jfxswt.jar;D:\Program Files\Java\jdk1.8.0_131\jre\lib\jsse.jar;D:\Program Files\Java\jdk1.8.0_131\jre\lib\management-agent.jar;D:\Program Files\Java\jdk1.8.0_131\jre\lib\plugin.jar;D:\Program Files\Java\jdk1.8.0_131\jre\lib\resources.jar;D:\Program Files\Java\jdk1.8.0_131\jre\lib\rt.jar;D:\my\S3\SSM\top5-Spring\SpringDemo\out\production\SpringDemo;D:\my\S3\SSM\top5-Spring\SpringDemo\libs\log4j-1.2.17.jar;D:\my\S3\SSM\top5-Spring\SpringDemo\libs\aopalliance-1.0.jar;D:\my\S3\SSM\top5-Spring\SpringDemo\libs\commons-logging-1.2.jar;D:\my\S3\SSM\top5-Spring\SpringDemo\libs\spring-tx-5.2.3.RELEASE.jar;D:\my\S3\SSM\top5-Spring\SpringDemo\libs\spring-aop-5.2.3.RELEASE.jar;D:\my\S3\SSM\top5-Spring\SpringDemo\libs\spring-jms-5.2.3.RELEASE.jar;D:\my\S3\SSM\top5-Spring\SpringDemo\libs\spring-orm-5.2.3.RELEASE.jar;D:\my\S3\SSM\top5-Spring\SpringDemo\libs\spring-oxm-5.2.3.RELEASE.jar;D:\my\S3\SSM\top5-Spring\SpringDemo\libs\spring-core-5.2.3.RELEASE.jar;D:\my\S3\SSM\top5-Spring\SpringDemo\libs\spring-jdbc-5.2.3.RELEASE.jar;D:\my\S3\SSM\top5-Spring\SpringDemo\libs\spring-test-5.2.3.RELEASE.jar;D:\my\S3\SSM\top5-Spring\SpringDemo\libs\spring-beans-5.2.3.RELEASE.jar;D:\my\S3\SSM\top5-Spring\SpringDemo\libs\spring-core-3.2.13.RELEASE.jar;D:\my\S3\SSM\top5-Spring\SpringDemo\libs\spring-beans-3.2.13.RELEASE.jar;D:\my\S3\SSM\top5-Spring\SpringDemo\libs\spring-aspects-5.2.3.RELEASE.jar;D:\my\S3\SSM\top5-Spring\SpringDemo\libs\spring-context-5.2.3.RELEASE.jar;D:\my\S3\SSM\top5-Spring\SpringDemo\libs\spring-context-3.2.13.RELEASE.jar;D:\my\S3\SSM\top5-Spring\SpringDemo\libs\spring-messaging-5.2.3.RELEASE.jar;D:\my\S3\SSM\top5-Spring\SpringDemo\libs\spring-expression-5.2.3.RELEASE.jar;D:\my\S3\SSM\top5-Spring\SpringDemo\libs\spring-instrument-5.2.3.RELEASE.jar;D:\my\S3\SSM\top5-Spring\SpringDemo\libs\spring-expression-3.2.13.RELEASE.jar;D:\my\S3\SSM\top5-Spring\SpringDemo\libs\spring-context-support-5.2.3.RELEASE.jar;D:\my\S3\SSM\top5-Spring\sources\util\aopalliance-core-1.1.1.7-jre8.jar;D:\my\S3\SSM\top5-Spring\sources\util\.aspectj.weaver-1.7.2.RELEASE.jar;D:\my\S3\SSM\top5-Spring\sources\util\commons-logging-1.1.3.jar" bdqn.springJDBC.testJdbc.TestTemplatelog4j:ERROR Unexpected char [[] at position 11 in conversion patterrn.log4j:ERROR Unexpected char [[] at position 11 in conversion patterrn.-09-29 10:03:03,997 DEBUG %[l] Refreshing org.springframework.context.support.ClassPathXmlApplicationContext@7d6f77cc -09-29 10:03:04,432 DEBUG %[l] Loaded 3 bean definitions from class path resource [spring-jdbc.xml] -09-29 10:03:04,500 DEBUG %[l] Creating shared instance of singleton bean 'org.springframework.context.support.PropertySourcesPlaceholderConfigurer#0' -09-29 10:03:04,595 DEBUG %[l] Found key 'driver' in PropertySource 'localProperties' with value of type String -09-29 10:03:04,595 DEBUG %[l] Found key 'url' in PropertySource 'localProperties' with value of type String -09-29 10:03:04,596 DEBUG %[l] Found key 'user' in PropertySource 'localProperties' with value of type String -09-29 10:03:04,596 DEBUG %[l] Found key 'password' in PropertySource 'localProperties' with value of type String -09-29 10:03:04,603 DEBUG %[l] Creating shared instance of singleton bean 'dataSource' -09-29 10:03:04,621 WARN %[l] Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource' defined in class path resource [spring-jdbc.xml]: Error setting property values; nested exception is org.springframework.beans.PropertyBatchUpdateException; nested PropertyAccessExceptions (1) are:PropertyAccessException 1: org.springframework.beans.MethodInvocationException: Property 'driverClassName' threw exception; nested exception is java.lang.IllegalStateException: Could not load JDBC driver class [com.mysql.jdbc.Driver] Exception in thread "main" org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource' defined in class path resource [spring-jdbc.xml]: Error setting property values; nested exception is org.springframework.beans.PropertyBatchUpdateException; nested PropertyAccessExceptions (1) are:PropertyAccessException 1: org.springframework.beans.MethodInvocationException: Property 'driverClassName' threw exception; nested exception is java.lang.IllegalStateException: Could not load JDBC driver class [com.mysql.jdbc.Driver]at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1736)at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1444)at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:594)at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:517)at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:323)at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:321)at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202)at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:879)at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:878)at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:550)at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:144)at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:85)at bdqn.springJDBC.testJdbc.TestTemplate.main(TestTemplate.java:10)Caused by: org.springframework.beans.PropertyBatchUpdateException; nested PropertyAccessExceptions (1) are:PropertyAccessException 1: org.springframework.beans.MethodInvocationException: Property 'driverClassName' threw exception; nested exception is java.lang.IllegalStateException: Could not load JDBC driver class [com.mysql.jdbc.Driver]at org.springframework.beans.AbstractPropertyAccessor.setPropertyValues(AbstractPropertyAccessor.java:122)at org.springframework.beans.AbstractPropertyAccessor.setPropertyValues(AbstractPropertyAccessor.java:77)at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1732)... 13 moreProcess finished with exit code 1

原因:

Property 'driverClassName' threw exception; nested exception is java.lang.IllegalStateException: Could not load JDBC driver class [com.mysql.jdbc.Driver]

这个很明显时告诉你加载不到这个类com.mysql.jdbc.Driver,通常来说是缺少mysql-connector-java.jar。因为这个类就是这个jar中的。

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。