inflearn logo
강의

강의

N
챌린지

챌린지

멘토링

멘토링

N
클립

클립

로드맵

로드맵

지식공유

묻고 답해요

173만명의 커뮤니티!! 함께 토론해봐요.

이게 데이터베이스 강의인걸로아는데

미해결

스프링 DB 1편 - 데이터 접근 핵심 원리

자바 고급편끝나고 데이터베이스 강의를 따로 내신다고하셔서요 무슨차이가있나요?

  • spring
  • mvc
  • spring-jdbc
임다정 댓글 2 좋아요 0 조회수 191

일대일 관계에서 N+1 문제

해결됨

실전! 스프링 부트와 JPA 활용2 - API 개발과 성능 최적화

안녕하세요 강사님 강의 보면서 많이 배우고 적용해보고있습니다. 테스트를 해보던중 이해할수 없는 추가적인 쿼리가 발생해서 질문드립니다. 먼저 예약과 리뷰 엔티티 클래스입니다. @Entity @Getter public class Reservation extends BaseEntity { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) @Column(name = "reservation_id") private Long id; ... @OneToOne(mappedBy = "reservation") private Review review; } @Entity @Getter @Table(name = "rental_home_review") public class Review extends BaseEntity { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) @Column(name = "rental_home_review_id") private Long id; @OneToOne(fetch = FetchType.LAZY) @JoinColumn(name = "reservation_id", nullable = false) private Reservation reservation; private int score; private String content; @Enumerated(EnumType.STRING) private WritingStatus status; } @PersistenceUnit EntityManagerFactory emf; @Test public void 조인_jpql() { String query = "select rh from RentalHome rh join rh.reservations where rh.id = 6486L"; RentalHome rentalHome = em.createQuery(query, RentalHome.class).getSingleResult(); boolean rentalHomeLoaded = emf.getPersistenceUnitUtil().isLoaded(rentalHome); boolean reservationsLoaded = emf.getPersistenceUnitUtil().isLoaded(rentalHome.getReservations()); assertThat(rentalHomeLoaded).isTrue(); assertThat(reservationsLoaded).isFalse(); } @Test public void 패치조인_jpql() { String query = "select rh from RentalHome rh join fetch rh.reservations where rh.id = 6486L"; RentalHome rentalHome = em.createQuery(query, RentalHome.class).getSingleResult(); boolean rentalHomeLoaded = emf.getPersistenceUnitUtil().isLoaded(rentalHome); boolean reservationsLoaded = emf.getPersistenceUnitUtil().isLoaded(rentalHome.getReservations()); assertThat(rentalHomeLoaded).isTrue(); assertThat(reservationsLoaded).isTrue(); } 위의 테스트 메서드에서 조인_jpql 쿼리는 의도한대로 테스트 통과가 맞고 패치조인_jpql에서도 테스트는 통과하지만 추가적인 쿼리가 발생합니다. Reservation과 Review의 관계를 Lazy로 설정했고 Reivew 객체는 사용하지도 않았는데 추가적인 쿼리가 왜 발생했는지 모르겠어서 질문 올립니다.

  • java
  • spring
  • spring-boot
  • jpa
wnsdus1008 댓글 1 좋아요 0 조회수 139

JUnit 과 AssertJ 의존성 추가 오류

미해결

스프링 입문 - 코드로 배우는 스프링 부트, 웹 MVC, DB 접근 기술

