以下为报错
E:\JDK\bin\java.exe -XX:TieredStopAtLevel=1 -noverify -Dspring.output.ansi.enabled=always -Dcom.sun.management.jmxremote -Dspring.jmx.enabled=true -Dspring.liveBeansView.mbeanDomain -Dspring.application.admin.enabled=true "-Dmanagement.endpoints.jmx.exposure.include=*" "-javaagent:E:\IDEA\IntelliJ IDEA 2023.2.1\lib\idea_rt.jar=55927:E:\IDEA\IntelliJ IDEA 2023.2.1\bin" -Dfile.encoding=UTF-8 -classpath E:\JDK\jre\lib\charsets.jar;E:\JDK\jre\lib\deploy.jar;E:\JDK\jre\lib\ext\access-bridge-64.jar;E:\JDK\jre\lib\ext\cldrdata.jar;E:\JDK\jre\lib\ext\dnsns.jar;E:\JDK\jre\lib\ext\jaccess.jar;E:\JDK\jre\lib\ext\jfxrt.jar;E:\JDK\jre\lib\ext\localedata.jar;E:\JDK\jre\lib\ext\nashorn.jar;E:\JDK\jre\lib\ext\sunec.jar;E:\JDK\jre\lib\ext\sunjce_provider.jar;E:\JDK\jre\lib\ext\sunmscapi.jar;E:\JDK\jre\lib\ext\sunpkcs11.jar;E:\JDK\jre\lib\ext\zipfs.jar;E:\JDK\jre\lib\javaws.jar;E:\JDK\jre\lib\jce.jar;E:\JDK\jre\lib\jfr.jar;E:\JDK\jre\lib\jfxswt.jar;E:\JDK\jre\lib\jsse.jar;E:\JDK\jre\lib\management-agent.jar;E:\JDK\jre\lib\plugin.jar;E:\JDK\jre\lib\resources.jar;E:\JDK\jre\lib\rt.jar;E:\0492201Class\SpringBoot\SpringbootSoft\Maven\Code\Chater3Test1_420\target\classes;E:\0492201Class\SpringBoot\SpringbootSoft\Maven\maven-repository\com\alibaba\druid-spring-boot-starter\1.1.10\druid-spring-boot-starter-1.1.10.jar;E:\0492201Class\SpringBoot\SpringbootSoft\Maven\maven-repository\com\alibaba\druid\1.1.10\druid-1.1.10.jar;E:\0492201Class\SpringBoot\SpringbootSoft\Maven\maven-repository\org\slf4j\slf4j-api\1.7.36\slf4j-api-1.7.36.jar;E:\0492201Class\SpringBoot\SpringbootSoft\Maven\maven-repository\org\springframework\boot\spring-boot-autoconfigure\2.6.13\spring-boot-autoconfigure-2.6.13.jar;E:\0492201Class\SpringBoot\SpringbootSoft\Maven\maven-repository\org\springframework\boot\spring-boot\2.6.13\spring-boot-2.6.13.jar;E:\0492201Class\SpringBoot\SpringbootSoft\Maven\maven-repository\org\springframework\boot\spring-boot-starter-data-jdbc\2.6.13\spring-boot-starter-data-jdbc-2.6.13.jar;E:\0492201Class\SpringBoot\SpringbootSoft\Maven\maven-repository\org\springframework\boot\spring-boot-starter-jdbc\2.6.13\spring-boot-starter-jdbc-2.6.13.jar;E:\0492201Class\SpringBoot\SpringbootSoft\Maven\maven-repository\com\zaxxer\HikariCP\4.0.3\HikariCP-4.0.3.jar;E:\0492201Class\SpringBoot\SpringbootSoft\Maven\maven-repository\org\springframework\spring-jdbc\5.3.23\spring-jdbc-5.3.23.jar;E:\0492201Class\SpringBoot\SpringbootSoft\Maven\maven-repository\org\springframework\data\spring-data-jdbc\2.3.9\spring-data-jdbc-2.3.9.jar;E:\0492201Class\SpringBoot\SpringbootSoft\Maven\maven-repository\org\springframework\data\spring-data-relational\2.3.9\spring-data-relational-2.3.9.jar;E:\0492201Class\SpringBoot\SpringbootSoft\Maven\maven-repository\org\springframework\data\spring-data-commons\2.6.9\spring-data-commons-2.6.9.jar;E:\0492201Class\SpringBoot\SpringbootSoft\Maven\maven-repository\org\springframework\spring-tx\5.3.23\spring-tx-5.3.23.jar;E:\0492201Class\SpringBoot\SpringbootSoft\Maven\maven-repository\org\springframework\spring-context\5.3.23\spring-context-5.3.23.jar;E:\0492201Class\SpringBoot\SpringbootSoft\Maven\maven-repository\org\springframework\spring-beans\5.3.23\spring-beans-5.3.23.jar;E:\0492201Class\SpringBoot\SpringbootSoft\Maven\maven-repository\org\springframework\boot\spring-boot-starter-web\2.6.13\spring-boot-starter-web-2.6.13.jar;E:\0492201Class\SpringBoot\SpringbootSoft\Maven\maven-repository\org\springframework\boot\spring-boot-starter\2.6.13\spring-boot-starter-2.6.13.jar;E:\0492201Class\SpringBoot\SpringbootSoft\Maven\maven-repository\org\springframework\boot\spring-boot-starter-logging\2.6.13\spring-boot-starter-logging-2.6.13.jar;E:\0492201Class\SpringBoot\SpringbootSoft\Maven\maven-repository\ch\qos\logback\logback-classic\1.2.11\logback-classic-1.2.11.jar;E:\0492201Class\SpringBoot\SpringbootSoft\Maven\maven-repository\ch\qos\logback\logback-core\1.2.11\logback-core-1.2.11.jar;E:\0492201Class\SpringBoot\SpringbootSoft\Maven\maven-repository\org\apache\logging\log4j\log4j-to-slf4j\2.17.2\log4j-to-slf4j-2.17.2.jar;E:\0492201Class\SpringBoot\SpringbootSoft\Maven\maven-repository\org\apache\logging\log4j\log4j-api\2.17.2\log4j-api-2.17.2.jar;E:\0492201Class\SpringBoot\SpringbootSoft\Maven\maven-repository\org\slf4j\jul-to-slf4j\1.7.36\jul-to-slf4j-1.7.36.jar;E:\0492201Class\SpringBoot\SpringbootSoft\Maven\maven-repository\jakarta\annotation\jakarta.annotation-api\1.3.5\jakarta.annotation-api-1.3.5.jar;E:\0492201Class\SpringBoot\SpringbootSoft\Maven\maven-repository\org\yaml\snakeyaml\1.29\snakeyaml-1.29.jar;E:\0492201Class\SpringBoot\SpringbootSoft\Maven\maven-repository\org\springframework\boot\spring-boot-starter-json\2.6.13\spring-boot-starter-json-2.6.13.jar;E:\0492201Class\SpringBoot\SpringbootSoft\Maven\maven-repository\com\fasterxml\jackson\core\jackson-databind\2.13.4.2\jackson-databind-2.13.4.2.jar;E:\0492201Class\SpringBoot\SpringbootSoft\Maven\maven-repository\com\fasterxml\jackson\core\jackson-annotations\2.13.4\jackson-annotations-2.13.4.jar;E:\0492201Class\SpringBoot\SpringbootSoft\Maven\maven-repository\com\fasterxml\jackson\core\jackson-core\2.13.4\jackson-core-2.13.4.jar;E:\0492201Class\SpringBoot\SpringbootSoft\Maven\maven-repository\com\fasterxml\jackson\datatype\jackson-datatype-jdk8\2.13.4\jackson-datatype-jdk8-2.13.4.jar;E:\0492201Class\SpringBoot\SpringbootSoft\Maven\maven-repository\com\fasterxml\jackson\datatype\jackson-datatype-jsr310\2.13.4\jackson-datatype-jsr310-2.13.4.jar;E:\0492201Class\SpringBoot\SpringbootSoft\Maven\maven-repository\com\fasterxml\jackson\module\jackson-module-parameter-names\2.13.4\jackson-module-parameter-names-2.13.4.jar;E:\0492201Class\SpringBoot\SpringbootSoft\Maven\maven-repository\org\springframework\boot\spring-boot-starter-tomcat\2.6.13\spring-boot-starter-tomcat-2.6.13.jar;E:\0492201Class\SpringBoot\SpringbootSoft\Maven\maven-repository\org\apache\tomcat\embed\tomcat-embed-core\9.0.68\tomcat-embed-core-9.0.68.jar;E:\0492201Class\SpringBoot\SpringbootSoft\Maven\maven-repository\org\apache\tomcat\embed\tomcat-embed-el\9.0.68\tomcat-embed-el-9.0.68.jar;E:\0492201Class\SpringBoot\SpringbootSoft\Maven\maven-repository\org\apache\tomcat\embed\tomcat-embed-websocket\9.0.68\tomcat-embed-websocket-9.0.68.jar;E:\0492201Class\SpringBoot\SpringbootSoft\Maven\maven-repository\org\springframework\spring-web\5.3.23\spring-web-5.3.23.jar;E:\0492201Class\SpringBoot\SpringbootSoft\Maven\maven-repository\org\springframework\spring-webmvc\5.3.23\spring-webmvc-5.3.23.jar;E:\0492201Class\SpringBoot\SpringbootSoft\Maven\maven-repository\org\springframework\spring-aop\5.3.23\spring-aop-5.3.23.jar;E:\0492201Class\SpringBoot\SpringbootSoft\Maven\maven-repository\org\springframework\spring-expression\5.3.23\spring-expression-5.3.23.jar;E:\0492201Class\SpringBoot\SpringbootSoft\Maven\maven-repository\mysql\mysql-connector-java\5.1.44\mysql-connector-java-5.1.44.jar;E:\0492201Class\SpringBoot\SpringbootSoft\Maven\maven-repository\org\springframework\spring-core\5.3.23\spring-core-5.3.23.jar;E:\0492201Class\SpringBoot\SpringbootSoft\Maven\maven-repository\org\springframework\spring-jcl\5.3.23\spring-jcl-5.3.23.jar com.example.chater3test1_420.Chater3Test1420Application
. ____ _ __ _ _
/\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
\\/ ___)| |_)| | | | | || (_| | ) ) ) )
' |____| .__|_| |_|_| |_\__, | / / / /
=========|_|==============|___/=/_/_/_/
:: Spring Boot :: (v2.6.13)
2024-04-20 17:44:51.234 INFO 1212 --- [ main] c.e.c.Chater3Test1420Application : Starting Chater3Test1420Application using Java 1.8.0_311 on DESKTOP-IA1HFRH with PID 1212 (E:\0492201Class\SpringBoot\SpringbootSoft\Maven\Code\Chater3Test1_420\target\classes started by DELL in E:\0492201Class\SpringBoot\SpringbootSoft\Maven\Code\Chater3Test1_420)
2024-04-20 17:44:51.237 INFO 1212 --- [ main] c.e.c.Chater3Test1420Application : No active profile set, falling back to 1 default profile: "default"
2024-04-20 17:44:51.732 INFO 1212 --- [ main] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data JDBC repositories in DEFAULT mode.
2024-04-20 17:44:51.740 INFO 1212 --- [ main] .s.d.r.c.RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 4 ms. Found 0 JDBC repository interfaces.
2024-04-20 17:44:52.107 INFO 1212 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port(s): 8080 (http)
2024-04-20 17:44:52.123 INFO 1212 --- [ main] o.apache.catalina.core.StandardService : Starting service [Tomcat]
2024-04-20 17:44:52.123 INFO 1212 --- [ main] org.apache.catalina.core.StandardEngine : Starting Servlet engine: [Apache Tomcat/9.0.68]
2024-04-20 17:44:52.227 INFO 1212 --- [ main] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext
2024-04-20 17:44:52.227 INFO 1212 --- [ main] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 954 ms
2024-04-20 17:44:52.428 INFO 1212 --- [ main] o.s.b.a.w.s.WelcomePageHandlerMapping : Adding welcome page: class path resource [static/index.html]
2024-04-20 17:44:52.499 INFO 1212 --- [ main] c.a.d.s.b.a.DruidDataSourceAutoConfigure : Init DruidDataSource
2024-04-20 17:44:52.576 ERROR 1212 --- [ main] com.alibaba.druid.pool.DruidDataSource : {dataSource-1} init error
java.sql.SQLException: com.mysql.cj.jdbc.Driver
at com.alibaba.druid.util.JdbcUtils.createDriver(JdbcUtils.java:600) ~[druid-1.1.10.jar:1.1.10]
at com.alibaba.druid.pool.DruidDataSource.init(DruidDataSource.java:817) ~[druid-1.1.10.jar:1.1.10]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_311]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_311]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_311]
at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_311]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeCustomInitMethod(AbstractAutowireCapableBeanFactory.java:1930) [spring-beans-5.3.23.jar:5.3.23]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1872) [spring-beans-5.3.23.jar:5.3.23]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1800) [spring-beans-5.3.23.jar:5.3.23]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:620) [spring-beans-5.3.23.jar:5.3.23]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:542) [spring-beans-5.3.23.jar:5.3.23]
at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335) [spring-beans-5.3.23.jar:5.3.23]
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) ~[spring-beans-5.3.23.jar:5.3.23]
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333) [spring-beans-5.3.23.jar:5.3.23]
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208) [spring-beans-5.3.23.jar:5.3.23]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:955) ~[spring-beans-5.3.23.jar:5.3.23]
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:918) ~[spring-context-5.3.23.jar:5.3.23]
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:583) ~[spring-context-5.3.23.jar:5.3.23]
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:145) ~[spring-boot-2.6.13.jar:2.6.13]
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:745) ~[spring-boot-2.6.13.jar:2.6.13]
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:420) ~[spring-boot-2.6.13.jar:2.6.13]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:307) ~[spring-boot-2.6.13.jar:2.6.13]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1317) ~[spring-boot-2.6.13.jar:2.6.13]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1306) ~[spring-boot-2.6.13.jar:2.6.13]
at com.example.chater3test1_420.Chater3Test1420Application.main(Chater3Test1420Application.java:10) ~[classes/:na]
Caused by: java.lang.ClassNotFoundException: com.mysql.cj.jdbc.Driver
at java.net.URLClassLoader.findClass(URLClassLoader.java:387) ~[na:1.8.0_311]
at java.lang.ClassLoader.loadClass(ClassLoader.java:418) ~[na:1.8.0_311]
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:355) ~[na:1.8.0_311]
at java.lang.ClassLoader.loadClass(ClassLoader.java:351) ~[na:1.8.0_311]
at java.lang.Class.forName0(Native Method) ~[na:1.8.0_311]
at java.lang.Class.forName(Class.java:264) ~[na:1.8.0_311]
at com.alibaba.druid.util.JdbcUtils.createDriver(JdbcUtils.java:598) ~[druid-1.1.10.jar:1.1.10]
... 24 common frames omitted
2024-04-20 17:44:52.577 WARN 1212 --- [ main] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource' defined in class path resource [com/alibaba/druid/spring/boot/autoconfigure/DruidDataSourceAutoConfigure.class]: Invocation of init method failed; nested exception is java.sql.SQLException: com.mysql.cj.jdbc.Driver
2024-04-20 17:44:52.579 INFO 1212 --- [ main] o.apache.catalina.core.StandardService : Stopping service [Tomcat]
2024-04-20 17:44:52.588 INFO 1212 --- [ main] ConditionEvaluationReportLoggingListener :
Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2024-04-20 17:44:52.604 ERROR 1212 --- [ main] o.s.boot.SpringApplication : Application run failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource' defined in class path resource [com/alibaba/druid/spring/boot/autoconfigure/DruidDataSourceAutoConfigure.class]: Invocation of init method failed; nested exception is java.sql.SQLException: com.mysql.cj.jdbc.Driver
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1804) ~[spring-beans-5.3.23.jar:5.3.23]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:620) ~[spring-beans-5.3.23.jar:5.3.23]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:542) ~[spring-beans-5.3.23.jar:5.3.23]
at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335) ~[spring-beans-5.3.23.jar:5.3.23]
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) ~[spring-beans-5.3.23.jar:5.3.23]
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333) ~[spring-beans-5.3.23.jar:5.3.23]
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208) ~[spring-beans-5.3.23.jar:5.3.23]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:955) ~[spring-beans-5.3.23.jar:5.3.23]
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:918) ~[spring-context-5.3.23.jar:5.3.23]
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:583) ~[spring-context-5.3.23.jar:5.3.23]
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:145) ~[spring-boot-2.6.13.jar:2.6.13]
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:745) [spring-boot-2.6.13.jar:2.6.13]
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:420) [spring-boot-2.6.13.jar:2.6.13]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:307) [spring-boot-2.6.13.jar:2.6.13]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1317) [spring-boot-2.6.13.jar:2.6.13]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1306) [spring-boot-2.6.13.jar:2.6.13]
at com.example.chater3test1_420.Chater3Test1420Application.main(Chater3Test1420Application.java:10) [classes/:na]
Caused by: java.sql.SQLException: com.mysql.cj.jdbc.Driver
at com.alibaba.druid.util.JdbcUtils.createDriver(JdbcUtils.java:600) ~[druid-1.1.10.jar:1.1.10]
at com.alibaba.druid.pool.DruidDataSource.init(DruidDataSource.java:817) ~[druid-1.1.10.jar:1.1.10]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_311]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_311]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_311]
at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_311]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeCustomInitMethod(AbstractAutowireCapableBeanFactory.java:1930) ~[spring-beans-5.3.23.jar:5.3.23]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1872) ~[spring-beans-5.3.23.jar:5.3.23]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1800) ~[spring-beans-5.3.23.jar:5.3.23]
... 16 common frames omitted
Caused by: java.lang.ClassNotFoundException: com.mysql.cj.jdbc.Driver
at java.net.URLClassLoader.findClass(URLClassLoader.java:387) ~[na:1.8.0_311]
at java.lang.ClassLoader.loadClass(ClassLoader.java:418) ~[na:1.8.0_311]
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:355) ~[na:1.8.0_311]
at java.lang.ClassLoader.loadClass(ClassLoader.java:351) ~[na:1.8.0_311]
at java.lang.Class.forName0(Native Method) ~[na:1.8.0_311]
at java.lang.Class.forName(Class.java:264) ~[na:1.8.0_311]
at com.alibaba.druid.util.JdbcUtils.createDriver(JdbcUtils.java:598) ~[druid-1.1.10.jar:1.1.10]
... 24 common frames omitted
进程已结束,退出代码为 1
编程用的idea,数据库是mysql
求会解决这个报错的大神帮忙!!!!!