본문 바로가기

오류74

Caused by: java.lang.IllegalStateException: Ambiguous mapping. Cannot map 'loginPersonalController' method 원인 @RequetsMapping 이름이 중복 해결방법 하나 삭제해주면 된다 멍청한 오류였다. 2023. 8. 10.
Caused by: org.apache.jasper.JasperException: java.lang.ClassNotFoundException: org.apache.jsp.WEB_002dINF.views.index_jsp 원인 security taglib 사용 시JasperException이 발생, tags를 가져오지 못했다고 한다 해결 방법 아래 디펜던시를 추가한다. implementation 'org.springframework.security:spring-security-taglibs' 2023. 8. 1.
role should not start with 'ROLE_' since it is automatically inserted. Got 'ROLE_USER' - spring security에서 hasRole() 사용 시 발생 - 오류내용 : Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [javax.servlet.Filter]: Factory method 'springSecurityFilterChain' threw exception; nested exception is java.lang.IllegalArgumentException: role should not start with 'ROLE_' since it is automatically inserted. Got 'ROLE_USER' 원인 - hasRole() 내부 : rolePrefix는 자동으로 .. 2023. 7. 21.
[SpringSecurity] java.lang.IllegalArgumentException: There is no PasswordEncoder mapped for the id "null" 원인 SpringSecurity 5버전 이상부터는 PasswordEncoder를 처리를 하는데, 이때 PasswordEncoder를 처리하기위한 형식으로 pw가 저장되어있지 않기때문이다. - 기본이 bcrypt이다. - SpringSecurity가 로그인 과정에서 어떤 Encoder를 쓸지는 database에 저장된 password의 prefix { Encoder명 }를 보고 결정한다. - 따로 설정을하지않았으니, SpringSecurity가 prefix를 보고 Enocder형식을 정해야 하는데, 이것조처 설정이 되어있지 않아서 에러가 난것 해결 방법 securityconfig 에 빈을 등록한다. @Bean public PasswordEncoder noOpPasswordEncoder(){ return N.. 2023. 7. 20.
Encoded password does not look like BCrypt 원인 데이터베이스에 암호화 되어 있지 않은 임의로 넣은 pw 값이 있었다. @Bean public BCryptPasswordEncoder encodePwd(){ return new BCryptPasswordEncoder(); } 2023. 7. 20.
Caused by: java.lang.IllegalArgumentException: Unrecognized field "PER_NAME" (class com.example.devjob.vo.LoginPersonalVo), not marked as ignorable (4 known properties: "perId", "perEmail", "perPwd", "perName"]) 원인 json 데이터를 받아와서 dto 객체로 맵핑할때 dto 클래스에 선언되지 않은 속성이 json에 있으면 오류가 발생. 해결 방법 1.DTO Class에서 어노테이션 사용 @JsonIgnoreProperties(ignoreUnknown =true) : 선언 필드 외에 모든 요소 제외 dto class 객체에 속성이 없으면 exception 발생하지않고 진행. 아래와 같이 사용. @JsonIgnoreProperties(ignoreUnknown=true) public class CouconApiResponseDTO { private String vv; private String name; } 2.DTO Class에서 어노테이션 사용 jsonIgnoreProperties({"제외하고자하는 특정 필드 NA.. 2023. 7. 20.