package hello.HelloSpring.service; import hello.HelloSpring.domain.Member; import hello.HelloSpring.repository.MemberRepository; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.transaction.annotation.Transactional; import static org.assertj.core.api.Assertions.assertThat; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertThrows; @SpringBootTest @Transactional class MemberServiceIntegrationTest { @Autowired MemberService memberService; @Autowired MemberRepository memberRepository; @Test public void 회원가입() throws Exception { //Given Member member = new Member(); member.setName("hello"); //When Long saveId = memberService.join(member); //Then Member findMember = memberRepository.findById(saveId).get(); assertEquals(member.getName(), findMember.getName()); } @Test public void 중복_회원_예외() throws Exception { //Given Member member1 = new Member(); member1.setName("spring"); Member member2 = new Member(); member2.setName("spring"); //When memberService.join(member1); IllegalStateException e = assertThrows(IllegalStateException.class, () -> memberService.join(member2));//예외가 발생해야 한다. assertThat(e.getMessage()).isEqualTo("이미 존재하는 회원입니다."); dependencies dependencies { implementation 'org.springframework.boot:spring-boot-starter-thymeleaf' implementation 'org.springframework.boot:spring-boot-starter-web' testImplementation 'org.springframework.boot:spring-boot-starter-test' testRuntimeOnly 'org.junit.platform:junit-platform-launcher' developmentOnly("org.springframework.boot:spring-boot-devtools") implementation 'org.springframework.boot:spring-boot-starter-aop' implementation 'org.springframework.boot:spring-boot-starter-jdbc' runtimeOnly 'com.h2database:h2' testImplementation 'org.assertj:assertj-core' // AssertJ 포함 testImplementation 'org.junit.jupiter:junit-jupiter:5.9.3' } error code > Task :compileJava FAILED 1 actionable task: 1 executed C:\Users\CKIRUser\Music\�� ����\Programing\�迵��\������ �Թ�\hello-spring\src\main\java\hello\HelloSpring\service\MemberIntegrationTest.java:4: error: package org.junit.jupiter.api does not exist import org.junit.jupiter.api.Test; ^ C:\Users\CKIRUser\Music\�� ����\Programing\�迵��\������ �Թ�\hello-spring\src\main\java\hello\HelloSpring\service\MemberIntegrationTest.java:6: error: package org.springframework.boot.test.context does not exist import org.springframework.boot.test.context.SpringBootTest; ^ C:\Users\CKIRUser\Music\�� ����\Programing\�迵��\������ �Թ�\hello-spring\src\main\java\hello\HelloSpring\service\MemberIntegrationTest.java:8: error: package org.assertj.core.api does not exist import static org.assertj.core.api.Assertions.assertThat; ^ C:\Users\CKIRUser\Music\�� ����\Programing\�迵��\������ �Թ�\hello-spring\src\main\java\hello\HelloSpring\service\MemberIntegrationTest.java:8: error: static import only from classes and interfaces import static org.assertj.core.api.Assertions.assertThat; ^ C:\Users\CKIRUser\Music\�� ����\Programing\�迵��\������ �Թ�\hello-spring\src\main\java\hello\HelloSpring\service\MemberIntegrationTest.java:9: error: package org.junit.jupiter.api does not exist import static org.junit.jupiter.api.Assertions.assertEquals; ^ C:\Users\CKIRUser\Music\�� ����\Programing\�迵��\������ �Թ�\hello-spring\src\main\java\hello\HelloSpring\service\MemberIntegrationTest.java:9: error: static import only from classes and interfaces import static org.junit.jupiter.api.Assertions.assertEquals; ^ C:\Users\CKIRUser\Music\�� ����\Programing\�迵��\������ �Թ�\hello-spring\src\main\java\hello\HelloSpring\service\MemberIntegrationTest.java:10: error: package org.junit.jupiter.api does not exist import static org.junit.jupiter.api.Assertions.assertThrows; ^ C:\Users\CKIRUser\Music\�� ����\Programing\�迵��\������ �Թ�\hello-spring\src\main\java\hello\HelloSpring\service\MemberIntegrationTest.java:10: error: static import only from classes and interfaces import static org.junit.jupiter.api.Assertions.assertThrows; ^ C:\Users\CKIRUser\Music\�� ����\Programing\�迵��\������ �Թ�\hello-spring\src\main\java\hello\HelloSpring\service\MemberIntegrationTest.java:11: error: cannot find symbol @SpringBootTest ^ symbol: class SpringBootTest C:\Users\CKIRUser\Music\�� ����\Programing\�迵��\������ �Թ�\hello-spring\src\main\java\hello\HelloSpring\service\MemberIntegrationTest.java:17: error: cannot find symbol @Test ^ symbol: class Test location: class MemberServiceIntegrationTest C:\Users\CKIRUser\Music\�� ����\Programing\�迵��\������ �Թ�\hello-spring\src\main\java\hello\HelloSpring\service\MemberIntegrationTest.java:27: error: cannot find symbol @Test ^ symbol: class Test location: class MemberServiceIntegrationTest C:\Users\CKIRUser\Music\�� ����\Programing\�迵��\������ �Թ�\hello-spring\src\main\java\hello\HelloSpring\service\MemberIntegrationTest.java:25: error: cannot find symbol assertEquals(member.getName(), findMember.getName()); ^ symbol: method assertEquals(String,String) location: class MemberServiceIntegrationTest C:\Users\CKIRUser\Music\�� ����\Programing\�迵��\������ �Թ�\hello-spring\src\main\java\hello\HelloSpring\service\MemberIntegrationTest.java:36: error: cannot find symbol IllegalStateException e = assertThrows(IllegalStateException.class, ^ symbol: method assertThrows(Class<IllegalStateException>,()->member[...]ber2)) location: class MemberServiceIntegrationTest C:\Users\CKIRUser\Music\�� ����\Programing\�迵��\������ �Թ�\hello-spring\src\main\java\hello\HelloSpring\service\MemberIntegrationTest.java:38: error: cannot find symbol assertThat(e.getMessage()).isEqualTo("�̹� �����ϴ� ȸ���Դϴ�."); ^ symbol: method assertThat(String) location: class MemberServiceIntegrationTest 14 errors FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':compileJava'. > Compilation failed; see the compiler error output for details. * Try: > Run with --info option to get more log output. > Run with --scan to get full insights. BUILD FAILED in 1s JUnit 과 AssertJ이 의존성에 추가해도 인식이 안되는 것 같습니다. 또한 test도 의존성에 추가해도 인식이 안되는 것 같습니다. 해본 조치 사항에는 test 코드에서 컴파일 경고가 나는 것을 확인하고 alt + enter로 직접 의존성을 추가 했고 또 gpt를 이용하여 의존성 코드를 수정해봤습니다. 이러한 조치에도 컴파일 오류는 계속됩니다 해결 방법 알려주시면 감사하겠습니다.

  • java
  • spring
  • mvc
  • spring-boot
최진욱 댓글 2 좋아요 0 조회수 379

Member를 다른페키지에서 도입시에 import 문

미해결

스프링 입문 - 코드로 배우는 스프링 부트, 웹 MVC, DB 접근 기술

학습하는 분들께 도움이 되고, 더 좋은 답변을 드릴 수 있도록 질문전에 다음을 꼭 확인해주세요. 1. 강의 내용과 관련된 질문을 남겨주세요. 2. 인프런의 질문 게시판과 자주 하는 질문(링크)을 먼저 확인해주세요. (자주 하는 질문 링크: https://bit.ly/3fX6ygx) 3. 질문 잘하기 메뉴얼(링크)을 먼저 읽어주세요. (질문 잘하기 메뉴얼 링크: https://bit.ly/2UfeqCG) 질문 시에는 위 내용은 삭제하고 다음 내용을 남겨주세요. ========================================= [질문 템플릿] 1. 강의 내용과 관련된 질문인가요? (예/아니오) 2. 인프런의 질문 게시판과 자주 하는 질문에 없는 내용인가요? (예/아니오) 3. 질문 잘하기 메뉴얼을 읽어보셨나요? (예/아니오) 회원 도메인과 리포지토리 만들기 파트에서 Member을 사용하게 되면 import.hellospring.domain.Member를 불러오는데 제 intellij에서 import java.lang.reflect.Member를 불러오게 됩니다. 둘다 Member를 불러오는 import 인데 뭐가 다른지 물어보고 싶습니다. [질문 내용] 여기에 질문 내용을 남겨주세요.

  • java
  • spring
  • mvc
  • spring-boot
top6543top 댓글 2 좋아요 0 조회수 172

설계에 대한 질문입니다.

미해결

실전! 스프링 부트와 JPA 활용1 - 웹 애플리케이션 개발

강의를 듣고 간단한 게시판을 만들고 있습니다. 구현을 하다가 이런식으로 양방향 편의메서드를 작성했습니다. Post(게시글)을 생성할 때 setBoard()를 사용해서 Board.posts 리스트에 생성된 Post 객체를 넣도록 하고 있습니다. public void setBoard(Board board) { this.board = board; if (!board.getPosts().contains(this)) { board.getPosts().add(this); } 여기서 든 고민이 있습니다. 예를 들어 한 게시판에 게시글이 100만개 혹은 엄청난 양의 게시글이 쌓여있다고 가정을 한다면 contains()를 하는 과정이 O(N) 이 걸려 성능이 안좋아질거라고 생각했습니다. 근데 논리적으로 생각했을 때 Board(게시판)에 똑같은 객체(=PK가 같은) Post(게시글) 가 들어갈 일이 있을까? 라는 생각을 해서 굳이 중복 검사하는 로직이 필요하나라는 생각이 들었습니다. 이럴 경우는 어떻게 생각하시나요?

  • java
  • spring
  • 웹앱
  • spring-boot
  • jpa
opix0306 댓글 2 좋아요 0 조회수 90

11:04 에 item 과 items

해결됨

스프링 MVC 1편 - 백엔드 웹 개발 핵심 기술

11:04 즈음에 강사님이 Model 에 있는 items 를 꺼내서 여기 있는 item에 넣어준다. 그러면 이 안에서는 item을 쓸 수 있다. 라고 하시는데 Model에 있는 items가 BasicItemController에 있는 items 이고 사용가능한 item은 Repository에 있는 item 인가요? 제가 이해한게 맞을까요...?

  • spring
  • mvc
rrr6964 댓글 2 좋아요 1 조회수 237

index.html 실행 안됨

미해결

스프링 입문 - 코드로 배우는 스프링 부트, 웹 MVC, DB 접근 기술

학습하는 분들께 도움이 되고, 더 좋은 답변을 드릴 수 있도록 질문전에 다음을 꼭 확인해주세요. 1. 강의 내용과 관련된 질문을 남겨주세요. 2. 인프런의 질문 게시판과 자주 하는 질문(링크)을 먼저 확인해주세요. (자주 하는 질문 링크: https://bit.ly/3fX6ygx) 3. 질문 잘하기 메뉴얼(링크)을 먼저 읽어주세요. (질문 잘하기 메뉴얼 링크: https://bit.ly/2UfeqCG) 질문 시에는 위 내용은 삭제하고 다음 내용을 남겨주세요. ========================================= [질문 템플릿] 1. 강의 내용과 관련된 질문인가요? (예/아니오) 2. 인프런의 질문 게시판과 자주 하는 질문에 없는 내용인가요? (예/아니오) 3. 질문 잘하기 메뉴얼을 읽어보셨나요? (예/아니오) [질문 내용] 여기에 질문 내용을 남겨주세요. 프로젝트 환경 설정 강의 3번째 파트 view 환경설정하는 부분에서 index.html 파일이 실행이 안 됩니다. out 파일 삭제, 캐시 삭제, http://localhost:8080 직접 쳐서 접근, 포트 삭제 다 해봤는데도 사파리, 크롬 둘 다 welcome 페이지가 뜨지 않습니다. 어디가 문제인 걸까요?

  • java
  • spring
  • mvc
  • spring-boot
dmadma 댓글 2 좋아요 0 조회수 190

커스텀 AuthenticationProvider 구현 질문

미해결

스프링 시큐리티 완전 정복 [6.x 개정판]

저번시간에 커스텀 UserDetailsService를 만들고 이번에 커스텀 AuthenticationProvider를 만드는데 커스텀 AuthenticationProvider는 왜 만드는건가요? 커스텀 UserDetailsService는 저희가 이번 프로젝트에서 유저 객체를 db와 연동하기 때문에 구현을 안하면 제대로 작동하지 않아서 반드시 만들어야 하는데, 커스텀 AuthenticationProvider는 만들지 않아도 저번시간마지막에 보면 로그인 인증이 제대로 되는데 왜 만드는건가요?

  • spring
  • spring-boot
  • spring-security
  • security
  • web-security
에욱 댓글 2 좋아요 0 조회수 244

AccountDto 생성 이유

미해결

스프링 시큐리티 완전 정복 [6.x 개정판]

지금 생성한 AccountDto는 Account 와 모든 필드가 동일한데 무슨 이유로 만든건가요? 보통 Dto는 Entity 객체와 응답하거나 받을때 필드가 달라서 그럴때를 위해 만드는걸로 아는데 지금 만든 두 객체는 필드가 동일한데 뭐하러 만드는지 모르겠습니다. FormUserDetailsService에서 마지막에 return하기전에 account 객체를 AccountDto 타입으로 바꾸면서 하신 말씀이 클라이언트에서 엔티티 객체를 그대로 주지 않기 위해서 라고 하셨는데 지금 FormUserDetailsService는 인증 필터에서 받고 사용하는거라 클라이언트에게 주는게 아니지 않나요?

  • spring
  • spring-boot
  • spring-security
  • security
  • web-security
에욱 댓글 1 좋아요 0 조회수 167

mybatis test 실패 문의

미해결

스프링 DB 2편 - 데이터 접근 활용 기술

안녕하세요. 수고가 많으십니다. 프로그램이 작동이 안되서 질문드립니다. 프로젝트 링크는 우선 아래와 같습니다. https://drive.google.com/file/d/1TODdnDNN5JA7t_gqQQNNUYEAWnRss6kR/view?usp=drive_link mybatis ItemRepositoryTest 실행시 save가 실패합니다. id가 null로 해서 저장이 되는데 이유를 잘 모르겠습니다. (그 전 강의인 JdbcTemplate 까지는 잘 됬었습니다) spring mvc 상품 저장시 웹 화면상에서 id에 데이터를 못 가지고 옵니다. h2 db에서는 정상으로 저장은 됩니다. 답변 주시면 정말 감사드립니다.

  • spring
  • mvc
  • spring-data-mybatis
cndcjd2qn 댓글 4 좋아요 0 조회수 173

-

미해결

실전! 코틀린과 스프링 부트로 도서관리 애플리케이션 개발하기 (Java 프로젝트 리팩토링)

-

  • java
  • spring
  • kotlin
  • spring-boot
  • 리팩토링
댓글 2 좋아요 0 조회수 169

rsa 512 복호화 에러

미해결

스프링 시큐리티 OAuth2

org.springframework.security.oauth2.jwt.BadJwtException: An error occurred while attempting to decode the Jwt: Signed JWT rejected: Invalid signature at org.springframework.security.oauth2.jwt.NimbusJwtDecoder.createJwt(NimbusJwtDecoder.java:180) ~[spring-security-oauth2-jose-5.7.3.jar:5.7.3] at org.springframework.security.oauth2.jwt.NimbusJwtDecoder.decode(NimbusJwtDecoder.java:137) ~[spring-security-oauth2-jose-5.7.3.jar:5.7.3] at io.security.oauth2.resource.server.filter.authorization.JwtAuthorizationRsaPublicKeyFilter.doFilterInternal(JwtAuthorizationRsaPublicKeyFilter.java:38) ~[classes/:na] at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117) ~[spring-web-5.3.22.jar:5.3.22] at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:346) ~[spring-security-web-5.7.3.jar:5.7.3] at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:223) ~[spring-security-web-5.7.3.jar:5.7.3] at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:217) ~[spring-security-web-5.7.3.jar:5.7.3] at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:346) ~[spring-security-web-5.7.3.jar:5.7.3] at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:103) ~[spring-security-web-5.7.3.jar:5.7.3] at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:89) ~[spring-security-web-5.7.3.jar:5.7.3] at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:346) ~[spring-security-web-5.7.3.jar:5.7.3] at org.springframework.security.web.header.HeaderWriterFilter.doHeadersAfter(HeaderWriterFilter.java:90) ~[spring-security-web-5.7.3.jar:5.7.3] at org.springframework.security.web.header.HeaderWriterFilter.doFilterInternal(HeaderWriterFilter.java:75) ~[spring-security-web-5.7.3.jar:5.7.3] at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117) ~[spring-web-5.3.22.jar:5.3.22] at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:346) ~[spring-security-web-5.7.3.jar:5.7.3] at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:112) ~[spring-security-web-5.7.3.jar:5.7.3] at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:82) ~[spring-security-web-5.7.3.jar:5.7.3] at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:346) ~[spring-security-web-5.7.3.jar:5.7.3] at org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter.doFilterInternal(WebAsyncManagerIntegrationFilter.java:55) ~[spring-security-web-5.7.3.jar:5.7.3] at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117) ~[spring-web-5.3.22.jar:5.3.22] at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:346) ~[spring-security-web-5.7.3.jar:5.7.3] at org.springframework.security.web.session.DisableEncodeUrlFilter.doFilterInternal(DisableEncodeUrlFilter.java:42) ~[spring-security-web-5.7.3.jar:5.7.3] at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117) ~[spring-web-5.3.22.jar:5.3.22] at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:346) ~[spring-security-web-5.7.3.jar:5.7.3] at org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:221) ~[spring-security-web-5.7.3.jar:5.7.3] at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:186) ~[spring-security-web-5.7.3.jar:5.7.3] at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:354) ~[spring-web-5.3.22.jar:5.3.22] at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:267) ~[spring-web-5.3.22.jar:5.3.22] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189) ~[tomcat-embed-core-9.0.65.jar:9.0.65] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162) ~[tomcat-embed-core-9.0.65.jar:9.0.65] at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:100) ~[spring-web-5.3.22.jar:5.3.22] at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117) ~[spring-web-5.3.22.jar:5.3.22] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189) ~[tomcat-embed-core-9.0.65.jar:9.0.65] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162) ~[tomcat-embed-core-9.0.65.jar:9.0.65] at org.springframework.web.filter.FormContentFilter.doFilterInternal(FormContentFilter.java:93) ~[spring-web-5.3.22.jar:5.3.22] at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117) ~[spring-web-5.3.22.jar:5.3.22] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189) ~[tomcat-embed-core-9.0.65.jar:9.0.65] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162) ~[tomcat-embed-core-9.0.65.jar:9.0.65] at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:201) ~[spring-web-5.3.22.jar:5.3.22] at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117) ~[spring-web-5.3.22.jar:5.3.22] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189) ~[tomcat-embed-core-9.0.65.jar:9.0.65] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162) ~[tomcat-embed-core-9.0.65.jar:9.0.65] at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:197) ~[tomcat-embed-core-9.0.65.jar:9.0.65] at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:97) ~[tomcat-embed-core-9.0.65.jar:9.0.65] at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:541) ~[tomcat-embed-core-9.0.65.jar:9.0.65] at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:135) ~[tomcat-embed-core-9.0.65.jar:9.0.65] at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92) ~[tomcat-embed-core-9.0.65.jar:9.0.65] at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:78) ~[tomcat-embed-core-9.0.65.jar:9.0.65] at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:360) ~[tomcat-embed-core-9.0.65.jar:9.0.65] at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:399) ~[tomcat-embed-core-9.0.65.jar:9.0.65] at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65) ~[tomcat-embed-core-9.0.65.jar:9.0.65] at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:890) ~[tomcat-embed-core-9.0.65.jar:9.0.65] at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1789) ~[tomcat-embed-core-9.0.65.jar:9.0.65] at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) ~[tomcat-embed-core-9.0.65.jar:9.0.65] at org.apache.tomcat.util.threads.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1191) ~[tomcat-embed-core-9.0.65.jar:9.0.65] at org.apache.tomcat.util.threads.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:659) ~[tomcat-embed-core-9.0.65.jar:9.0.65] at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) ~[tomcat-embed-core-9.0.65.jar:9.0.65] at java.base/java.lang.Thread.run(Thread.java:829) ~[na:na] Caused by: com.nimbusds.jose.proc.BadJWSException: Signed JWT rejected: Invalid signature at com.nimbusds.jwt.proc.DefaultJWTProcessor.process(DefaultJWTProcessor.java:378) ~[nimbus-jose-jwt-9.22.jar:9.22] at com.nimbusds.jwt.proc.DefaultJWTProcessor.process(DefaultJWTProcessor.java:303) ~[nimbus-jose-jwt-9.22.jar:9.22] at org.springframework.security.oauth2.jwt.NimbusJwtDecoder.createJwt(NimbusJwtDecoder.java:154) ~[spring-security-oauth2-jose-5.7.3.jar:5.7.3] ... 57 common frames omitted 이런 에러가 발생하고 있습니다. 이유를 잘 모르겠습니다.

  • java
  • spring
  • spring-boot
  • oauth
