■ Spring Boot 기반 프로젝트를 war 또는 jar로 배포시
다음과 같은 황당한 메시지가 출력되며 오류를 출력할때가 있다.
4월 07, 2023 5:31:41 오후 org.apache.catalina.core.StandardHostValve custom 심각: Exception Processing ErrorPage[errorCode=0, location=/error] java.lang.NoSuchMethodError: javax.servlet.http.HttpServletRequest.getHttpServletMapping()Ljavax/servlet/http/HttpServletMapping; at org.apache.catalina.core.ApplicationHttpRequest.setRequest(ApplicationHttpRequest.java:714) at org.apache.catalina.core.ApplicationHttpRequest.<init>(ApplicationHttpRequest.java:113) at org.apache.catalina.core.ApplicationDispatcher.wrapRequest(ApplicationDispatcher.java:920) at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:359) at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:313) at org.apache.catalina.core.StandardHostValve.custom(StandardHostValve.java:403) at org.apache.catalina.core.StandardHostValve.status(StandardHostValve.java:249) at org.apache.catalina.core.StandardHostValve.throwable(StandardHostValve.java:344) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:169) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:78) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:360) at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:399) at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65) at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:890) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1743) at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) at org.apache.tomcat.util.threads.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1191) at org.apache.tomcat.util.threads.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:659) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.lang.Thread.run(Thread.java:748) |
4월 07, 2023 5:34:18 오후 org.apache.catalina.core.StandardWrapperValve invoke 심각: Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Unable to compile class for JSP] with root cause java.lang.ClassNotFoundException: com.sun.el.ExpressionFactoryImpl at org.springframework.boot.web.embedded.tomcat.TomcatEmbeddedWebappClassLoader.loadClass(TomcatEmbeddedWebappClassLoader.java:72) at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1220) at javax.el.FactoryFinder.newInstance(FactoryFinder.java:87) at javax.el.FactoryFinder.find(FactoryFinder.java:197) at javax.el.ExpressionFactory.newInstance(ExpressionFactory.java:197) at javax.el.ExpressionFactory.newInstance(ExpressionFactory.java:168) at org.apache.jasper.compiler.PageInfo.<init>(PageInfo.java:80) at org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:120) at org.apache.jasper.compiler.Compiler.compile(Compiler.java:391) at org.apache.jasper.compiler.Compiler.compile(Compiler.java:367) at org.apache.jasper.compiler.Compiler.compile(Compiler.java:351) at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:605) at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:399) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:379) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:327) at javax.servlet.http.HttpServlet.service(HttpServlet.java:779) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:227) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162) at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:111) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162) at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:711) at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:459) at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:385) at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:313) at org.springframework.web.servlet.view.InternalResourceView.renderMergedOutputModel(InternalResourceView.java:171) at org.springframework.web.servlet.view.AbstractView.render(AbstractView.java:316) at org.springframework.web.servlet.DispatcherServlet.render(DispatcherServlet.java:1401) at org.springframework.web.servlet.DispatcherServlet.processDispatchResult(DispatcherServlet.java:1145) at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1084) at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:963) at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1006) at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:898) at javax.servlet.http.HttpServlet.service(HttpServlet.java:670) at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:883) at javax.servlet.http.HttpServlet.service(HttpServlet.java:779) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:227) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162) at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162) at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:201) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:197) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:97) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:541) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:135) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:78) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:360) at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:399) at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65) at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:890) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1743) at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) at org.apache.tomcat.util.threads.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1191) at org.apache.tomcat.util.threads.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:659) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.lang.Thread.run(Thread.java:748) |
■ 오류 원인
JDK에 Servlet에서 필요로 하는 라이브러리가 존재하지 않아서 발생한다.
■ 대응 방법 (JDK8 기준)
Tomcat 설치 디렉토리에서 다음 라이브러리를 JDK쪽으로 복사한다.
el-api.jar
servlet-api.jar
[Tomcat Root] /lib => [JDK Root] /jre/lib/ext |
■ BOOT 프로젝트 war 파일 배포방법 (Eclipse 및 maven)
spring-boot-maven-plugin 추가
<build> <plugins> <plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> <configuration> <excutable>true</excutable> <excludes> <exclude> <groupId>org.projectlombok</groupId> <artifactId>lombok</artifactId> </exclude> </excludes> </configuration> </plugin> </plugins> </build> |
전자정부 표준프레임워크 사용시 로깅 라이브러리 충돌로
부트에 있는 로깅을 제외 처리 한다.
<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> <exclusions> <exclusion> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-logging</artifactId> </exclusion> </exclusions> </dependency> |
war가 만들어 지도록 "war" 속성 추가
<packaging>war</packaging> |
■ BOOT용 war 배포 패키지 구동
$ java -jar "배포배키지".war |
'전자정부표준프레임워크' 카테고리의 다른 글
macOS에서 Home-Brew이용하여 표준프레임워크 개발환경 설치하기 (0) | 2023.10.10 |
---|---|
표준프레임워크 Gradle 기반 MSA 템플릿 프로젝트에서 QueryDSL Q~클래스 오류 정리하는 방법 (0) | 2023.04.28 |
표준프레임워크 v4.0 scribejava Kakao OAuth Login API 오류 수정하기 (0) | 2022.08.29 |
Spring Boot에서 jar 배포시 jsp 동작하지 않을때 (0) | 2022.08.10 |
[전자정부 표준프레임워크] No bean named 'springSecurityFilterChain' is defined 해결방법 (0) | 2019.01.07 |