스프링부트 mysql, JSP 의존성 관련 cafe24 웹호스팅 500 에러

ino5·2021년 5월 12일
0

소개


의존성과 관련해서 웹호스팅에서 문제가 발생할 수 있습니다. 스프링부트를 cafe24 웹호스팅에 배포하였는데 500에러(Internal Server Error)가 발생했었는데요. 해당 오류의 원인을 찾아보니 JSP 의존성 관련 문제였습니다. 해당 오류 해결 방법에 대해 알아보고 이밖에 mysql 의존성 관련하여 로그에 경고가 뜨는 문제도 알아보겠습니다.



JSP - 톰캣 로그 확인


서버의 tomcat/logs에서 로그를 확인할 수 있는데요. 에러가 발생하면 먼저 로그 파일을 확인해봐야 합니다.

11-May-2021 11:01:53.477 심각 [http-nio-8347-exec-1] org.apache.catalina.core.ApplicationDispatcher.invoke Servlet.service() for servlet jsp threw exception
 java.lang.ClassNotFoundException: # Licensed to the Apache Software Foundation (ASF) under one or more



JSP - 해결 방법


<dependency>
	<groupId>org.apache.tomcat.embed</groupId>
	<artifactId>tomcat-embed-jasper</artifactId>
</dependency>

pom.xml에서 해당 dependency를 제거하여 문제를 해결했습니다.



mysql - 톰캣 로그 확인


13-May-2021 00:10:03.219 경고 [ContainerBackgroundProcessor[StandardEngine[chero77tom]]] org.apache.catalina.loader.WebappClassLoaderBase.clearReferencesThreads The web application [ROOT] appears to have started a thread named [mysql-cj-abandoned-connection-cleanup] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread:



mysql - 해결 방법


  1. 아래 mysql dependency를 제거해줍니다.
<dependency>
	<groupId>mysql</groupId>
	<artifactId>mysql-connector-java</artifactId>
	<scope>runtime</scope>
</dependency>

  1. webapp/WEB-INF/lib에 mysql connector jar 파일을 추가해줍니다.

profile
궁금한 것을 찾아보거나 문제를 해결한 과정을 날 것의 글로 작성하였습니다.

0개의 댓글