본문 바로가기

JAVA/Error

(28)
[Swagger] spring boot - No mapping for GET /swagger-ui 동일한 설정의 다른 프로젝트는 정상 작동 하는데, 신규 프로젝트만 해당 오류가 발생한다. Spring fox - Swagger2(2.9.x) 를 사용하는 경우 발생하는 현상이며, Spring boot 의 Configuration 을 통해 ResourceHandler를 Override 해서 swagger-ui.html 페이지의 위치를 설정해줘야 한다. Swagger 3버전에서는 해당 설정이 아닌 http://localhost:{ip}/swagger-ui/index.html 로 접속해야 함. @Configuration @EnableSwagger2 public class SwaggerConfig extends WebMvcConfiguarationSupport { @Override protected void a..
[Swagger] Error - org.springframework.context.ApplicationContextException: Failed to start bean 'documentationPluginsBootstrapper'; org.springframework.context.ApplicationContextException: Failed to start bean 'documentationPluginsBootstrapper'; Spring boot 2.6 이후에 spring.mvc.pathmatch.matching-strategy 값이 ant_apth_matcher에서 path_pattern_parser로 변경되면서 몇몇 라이브러리(swagger포함)에 오류가 발생. application.yml - 설정 추가 spring: mvc: pathmatch: matching-strategy: ant_path_matcher + Spring boot 와 Swagger 의 버전 호환 문제도 있다고 한다. Swagger 2.9.2 버전은 S..
[Error] org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'fileUploadController': 경로 에러 Controller 내에 있는 DAO를 불러오지 못 했다고 한다. root-context.xml 을 확인하니 context:component-scan 선언이 되어있지 않음. org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'fileUploadController': Unsatisfied dependency expressed through field 'fileUploadDAO'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'com...
[Error] The declared package "" does not match the expected package - 패키지 미참조 에러 Class에 해당 패키지 미참조 시 발생함. The declared package "" does not match the expected package Class 최상단에 해당 패키지 참조 해주면 됨. package com.sample.controller;
[Error] log4j2 - ERROR StatusLogger No log4j2 configuration file found. Using default configuration: logging only errors to the console. Set system property 'log4j2.debug' to show Log4j2 internal initialization logging. https://devel-log.tistory.com/27 [Error] tomcat server , log4j error - java.lang.ClassNotFoundException: org.springframework.web.util.Log4jConfigListener 1. 멀쩡하게 하다가 갑자기 에러 발생. log4j:WARN No appenders could be found for logger (org.springframework.web.context.ContextLoader). log4j:WARN Please initialize the log4j system pr.. devel-log.tistory.com 직전 에러 때문에 log4j2를 추가하였는데, 실행하고 보니 에러 발생. SLF4J: C..
[Error]Failed to load resource: the server responded with a status of 404 () Failed to load resource: the server responded with a status of 404 () 경로 틀려서 나는 에러
[Error] java - Unreachable catch block for SQLException. This exception is never thrown from the try statement body Unreachable catch block for SQLException. This exception is never thrown from the try statement body try 안에서 exception이 발생하지 않으니 필요없다는 뜻. 해당 Exception 필요한 경우 구문을 try-catch 안에 넣으면 됨.
[Error] Java Mvc project - exception : java.lang.NumberFormatException: For input string: "" 숫자 형식 에러 exception=java.lang.NumberFormatException: For input string: "숫자" 원인 1. 정수아닌 문자 포함 되었을 때 String str = "123o"; System.out.println(Integer.parseInt(str)); 2. int 범위보다 큰 정수일 때 String str = "123123123123123123123123"; System.out.println(Integer.parseInt(str)); 3. null 입력 시 String str= null; System.out.println(Integer.parseInt(str)); 4. 문자열에 공백이 있을 경우 String str = " 123 "; System.out.println(Integer...
[Error] Eclipse - Syntax error on tokens, delete these tokens. 복사 붙여넣기 에러 Syntax error on tokens, delete these tokens 구문을 복사 > 붙여넣기 시 발생하는 에러. > 공백 제거하면 됨. ctrl + f > 빨간색 공백 선택 > 'find'에 공백 삽입 > Replace All
[Error] Spring MVC file upload 오류 - 해결 파일 생성 및 저장은 되었는데 에러 문구 발생. 확인 필요. 파일은 정상 저장됨. C:\upload\20221022 폴더가 생성되었습니다 ERROR: com.assignment.exception.CommonExceptionAdvice - Exception ......nested exception is org.apache.ibatis.exceptions.PersistenceException: ### Error updating database. Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Failed to obtain JDBC Connection: DataSource returned null from getConnection(): or..