server2020. 6. 17. 20:45

[spring boot]web server failed to start. port 8080 was already in use. spring boot 해결방법

 

lsof -i :8080 | grep LISTEN

 

java      80126 qstag  125u  IPv6 0xaa073423037c1917      0t0  TCP *:http-alt (LISTEN)

 

이렇게 나온다..

 

그러면 

kill -9 80126

 

[참조] https://cnpnote.tistory.com/entry/SPRING-Spring-%EC%95%A0%ED%94%8C%EB%A6%AC%EC%BC%80%EC%9D%B4%EC%85%98-%EC%8B%A4%ED%96%89-%EC%A3%BC%EC%86%8C%EA%B0%80-%EC%9D%B4%EB%AF%B8-%EC%82%AC%EC%9A%A9-%EC%A4%91%EC%9E%85%EB%8B%88%EB%8B%A4

 

[SPRING] Spring 애플리케이션 실행 주소가 이미 사용 중입니다.

Spring 애플리케이션 실행 주소가 이미 사용 중입니다. 내 봄 응용 프로그램을 시작하는이 오류가 있습니다. java -jar target/gs-serving-web-content-0.1.0.jar . ____ _ __ _ _ /\\ / ___'_ __ _ _(_)_ __ __ _..

cnpnote.tistory.com

 

 

Posted by thdeodls85
server2020. 6. 15. 13:28

[spring boot]@requestparam null 허용방법

 

굳히 필수값이 아닐 수도 있다.. 

 

자 그러면 

 

@RequestParam(value = "id" , required = false) Long id

 

필수값이 필요하지 않다라고 명시하면 된다.

Posted by thdeodls85
server2020. 6. 12. 17:42

[spring boot]Not found in annotated query error with @Query 해결방법

 

jpa모델 참조를 다른 테이블을 FK 했다..

 

그러면 그 객체 자체를 넣어줘야 변경이 가능하다..

 

만약 다른 테이블의 참조값이 category_id = 1 로 db에는 표현되있어도..

 

jap annotated 연결 시켰기 때문에 ... category table의 객체를 가지고 들어와서 보내줘야 한다...

 

예를 들어 

 

Optional<Category> categoryEntityWrapper = categoryRepository.findById(category_id);

Category categoryEntity = categoryEntityWrapper.get();

objectDto.setCategory(categoryEntity);

 

위에서 보면 .. category table에서 객체를 가지고 와서 dto에 객체 그대로 넣고

 

@query 날릴때, 

 

object.category_id = :#{#category} 

 

category_id 에 등록 된 객체가 변경 된다.. 

 

 

Posted by thdeodls85
server2020. 6. 12. 11:40

[spring boot]is missing required source folder 'src/test/resources' 해결방법

 

처음 프로젝트를 import 하면 엉킬 수 있다..

 

그러면 java build path 들어가서 

 

오류 해당하는 탭을 제일 상위로 올려주면 된다.

 

[참조] https://comtoo.tistory.com/entry/%ED%8E%8C-Project-xxx-is-missing-required-source-folder-gen-%ED%95%B4%EA%B2%B0%ED%95%98%EA%B8%B0

 

[펌] Project 'xxx' is missing required source folder: 'gen' 해결하기

Hello Android 프로젝트를 하면서 프로젝트 생성시 발생하는 두 개의 에러를 해결하기 위한 방법이다. 프로젝트의 Property 대화상자에서 Java Build Path 의 내용 중 프로젝트에 해당하는 Android 버전을 가

comtoo.tistory.com

 

Posted by thdeodls85
server2020. 6. 8. 18:15

[sql]timeStamp 현재시간 넣는 방법

 

update_time = CURRENT_TIMESTAMP

Posted by thdeodls85
server2020. 6. 8. 11:47

[spring boot]jpa save 이후, 객체 return 방법

 

save 하고 나서 return 객체를 하고 싶다. 제대로 들어 갔는지 client알리기 위해서다..

 

Object obj = Repository.saveAndFlush(Entity);

Posted by thdeodls85
server2020. 5. 27. 17:24

[spring boot]jap 연관관계 mapping 설명

 

잘 설명되있음..

 

[참조] https://victorydntmd.tistory.com/208?category=795879

Posted by thdeodls85
server2020. 5. 26. 16:42

[spring boot]Validation failed for query for method 이슈 해결방법

 

native query 사용시, 

 

nativeQuery = true 해주면 된다. 

Posted by thdeodls85