본문 바로가기

error6

[Maven/Eclipse] 빌드 시 target/generated-sources 인식 못 하는 문제 mapstruc를 써보려고 하는데 build해서 정상적으로 MapperImpl클래스가 생성된 것까지는 확인했다. 그런데 테스트를 돌려보니까 Impl클래스를 못 찾아내는 문제를 발견함 Impl클래스는 /target/generated-sources/annotation/${프로젝트 패키지} 아래 생성됨 뭐가 문젠가 찾아보다가ㅋㅋ 다른 블로그에서 보여주는 빌드 경로가 내 것과 다른 걸 발견함 그래서 maven target generated-sources 키워드 잡고 찾았더니 빌드 소스를 따로 잡아줘야 한다는 글이 나왔다 https://stackoverflow.com/questions/19633505/why-are-maven-generated-sources-not-getting-compiled Why are Ma.. 2021. 11. 7.
[Maven] 최초 build시 잡아야 하는 configuration Profile 설정 The requested profile "pom.xml" could not be activated because it does not exist. maven build할 때 뜨는 configuration 창에서 profile부분을 보면 "pom.xml"이 써 있다. 얘가 왜 들어가 있는지 모르겠는데 지워주면 해결된다. DefaultGoal 설정 No goals have been specified for this build gradle이랑 달리 maven은 goal을 설정해줘야 build가 가능하다고 한다. pom.xml에 default goal을 추가해주거나 edit configuration에 install을 추가해주자... install Goal 종류 https://choiseonj.. 2021. 11. 7.
[Test] 실제 DB로 @DataJpaTest 돌리면 뜨는 "Failed to replace DataSource with an embedded database for tests" 에러 마이바티스랑 JPA를 혼용해서 써보려는데 테스트 단계에서 에러가 떴다. Failed to replace DataSource with an embedded database for tests. If you want an embedded database please put a supported one on the classpath or tune the replace attribute of @AutoConfigureTestDatabase. 테스트에 사용한 어노테이션은 다음과 같다. @ExtendWith(SpringExtension.class) @DataJpaTest public class AccountRepositoryTest { } 그런데 @DataJpaTest가 문제였음... 학습테스트용이라 밑단부터 확인해.. 2021. 11. 6.
[Custom datasource] hikary.jdbc-url 쓰다가 Failed to configure a DataSource: 'url' 발생 *************************** APPLICATION FAILED TO START *************************** Description: Failed to configure a DataSource: 'url' attribute is not specified and no embedded datasource could be configured. Reason: Failed to determine a suitable driver class datasource를 hikari로 설정했을 때 발생하는 오류다. 에러가 발생했을 때의 application.properties spring.datasource.hikari.driver-class-name=com.mysql.cj.jdbc.D.. 2021. 11. 6.
[Swagger] Swagger2 2.xx 버전오류 swagger 도입하면서 사소한 오류들이 은근히 짜증나서 정리해 두기로 했다. 사실 정리랄 것도 없는 게 결론적으로 버전을 3.0.0으로 잡아주면 해결된다. swagger 페이지 매핑이 안 되는 경우. There was an unexpected error (type=Not Found, status=404). No handler found for GET /swagger-ui.html org.springframework.web.servlet.NoHandlerFoundException: No handler found for GET /swagger-ui.html 이 에러는 짚이는 구석이 너무 많아서 애먹었다. 원인은 찾았고 해결은 했는데 솔직히 이게 왜 뜬 건지는 아직도 모르겠음... 역시 동일하게 2.xx버전.. 2021. 11. 2.
[Spring/Mybatis] auto increment id값 return하기 의도 @Mapper클래스인 UserRepository가 UserSaveRequestDto를 받아서 저장하고, 그 결과로 auto increment가 걸린 user_id 값을 리턴받고 싶음 정석 해결방안 메소드에 @Options(useGeneratedKeys = true, keyProperty = "user_id")를 붙여주자 @Getter @Setter @NoArgsConstructor public class UserSaveRequestDto{ private String user_email; private String user_name; ... } @Mapper public interface UserRepository { @Insert("insert into ...") @Options(useGenerat.. 2021. 10. 30.
반응형