java.lang.NoClassDefFoundError - com.github.pagehelper.PageHelper at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass 해결법

728x90

com.github.pagehelper.PageHelper at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass

페이지 리스트 구현을 하기 위해서 github.pagehelper.PageHelper 라이브러리를 가져와서 실행했는데 위와같은 오류가 나옴. 분명 dependency랑 application property를 수정했는데 클래스를 찾지못했다고;;;

 

당황했지만 클래스를 찾지못했다는 문제를 알 수 있었고 그 문제를 해결하기 위해 JAR파일을 classpath에 추가했더니 해결

 

해결법 한줄 요약: 아래 dependency랑 application property에 문제가 없다면 프로젝트 classpath에 JAR파일 추가

 

porm 파일

<!-- https://mvnrepository.com/artifact/org.mybatis/mybatis -->
<dependency>
    <groupId>org.mybatis.spring.boot</groupId>
    <artifactId>mybatis-spring-boot-starter</artifactId>
    <version>2.2.2</version>
</dependency>

<!--  MyBatis PageHelper -->
<!-- https://mvnrepository.com/artifact/com.github.pagehelper/pagehelper-spring-boot-starter -->
		<dependency>
		    <groupId>com.github.pagehelper</groupId>
		    <artifactId>pagehelper-spring-boot-starter</artifactId>
		    <version>1.4.1</version>
		</dependency>

 

application property 파일

#mybatis pageHelper
pagehelper.helper-dialect=mysql
pagehelper.reasonable=true
728x90