问答详情
源自:8-1 整合MyBatis - 使用generatorConfig生成mapper以及pojo

逆向工程,java.lang.RuntimeException: Exception getting JDBC Driver

java.lang.RuntimeException: Exception getting JDBC Driver

at org.mybatis.generator.internal.db.ConnectionFactory.getDriver(ConnectionFactory.java:85)

at org.mybatis.generator.internal.db.ConnectionFactory.getConnection(ConnectionFactory.java:54)

at org.mybatis.generator.config.Context.getConnection(Context.java:526)

at org.mybatis.generator.config.Context.introspectTables(Context.java:436)

at org.mybatis.generator.api.MyBatisGenerator.generate(MyBatisGenerator.java:222)

at org.mybatis.generator.api.MyBatisGenerator.generate(MyBatisGenerator.java:133)

at com.example.mapper.GeneratorDisplay.generator(GeneratorDisplay.java:27)

at com.example.mapper.GeneratorDisplay.main(GeneratorDisplay.java:34)

Caused by: java.lang.ClassNotFoundException: com.mysql.jdbc.Drive

at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:641)

at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188)

at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:520)

at java.base/java.lang.Class.forName0(Native Method)

at java.base/java.lang.Class.forName(Class.java:467)

at org.mybatis.generator.internal.ObjectFactory.internalClassForName(ObjectFactory.java:150)

at org.mybatis.generator.internal.ObjectFactory.externalClassForName(ObjectFactory.java:121)

at org.mybatis.generator.internal.db.ConnectionFactory.getDriver(ConnectionFactory.java:82)

... 7 more


提问者:王培超 2022-07-03 14:37

个回答