java.lang.NoClassDefFoundError: Could not initialize class com.baomidou.mybatisplus.toolkit.SqlUtils

x33g5p2x  于2022-07-26 转载在 Java  
字(1.7k)|赞(0)|评价(0)|浏览(609)

【现象】

java.lang.NoClassDefFoundError: Could not initialize class com.baomidou.mybatisplus.toolkit.SqlUtils
	at com.baomidou.mybatisplus.plugins.PaginationInterceptor.intercept(PaginationInterceptor.java:124)
	at org.apache.ibatis.plugin.Plugin.invoke(Plugin.java:61)
	at com.sun.proxy.$Proxy123.prepare(Unknown Source)
	at org.apache.ibatis.executor.SimpleExecutor.prepareStatement(SimpleExecutor.java:85)
	at org.apache.ibatis.executor.SimpleExecutor.doQuery(SimpleExecutor.java:62)
	at org.apache.ibatis.executor.BaseExecutor.queryFromDatabase(BaseExecutor.java:326)
	at org.apache.ibatis.executor.BaseExecutor.query(BaseExecutor.java:156)
	at org.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:109)
	at org.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:83)
	at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:148)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:433)
	at com.sun.proxy.$Proxy95.selectList(Unknown Source)

【解决方法】pom.xml文件中

<dependency>
	<groupId>com.baomidou</groupId>
	<artifactId>mybatis-plus-support</artifactId>
	<version>2.3.2</version>
	<scope>compile</scope>
</dependency>
修改为:
<dependency>
	<groupId>com.baomidou</groupId>
	<artifactId>mybatis-plus-support</artifactId>
	<version>2.3.2</version>
</dependency>

相关文章