반응형

Framework/Spring Boot 68

[Error] Error creating bean with name 'stackResourceRegistryFactoryBean'

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.cloud.aws.core.env.ResourceIdResolver.BEAN_NAME': Invocation of init method failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'stackResourceRegistryFactoryBean' defined in class path resource [org/springframework/cloud/aws/au..

WebFlux

Spring MVC Servlet 기반으로 만들어졌다. sync + blocking 방식으로 동작 하나를 처리할 때 Response를 기다리며 thread를 지연 Multi Thread를 사용하면 block되지 않고 사용할 수 있지만, Thread 간의 Context Switch 발생 시 비용이 생겨 비효율적 WebFlux Spring5에서 새롭게 추가된 모듈 클라이언트와 서버에서 Reactive한 개발을 할 수 있게 도와줌 요청이나 응답을 처리하는 I/O를 async + non blocking으로 방식으로 수행 성능을 최대로 내기 위해서는 모든 I/O 작업이 non blocking 기반으로 동작해야 한다. I/O 작업이 block 되는 곳이 있다면 event loop meltdown 현상으로 다른 작업..

Swagger 에러

"/swagger-resources/**", "/swagger-ui/index.html", "/swagger-ui/**", "/v2/api-docs", "/webjars/**" 다음 URI들을 스프링 시큐리티 설정에서 permitAll로 허용해주었다. 난 허용된 요청을 제외하고는 다 인증을 받도록 구현해서.. 만약에 모든 요청을 다 허용했다면, 위 과정이 필요없었을거다. 참고 👇 https://stackoverflow.com/questions/49155420/springfox-swagger-ui-html-unable-to-infer-base-url-caused-by-missing-cookies Springfox swagger-ui.html unable to infer base URL - Caused by..

[Error] com.fasterxml.jackson.databind.exc.InvalidDefinitionException

⭐ 상황 @Builder public class CommentResponse { private String id; private String username; private String content; private Like like; private Instant createdAt; } List responseList = commentRepository.findAllByPostId(post_id).stream() .map(comment -> CommentResponse.builder() .id(comment.getId()) .username(comment.getUsername()) .content(comment.getContent()) .like(comment.getLike()) .createdAt(co..

[Error] The propertyClass in JsonTypeDescriptor is null, hence it doesn't know to what Java Object type to map the JSON column value that was read from the database!

org.hibernate.HibernateException: The propertyClass in JsonTypeDescriptor is null, hence it doesn't know to what Java Object type to map the JSON column value that was read from the database! spring.jpa.hibernate.ddl-auto=create로 설정해서 실행하면 테이블이 생성된다. JSON 필드가 있는 테이블이 잘 생성되길래 문제가 없을 줄 알았는데.. DB에서 읽어올 때 문제가 생김~ 해결 과정 1. 버전 변경 Hibernate 5.1.2 버전을 사용중이었다. implementation 'io.hypersistence:hypersisten..

엔티티의 필드 타입으로 JSON 사용하기

implementation 'org.springframework.boot:spring-boot-starter-data-jpa' implementation 'io.hypersistence:hypersistence-utils-hibernate-5:3.1.1' 의존성 추가 실행할 때 hibernate 버전 보고, https://github.com/vladmihalcea/hypersistence-utils 여기에서 맞는 hypersistence-utils를 찾았다. @Type(type="json") @Column(columnDefinition = "json") private Profile profile; json을 필드에 적용했다. @TypeDef(name = "json", typeClass = JsonType..

[Error] "The specified key byte array is 128 bits which is not secure enough for any JWT HMAC-SHA algorithm.

{ "response": "error", "message": "로그인에 실패했습니다.", "data": "The specified key byte array is 128 bits which is not secure enough for any JWT HMAC-SHA algorithm. The JWT JWA Specification (RFC 7518, Section 3.2) states that keys used with HMAC-SHA algorithms MUST have a size >= 256 bits (the key size must be greater than or equal to the hash output size). Consider using the io.jsonwebtoken.security..

[Error] Error creating bean with name 'dataSourceScriptDatabaseInitializer' defined in class path resource

의존성에 mysql-connector-j를 빼먹으면 다음과 같은 로그가 나온다. 초기에 dependencies를 구성할 때 실수로라도 빼먹지말자!!!! org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'dataSourceScriptDatabaseInitializer' defined in class path resource [org/springframework/boot/autoconfigure/sql/init/DataSourceInitializationConfiguration.class]: Unsatisfied dependency expressed through method 'data..

반응형