Handler processing failed; nested exception is java.lang.NoClassDefFoundError: javax/servlet/jsp/jstl/core/Config

 

초기 스프링 부트 프로젝트를 생성 하고 해당 에러가 발생 했습니다.

부트는 기본적으로 jsp를 지원 해주지 않기 때문에 jsp 관련 라이브러리를 추가 하면 정상적으로 실행 할 수 있습니다.

 

아래 코드를 pom.xml에 추가하시면 되고, 버전은 필요하신 버전에 맞춰 수정 하시면 됩니다 !

 

	
		
		    jstl
		    jstl
		    1.2
		
		
		    javax.servlet.jsp
		    javax.servlet.jsp-api
		    2.3.1
		    provided
		

이번에 스프링을 훨씬 더 깊게 공부하기 위해, 제 마음속 스프링의 신 백기선님의 강의를 듣기 시작 했습니다.

백기선님은 강의 진행에 IntelliJ 를 사용하시는데, 저는 굳이(?) 이클립스를 이용해서 진행 하고 싶었습니다.

분명...인텔리제이가 어려워 이클립스를 사용하실 분이 계시다는 생각으로... 도움이 되고자 포스팅 합니다.

 

 

 

1. 우선 이클립스 상단 메뉴의 File->New->Others에서 SCM을 검색 하신다음, 아래 항목을 선택 해주세요.

 

 

 

 

2. SCM URL 항목에서 git을 선택 하신다음, git repository URI를 입력 하고 Finish 눌러주세요.

 

 

 

 

3. 위에 과정을 거치면 빌드를 위해 Maven이 열심히 파일들을 다운로드 받습니다.

 처음 이 과정을 거치시는 분은 상당히 많은 시간이 소요될 수 있습니다.

 

 

 

4. 빌드가 완료되서 프로젝트가 완성 되면 좋겠지만... 제가 직장 동료의 피씨와 제 노트북으로도 테스트 해본 결과

   공통된 에러가 발생 했습니다.

Multiple annotations found at this line:  - Execution default-testResources of goal    org.apache.maven.plugins:maven-resources-plugin:   3.1.0:testResources failed: Plugin    org.apache.maven.plugins:maven-resources-plugin:3.1.0 or one    of its dependencies could not be resolved: Failure to transfer    com.google.code.findbugs:jsr305:jar:2.0.1 from https://   repo.maven.apache.org/maven2 was cached in the local    repository, resolution will not be reattempted until the update    interval of central has elapsed or updates are forced. Original    error: Could not transfer artifact    com.google.code.findbugs:jsr305:jar:2.0.1 from/to central    (https://repo.maven.apache.org/maven2): The operation was    cancelled. (org.apache.maven.plugins:maven-resources-plugin:   3.1.0:testResources:default-testResources:process-test-resources)

해당 에러는 maven-resources-plugin 이 없어 빌드가 진행되지 않아서 발생 합니다. 해당 플러그인의 dependency를

pom.xml 에 등록하면 에러 사라집니다. 아래 URI에서 원하시는 버전을 선택 하시고,

아래 소스 코드를 pom.xml dependencies에 등록 해주시면 됩니다.

https://mvnrepository.com/artifact/org.apache.maven.plugins/maven-resources-plugin

		

    org.apache.maven.plugins
    maven-resources-plugin
    3.1.0

 

 

 

5. pom.xml 저장 후 프로젝트 우클릭->Run As->Maven Install 을 실행 해주세요. 

  그러면 프로그램이 열심히 돌기 시작합니다.

 

 

 

 

 

6. 빌드가 종료되면, 프로젝트 우클릭 -> Run As -> Spinrg Boot App 을 실행 해주세요.

   그림(2)와 같이 서버가 실행 됩니다.

  

그림(1)

 

그림(2)

 

 

 

7. 웹 브라우저에 localhost:포트번호(8080) 을 입력 하시면 시작된 고대하던 petclinic 페이지가 접속 됩니다.

 

 

+ Recent posts