일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |
- 도메인
- MockMvc
- filterexpression
- 다이나모디비
- awscli
- 테스트코드
- query
- 자바
- AWS
- annotation
- Java
- awscloud
- 로드밸런서
- 자바스프링
- testresttemplate
- IdClass
- 오류
- Springsecurity
- partiql
- 개발
- javaspring
- 스프링테스트
- Route53
- markerinterface
- 스프링
- EmbeddedId
- DynamoDB
- Spring
- compositekey
- secondaryindex
- Today
- Total
목록스프링 (3)
아장아장 개발 일기
에러내용 아래의 에러메세지가 뜨며 프로그램 실행에 실패했다. org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.fasterxml.jackson.datatype.jsr310.JavaTimeModule]: Unresolvable class definition; nested exception is java.lang.NoClassDefFoundError: com/fasterxml/jackson/databind/ser/std/ToStringSerializerBase at org.springframework.beans.BeanUtils.instantiateClass (BeanUtils.java:149) at org.spr..
IntelliJ에서 프로그램을 실행시켰을땐 잘 찾아지던 file이 Jar파일로 만든후 해당 파일을 찾으려하면 FileNotFound Exception이 발생했다. 검색해보니 이미 여러 사람이 비슷한 오류를 경험한 듯 했다. 왜 IntelliJ에서는 잘 찾아지던게 Jar로 실행시키면 안되는건지 찾아보니, Jar 파일 안의 리소스들은 file이 아닌, stream이기 때문 이라고 한다. (기존 소스) ClassPathResource resource = new ClassPathResource(FilePath); String someText = new String(Files.readAllBytes(Paths.get(resource.getURI()))); (변경후) InputStream resourceStream..
mvc 구조로 이뤄진 프로젝트의 경우 mockMvc 템플릿을 사용해 테스트를 진행할 수 있습니다. mockMvc를 사용하기 전에 TestRestTemplate을 사용해 테스트를 시도했는데 spring security config때문에 로그인 페이지에서 302 에러가 표시되었습니다. 정확히 스프링 시큐리티의 httpSecurity configure의 loginform과 antMatcher로 권한 필터링하는 소스가 테스트하려는 소스로의 진입을 막는 것으로 파악했습니다. 이는 mockMvc 템플릿의 @WithMockUser, @WithUserDetails등의 어노테이션을 사용해 해결될 수 있습니다. 그렇다면 여기서 ‘TestRestTemplate을 @WithMockUser 혹은 @WithUserDetails와..