JUNI 댓글 2 좋아요 0 조회수 253

homebrew로 mysql 설치시 오류

미해결

자바와 스프링 부트로 생애 최초 서버 만들기, 누구나 쉽게 개발부터 배포까지! [서버 개발 올인원 패키지]

안녕하세요. homebrew를 이용해서 mysql을 설치하려고 했는데 다음과 같은 오류가 떠서 질문글 남깁니다. 혼자 고쳐보려고 해도 인터넷에 레퍼런스가 없네요 .. homebrew 삭제후 재설치도 해봤는데 해결되지 않습니다. 도와주세요.

  • java
  • spring
  • aws
  • mysql
  • spring-boot
  • jpa
김태우 댓글 2 좋아요 0 조회수 307

loginCheckFilter 질문

미해결

스프링 MVC 2편 - 백엔드 웹 개발 활용 기술

@Bean public FilterRegistrationBean loginCheckFilter(){ FilterRegistrationBean<Filter> filterRegistrationBean = new FilterRegistrationBean<>(); //등록할 필터를 지정 filterRegistrationBean.setFilter(new LoginCheckFilter()); //필터는 체인으로 등작하기 때문에 순서가 필요. 낮을 수록 먼저 동작 filterRegistrationBean.setOrder(2); //필터를 적용할 URL 패턴을 지정. 한번에 여러 패턴을 지정 가능 filterRegistrationBean.addUrlPatterns("/*"); return filterRegistrationBean; } } 에서 @Bean public FilterRegistrationBean loginCheckFilter(){ 의 loginCheckFilter가 컨트롤러 , filterRegistrationBean.setFilter(new LoginCheckFilter()); 의 new LoginCheckFilter()); 부분이 호출하는 필터 가 맞나요?

  • spring
  • mvc
이용규 댓글 1 좋아요 0 조회수 181

Jmeter 분산 테스트 도와주세요...

미해결

저는 현재 nginx로 로컬 환경에서 로드밸런싱을 구성하였습니다. 80으로 접속하면 8080, 8081, 8082 port 중 한 곳으로 접속이 됩니다. 이에 로드밸런싱을 수행하기 전과 후의 성능 테스트를 진행하기 위해 Jmeter 툴을 이용하여 테스트를 진행하고자 했습니다. 우선 가볍게 위와 같이 설정해주었고, Timeout은 10초로 설정하였습니다. 이에 테스트를 수행하면, 정확히 1분 넘어가는 순간 이렇게 에러가 와바박 발생합니다. 대체 왜 이러는 걸까요... nginx 설정으로는 worker_processes 4; worker_connections 4096; 로 해주었습니다. 제가 놓친 부분이 무엇일까요... 제발 도와주십쇼...

  • spring
  • jmeter
  • java
  • nginx
오세창 댓글 1 좋아요 0 조회수 710

assertj의 import가 안 돼요

해결됨

스프링 입문 - 코드로 배우는 스프링 부트, 웹 MVC, DB 접근 기술

지금 30분째 붙잡고 검색하면서 해결 중인데 뭔 짓을 해도 import가 안 돼요

  • java
  • spring
  • mvc
  • spring-boot
섬섬이 댓글 1 좋아요 0 조회수 157

csrf 토큰 자동추가 질문 있습니다

미해결

스프링 시큐리티 완전 정복 [6.x 개정판]

thymleaf 의 경우에는 form tag가 붙어있고, spring security에 csrf설정이 켜져 있으면 해당 form 에 csrf input 이 hidden으로 추가되고 CookieCsrfTokenRepository를 사용할 경우에는 post요청이 아니여도 쿠키를 통해 csrf token을 전달해준다고 이해했는데 제대로 이해한걸까요?

  • spring
  • spring-boot
  • spring-security
  • security
  • web-security
kyb1208tg 댓글 2 좋아요 2 조회수 296

스피링 시큐리티 강의 너무 좋습니다

미해결

스프링 시큐리티 OAuth2

시큐리티 강의를 만들어주셔서 너무 감사합니다! 디버깅을 통한 내부 아키텍처 동작원리 이해가 너무재밌습니다 ㅎㅎ 시큐리티에 대한 거부감이 초반에 있었지만, 스프링 시큐리티 동작원리를 이해하게 되므로써 시큐리티가 재밌어지고 활용도 잘할것 같습니다. 그리고 내부 디버깅을 하면서 느낀게 코드 디자인 설계 특히 디자인 패턴에 대해서도 많이 공부할 수 있게되어서 좋은 공부 방향인것 같습니다 ㅎㅎ 다시한번 감사의 말씀을 드립니다.

  • java
  • spring
  • spring-boot
  • oauth
  • security
조병상 댓글 1 좋아요 0 조회수 118

CookieCsrfTokenRepository 방식 질문 있습니다

미해결

스프링 시큐리티 완전 정복 [6.x 개정판]

csrf는 결국 쿠키와 같이 브라우저가 자동으로 추가하는 이유로 발생하는 문제로 이해했습니다. CookieCsrfTokenRepository방식은 csrf 토큰을 쿠키로 전달하고 client 쪽에서 해당 쿠키값을 읽어서 헤더나, 매개변수로 전달하는걸로 이해했습니다. client에서 cookie를 읽기 위해서는 httponly 속성을 꺼야되는데 이러면 보안상으로 취약해진다고 알고 있는데 이러한 점에도 굳이 세션을 놔두고 해당 방식으로 하는 이점이 있을까요?

  • spring
  • spring-boot
  • spring-security
  • security
  • web-security
kyb1208tg 댓글 2 좋아요 2 조회수 278

[ultimate버전] 3:19 화면이 뜨지 않습니다

미해결

스프링 MVC 1편 - 백엔드 웹 개발 핵심 기술

서블릿의 모든 페이지는 정상동작하는 것을 확인했습니다 그러나 http://localhost:8080/jsp/members/new-form.jsp 해당 페이지에 white label error가 발생합니다 webapp.JSP.members.new -form.jsp <%@ page contentType="text/html;charset=UTF-8" language="java" %> <html> <head> <title>Title</title> </head> <body> <form action="/jsp/members/save.jsp" method="post"> username: <input type="text" name="username" /> age: <input type="text" name="age" /> <button type="submit">전송</button> </form> </body> </html> build.gradle plugins { id 'java' id 'war' id 'org.springframework.boot' version '3.3.4' id 'io.spring.dependency-management' version '1.1.6' } group = 'hello' version = '0.0.1-SNAPSHOT' java { toolchain { languageVersion = JavaLanguageVersion.of(17) } } configurations { compileOnly { extendsFrom annotationProcessor } } repositories { mavenCentral() } dependencies { implementation 'org.springframework.boot:spring-boot-starter-web' compileOnly 'org.projectlombok:lombok' annotationProcessor 'org.projectlombok:lombok' providedRuntime 'org.springframework.boot:spring-boot-starter-tomcat' testImplementation 'org.springframework.boot:spring-boot-starter-test' testRuntimeOnly 'org.junit.platform:junit-platform-launcher' implementation 'org.apache.tomcat.embed:tomcat-embed-jasper' implementation 'jakarta.servlet:jakarta.servlet-api' implementation 'jakarta.servlet.jsp.jstl:jakarta.servlet.jsp.jstl-api' implementation 'org.glassfish.web:jakarta.servlet.jsp.jstl' } tasks.named('test') { useJUnitPlatform() }

  • spring
  • mvc
다라라람쥐 댓글 2 좋아요 0 조회수 168

인기 태그

인프런 TOP Writers

주간 인기글