본문 바로가기

JAVA/Error

(28)
[JAVA] Spring boot @Value 사용법과 java.lang.IllegalArgumentException: Could not resolve placeholder '' in value "${}" 에러 원인 / 해결 방법 @Value 로 application.yml 의 값을 가져오는데 해당 에러가 발생했다. org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'applicationProperty': Injection of autowired dependencies failed; nested exception is java.lang.IllegalArgumentException: Could not resolve placeholder '' in value "${}" BeanCreationException 말 그대로 스프링빈 객체 생성중에 특정 예외가 발생하여 빈 생성이 되지 못할 때 발생하는 예외이다. 특정 필드에 의존주입이 ..
[API] Swagger : Parser error missed comma between flow collection entries 원인 / 해결 방법 Errors Hide Parser error missed comma between flow collection entries Swagger 버전도 맞고, 모든 Api 경로가 일치 하는데 해당 에러가 계속 발생했다. comma 가 누락 됐다고 하는데 사용한 곳이 없다. 구글링 해보니 comma 뿐이 아니라 따옴표, 대괄호 등 어딘가에서 잘못 사용한 경우 해당 에러가 발생하는 것 같다. 내용은 comma 이지만 comma가 아닐 수도 있다는 것이다. @Column(name = "sample") @ApiModelProperty(notes = "예제", example = "[sample]'/test/api/sample/sampleId") @ApiParam(value="예제") private String samp..
[JAVA] querydsl Unrecognized token '': was expecting (JSON String, Number, Array, Object or token 'null', 'true' or 'false') at [Source: (String)""; line: 1, column: 9] - Error 원인/해결 Entity 연동 한 DB Table을 바꿨을 뿐인데, 해당 에러가 발생했다. querydsl Unrecognized token '': was expecting (JSON String, Number, Array, Object or token 'null', 'true' or 'false') at [Source: (String)""; line: 1, column: 9] 구글링을 해봤지만, 전부 Json parsing 과정에서 발생한 에러라고 한다. 나는 가져올 때 나는 에러인데? 한참을 삽질하다가, 문득 DB와 Entity를 보고 있는데 데이터 타입이 다른게 하나가 있다. 설마 타입 달라서 발생한 에러인가? 하고 수정했다. 바로 해결... 너무나도 허무한 에러. 왜 에러 내용은 id 값이 틀렸다고 하면서, ..
[JPA] NonUniqueResultException : query did not return a unique result: 2 NonUniqueResultException : query did not return a unique result: 2 조회 값이 2개 이상인데 1개만 조회 해서 발생한 에러이다. 나는 List 로 받아놓고 Class로 담으려고 해서 발생했다. List 로 담으면 된다.
[JAVA] Can not deserialize instance of '' out of START_OBJECT token Error - JSON 데이터 Map 변환 시 에러 이것도 타입 미스 에러이다. Can not deserialize instance of '' out of START_OBJECT token ObjectMapper mapper = new ObjectMapper(); Sample s = mapper.convertValue(data, Sample.class); 보통 ObjectMapper 사용 시 발생하는 에러인데, mapper.convertValue mapper.readValue 메서드 상관없이 발생한다. 타입이 달라서 발생했기 때문에. JSON 데이터 전달 하는 쪽 (프론트) 과, Entity(VO) 쪽 변수/객체 타입이 전부 일치하는지 확인하면 된다. 대부분은 List 형식인데 그냥 받아서 발생했더라. 배열 [] 인지 List 인지도 확인 하시길. 나는 ..
[Spring Boot] Intellij Error - No matching variant of org.springframework.boot:spring-boot-gradle-plugin:3.0.2 was found. Intellij 에서 Project Build 시 해당 에러가 발생했다. A problem occurred configuring root project 'demo'. > Could not resolve all files for configuration ':classpath'. > Could not resolve org.springframework.boot:spring-boot-gradle-plugin:3.0.2. Required by: project : > org.springframework.boot:org.springframework.boot.gradle.plugin:3.0.2 > No matching variant of org.springframework.boot:spring-boot-gradle-p..
[Swagger] Failed to start bean 'documentationPluginsBootstrapper'; nested exception is java.lang.NullPointerException" SwaggerConfig에 내용 추가 후 서버를 구동하니 해당 에러가 발생했다. Failed to start bean 'documentationPluginsBootstrapper'; nested exception is java.lang.NullPointerException" Spring boot 2.6 이후에 spring.mvc.pathmatch.matching-strategy 값이 ant_apth_matcher 에서 path_pattern_parser로 변경되면서 몇몇 라이브러리에 오류가 발생한다고 한다. application.properties 에 추가해주면 된다. spring.mvc.pathmatch.matching-strategy = ANT_PATH_MATCHER yml(yaml) 일 경우 spr..
[JPA] Spring JPA - Executing an update/delete query Update , Delete 의 경우 Transaction 처리가 필요한데 해당 처리가 없어서 발생한 에러. Executing an update/delete query 해당 메소드에 @Transactional 어노테이션 추가. import org.springframework.transaction.annotation.Transactional; @Transactional public void getTest(String testId) { testQuery.getTest(testId); }
[Error] could not extract ResultSet swagger를 통해 query 조회 중 에러 발생. 결과값을 가져올 수 없다고 한다. 1. DB Table 또는 Column 존재 유무 확인 Table 또는 Column이 존재하지 않으면 발생 함. 2. Entity 확인 - DB와 일치 여부 entity의 Column명이 DB Table의 Column명과 일치하지 않으면 발생 함. 나같은 경우는 Column명이 틀려서 발생. 오타 수정 후 해결.
[Swagger] java.lang.NumberFormatException: For input string: "" java.lang.NumberFormatException: For input string: "" swagger2에서 던지는 에러에 대한 핸들링이 제대로 이루어지지 않아 발생하는 에러. swagger-models와 swagger-annotation를 downgrade 해야 함. Maven io.springfox springfox-swagger-ui 2.9.2 io.springfox springfox-swagger2 2.9.2 io.swagger swagger-annotations io.swagger swagger-models io.swagger swagger-annotations 1.5.21 io.swagger swagger-models 1.5.21 Gradle compile("io.springfox:sp..