본문 바로가기

Java147

[해결방법] io.jsonwebtoken.ExpiredJwtException io.jsonwebtoken.ExpiredJwtExceptionEnvironmentLanguage: Java 17DB: MySQL, Redis 오류123456789101112131415public void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain filterChain)        throws IOException, ServletException {    // 1. Request Header에서 JWT 토큰 추출    String accessToken = SecurityUtils.resolveToken(request);     // 2. 토큰 유효성 검사    // 토큰이 유효할 경우, 토큰.. 2024. 8. 30.
[해결방법] JWT Login 시, accessToken이 null JWT Login 시, accessToken이 nullEnvironmentLanguage: JavaDB: MySQL 오류private Claims parseClaims(ServletRequest request) { String accessToken = SecurityUtils.resolveToken((HttpServletRequest) request); if(accessToken == null) return null; Key secretKey = Keys.hmacShaKeyFor(JWT_SECRET.getBytes(StandardCharsets.UTF_8)); return Jwts.parserBuilder() .setSigningKey(secretKe.. 2024. 8. 18.
[해결방법] duplicateKeyException duplicateKeyExceptionEnvironmentLanguage: JavaDB: MySQL 오류Caused by: java.lang.IllegalStateException: Duplicate key 400 BAD_REQUEST (attempted merging values DUPLICATED_EMAIL and NOT_EQUAL_PASSWORD) at java.base/java.util.stream.Collectors.duplicateKeyException(Collectors.java:135) at java.base/java.util.stream.Collectors.lambda$uniqKeysMapAccumulator$1(Collectors.java:182)  원인DUPLICATED_EMAIL(H.. 2024. 8. 12.
[해결방법] EmptyResultDataAccessException EmptyResultDataAccessExceptionEnvironmentLanguage: JavaDB: MySQL 오류Caused by: jakarta.persistence.NoResultException: No result found for query [select u from User u where u.email = :email] at org.hibernate.query.spi.AbstractSelectionQuery.getSingleResult(AbstractSelectionQuery.java:476) at com.msgs.user.repository.UserRepository.findByEmail(UserRepository.java:19)  원인public Optional findByEmail(.. 2024. 8. 11.
[해결방법] JdbcTypeRecommendationException JdbcTypeRecommendationException Environment Language: Java DB: H2 Database IDE: IntelliJ Problem @Entity를 선언하고 table을 create할 때 발생 Caused by: org.hibernate.type.descriptor.java.spi.JdbcTypeRecommendationException: Could not determine recommended JdbcType for Java type 'jpabook.jpashop.domain.Delivery' Cause of Problem Hibernate가 엔티티의 필드에 대한 JDBC 타입을 결정하지 못할 때 발생 엔티티 필드와 데이터베이스 컬럼 간의 매핑이 충분히 명시되지.. 2023. 12. 25.
[해결방법] BeanCreationException BeanCreationException Environment Language: Java DB: H2 Database IDE: IntelliJ Problem Entity에서 PK에 @Id를 설정하고, @GeneratedValue를 통해 자동으로 값을 부여하고자 할 때 발생 org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resource [org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaConfiguration.class]: [PersistenceUnit: defau.. 2023. 12. 25.