Spring Boot

    [DGS] GraphQLSchema: Factory method 'schema' threw exception; nested exception is java.lang.NoSuchMethodError 에러 해결

    [DGS] GraphQLSchema: Factory method 'schema' threw exception; nested exception is java.lang.NoSuchMethodError 에러 해결

    Kotlin + Spring boot + Webflux + Netflix DGS + Groovy 스택에서 개발 환경을 구현하던 중 발생한 여러 에러 중 하나 에러 로그 2023-05-01 23:13:35.236 WARN 5227 --- [ restartedMain] onfigReactiveWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'webHandler' defined in class path re..

    RestTemplate 와 ObjectMapper 활용기(스프링에서 다른 서버의 JSON API Token 을 가져와서 이용해야 할 때)

    RestTemplate 와 ObjectMapper 활용기(스프링에서 다른 서버의 JSON API Token 을 가져와서 이용해야 할 때)

    우선 API 서버의 스펙을 확인하고 data class 를 만들어 줍니다. data class GetToken( val responseCode: String, val token: String ) Http Request 이후 Json 을 담아줄 클래스에 아래 내용을 추가해 줍니다. @Autowired lateinit var restTemplate: RestTemplate var mapper: ObjectMapper = ObjectMapper().registerModules(KotlinModule()) 펑션을 하나 만드셔서 안에 아래 내용을 작성하기 시작합니다. val headers = HttpHeaders() headers.contentType = MediaType.APPLICATION_JSON conte..

    Kotlin Spring Boot 에 Querydsl 종속성이 추가된 프로젝트 소스 공유

    스프링 이니셜라이저에는 왜 querydsl 이 없는가! 그래서 제가 공개 템플릿 레포를 하나 만들었습니다. https://github.com/Kuass/Kotlin-Spring_Boot-Example GitHub - Kuass/Kotlin-Spring_Boot-Example: Why isn't there a querydsl in the spring initializer! Why isn't there a querydsl in the spring initializer! - GitHub - Kuass/Kotlin-Spring_Boot-Example: Why isn't there a querydsl in the spring initializer! github.com

    Spring Boot REST API Spring Security 고유키 만들어서 접근 제한하기(api key and secret)

    Spring Boot REST API Spring Security 고유키 만들어서 접근 제한하기(api key and secret)

    망 자체는 공용망을 사용하지만, 접근은 특정 인증키를 확인하여 접근을 가능토록 구현을 하고 싶었습니다. 구글에 일반적으로 Spring Security API Key 등을 검색하면 JWT 등과 로그인.. 비밀번호 와 같은 포스팅이 검색됩니다. 이 포스팅에서는 해당 내용이 아니니, 참고 바랍니다. 해당 포스팅은 https://stackoverflow.com/questions/48446708/securing-spring-boot-api-with-api-key-and-secret 해당 글을 인용하였으니 참고 바랍니다. 1. APIKeyAuthFilter.java 를 만들어줍니다. 필자 같은 경우는 이러한 경로에 만들었습니다. 2. 아래와 같이 시큐리티 필터 코드를 작성해줍니다. import org.springf..