웹개발/스프링부트
-
스프링부트 프로젝트 복사하기웹개발/스프링부트 2019. 3. 22. 16:08
이클립스 프로젝트 복사관한 정보는 많은데 스프링부트는 없는듯?오른쪽 클릭해서 property누르면 뜨는 창에서 context 변경하고 그런게 안뜬다... 스프링부트에서 프로젝트 복사하는 방법 1 프로젝트 복붙 ctrl +c,v 실행복사하려는 프로젝트를 복사해서 프로젝트 익스플로러에 붙여넣기한다. 그러면 다음과 같이 프로젝트명을 변경하라는 입력창이 뜬다. 원래 프로젝트 msb에서 msc로 바꾸려 하는 경우 2 패키지명 일괄변경 프로젝트를 복붙한다고 패키지명도 자동으로 변경되는것은 아니다. 제일 상위패키지에 오른쪽 마우스클릭하고 Refactor > Rename… 을 클릭한다 원하는 이름으로 바꾼 후 Update references와 Rename subpackages 모두 체크하고 OK그 패키지명을 참조했던 ..
-
[문제해결]JPA를 이용한 생성시간 자동화 구현후 DB에 날짜가 null로 들어가는 문제웹개발/스프링부트 2019. 3. 22. 15:54
JPA Auditing으로 생성수정날짜 자동생성해서 DB에 입력하는 방법은 아래 포스팅을 참고 https://jojoldu.tistory.com/251?category=635883 위 포스팅대로 따라했는데 날짜가 null 들어가는 문제에 대한 하나의 해결방법이다. 현상:문제 딱히 에러는 나지 않지만 의도대로라면 날짜컬럼에 날짜가 들어가야하는데 null로 들어간다. 원인 현재시각을 따오는 클래스 BaseTimeEntity가 어노테이션 @EntityListeners(AuditingEntityListener.class)을 통해 JPA 청취를 하는데 main() 함수가 있는 클래스에서 JPA청취가능을 해주지 않았기 때문. 해결 메인함수가 있는 클래스에 @EnableJpaAuditing 어노테이션을 달아준다. B..
-
[에러]Correct the classpath of your application so that it contains a single, compatible version of웹개발/스프링부트 2019. 3. 22. 15:42
스프링부트, 그래들 프로젝트 빌드하다가 만난에러 로그 An attempt was made to call the method org.springframework.boot.autoconfigure. template.AbstractTemplateViewResolverProperties.applyToViewResolver(Ljava/lang/Object;) V but it does not exist. Its class, org.springframework.boot.autoconfigure.template.AbstractTemplateViewResolverProperties, is available from the following locations: jar:file:/C:/Users/user/.gradle/ca..
-
스프링부트 런타임시 호스트와 포트 주소 가져오기웹개발/스프링부트 2019. 3. 21. 15:43
https://stackoverflow.com/questions/38916213/how-to-get-the-spring-boot-host-and-port-address-during-run-time 일단 @SpringBootApplication 이 붙은 Applicaiton.java에서 ApplicationListner라는 인터페이스를 구현해주고 거기서 받은 ip, port값을 다른클래스에서 사용할수 잇게 햇다... Application.java @SpringBootApplication public class Application implements ApplicationListener{ @Autowired private ApplicationContext applicationContext; public in..