반응형

에러 7

[백준] 숫자의 합 (11720)

문제 N개의 숫자가 공백 없이 쓰여있다. 이 숫자를 모두 합해서 출력하는 프로그램을 작성하시오. 입력 첫째 줄에 숫자의 개수 N (1 ≤ N ≤ 100)이 주어진다. 둘째 줄에 숫자 N개가 공백없이 주어진다. 출력 입력으로 주어진 숫자 N개의 합을 출력한다. 예제 입력 1 1 1 예제 출력 1 1 예제 입력 2 5 54321 예제 출력 2 15 예제 입력 3 25 7000000000000000000000000 예제 출력 3 7 예제 입력 4 11 10987654321 예제 출력 4 46 내가 푼 코드 import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(Sys..

[에러] Non-standard token 'NaN': enable JsonParser.Feature.ALLOW_NON_NUMERIC_NUMBERS to allow 해결방법

상황 webclient를 이용하여 API를 호출하고 응답을 Map 형태로 반환함 - 처음 에러 발생한 코드 public Map getResponse(Map params) { try { Map result = this.webClient.post() .uri("{{api 호출 url}}") .body(BodyInserters.fromValue(params)) .retrieve() .bodyToMono(Map.class) .block(); return result; } catch (Exception e) { log.error("[getResponse] Cause: {}", e.getMessage()); return null; } } 이때 api 호출 시 "Non-standard token 'NaN': enab..

에러 2023.03.08

[에러] ModelMapper 사용 시 Method threw 'org.modelmapper.ConfigurationException' exception 에러 해결방법

MoelMapper를 그냥 new ModelMapper().map() 으로 사용할 경우 매핑 전략의 기본값은 타입만 맞으면 매핑된다. 그렇기 때문에 매핑 전략을 아래와 같이 STRICT로 해주면 해결!! public ResponseEntity getUser(@PathVariable(name = "userId") String userId) { ... ModelMapper mapper = new ModelMapper(); mapper.getConfiguration().setMatchingStrategy(MatchingStrategies.STRICT); UserDto user = mapper.map(user, UserDto.class); ... }

에러 2023.01.21

[에러] JdbcSQLException: Table "{{테이블명}}" not found; SQL statement: 에러 해결방법

spring data jpa 를 사용하면서 자동으로 db에 테이블을 생성한다음 data.sql에서 insert into 할 경우 발생하는 에러 이유는 스프링부트 버전 2.5부터는 data.sql 사용 시 설정 방법이 변경되었기 때문이다. 내가 사용중인 스프링 부트는 2.7.7 버전 - application.yml spring: application: name: catalog-service datasource: driver-class-name: org.h2.Driver url: jdbc:h2:mem:test h2: console: enabled: true settings: web-allow-others: true path: /h2-console jpa: hibernate: ddl-auto: create-d..

에러 2023.01.19

There is no getter for property named 'recordsPerPage' in 'class com.reviewer.portfolio.vo.paging.Criteria' 에러 해결 방법

이 에러는 mybatis 사용 시 쿼리가 작성되는 xml 파일에 #{} 부분의 변수명이 파라미터 타입의 필드명과 달라서 발생하는 에러이다. - PageVO @Component @Data @NoArgsConstructor public class PageVO { private int pageCnt; private int startPage; private int endPage; private int realEnd; private boolean prev, next; private int total; private Criteria criteria; ... } - .xml 파일 select id, category, title, url, file_id AS fileId, thumbnail_id AS thumbnail..

Mybatis 2022.03.24
반응형