Spring Boot, PostgreSQL을 이용한 RESTful API, WebSocket 구현

2018. 1. 24. 00:44서버 프로그래밍


Eclipse Srping Boot 웹프로젝트 생성 / 가동

http://jsijsi99.tistory.com/6?category=710810


Spring boot 기반 REST API 제작

https://medium.com/@devAsterisk/spring-boot-%EA%B8%B0%EB%B0%98-rest-api-%EC%A0%9C%EC%9E%91-2-79c484fcadbe


Spring Boot RESTFul Web Service Example – GET/POST/PUT/PATCH/DELETE

http://www.namooz.com/2016/12/10/spring-boot-restful-web-service-example-get-post-put-delete-patch/


SpringBoot JPA 예제

http://jdm.kr/blog/121


Spring Boot 와 Spring Data (JPA) 를 이용한 간단한 DB 입출력

http://millky.com/@origoni/post/1101?language=ko_kr


spring data jpa 의 json dto

http://wonwoo.ml/index.php/post/480


Automatically Mapping DTO to Entity on Spring Boot APIs

https://auth0.com/blog/automatically-mapping-dto-to-entity-on-spring-boot-apis/?utm_source=medium&utm_medium=sc&utm_campaign=dto_entity_spring


spring boot embedded tomcat CORS 적용

http://blog.woniper.net/252

@Component
public class CORSFilter implements Filter {
    @Override
    public void init(FilterConfig filterConfig) throws ServletException {
 
    }
 
    @Override
    public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException {
        HttpServletResponse response = (HttpServletResponse) servletResponse;
        response.setHeader("Access-Control-Allow-Origin""*");
        response.setHeader("Access-Control-Allow-Methods""POST, GET, OPTIONS, DELETE");
        response.setHeader("Access-Control-Max-Age""3600");
        response.setHeader("Access-Control-Allow-Headers""x-requested-with");
        filterChain.doFilter(servletRequest, servletResponse);
    }
 
    @Override
    public void destroy() {
 
    }
}

Spring Boot - repository field required a bean named 'entityManagerFactory' that could not be found

https://stackoverflow.com/questions/42182426/spring-boot-repository-field-required-a-bean-named-entitymanagerfactory-that

spring-boot-starter-data-jpa will pull in all the hibernate dependencies you need. Using spring boot release 1.5.1, it will pull in hibernate-core:5.0.11 and hibernate-entitymanager:5.0.11. In addition to being unnecessary, your hibernate dependency versions are mismatched which is what I'm guessing is causing the error.

Try removing these dependencies from your pom.xml.

<dependency>
    <groupId>org.hibernate</groupId>
    <artifactId>hibernate-core</artifactId>
    <version>4.1.4.Final</version>
</dependency>
<dependency>
    <groupId>org.hibernate</groupId>
    <artifactId>hibernate-entitymanager</artifactId>
    <version>5.2.3.Final</version>
</dependency>


Using WebSocket to build an interactive web application

https://spring.io/guides/gs/messaging-stomp-websocket/


[SpringBoot] WebSocket을 활용한 채팅 구현하기

http://asfirstalways.tistory.com/359


Spring Boot + AngularJS 웹소캣 적용하기

http://hacks.claztec.net/2017/08/27/spring-boot-websocket-and-angularjs.html


웹소켓으로 메시지 바로 전송하기

https://stackoverflow.com/questions/33977844/spring-send-message-to-websocket-clients

Then, you can simply wire the ws messenger on your components with

@Autowired
private SimpMessagingTemplate webSocket;

and send the message with

webSocket.convertAndSend(channel, new String(message.getBody()));


spring boot jar 파일로 배포하기(deploy)

http://www.leafcats.com/178


How to resolve java.lang.NoClassDefFoundError: javax/xml/bind/JAXBException in Java 9

https://stackoverflow.com/questions/43574426/how-to-resolve-java-lang-noclassdeffounderror-javax-xml-bind-jaxbexception-in-j

In my case(spring boot fat jar) I just add the following to pom.xml.

    <dependency>
        <groupId>javax.xml.bind</groupId>
        <artifactId>jaxb-api</artifactId>
        <version>2.3.0</version>
    </dependency>


Spring Boot 프로그램을 EC2에 쉽게 배포하기

http://chanwookpark.github.io/aws/springboot/deploy/2017/01/01/spring-boot-ec2-deploy/


Spring Boot, 작업 스케쥴러 데몬 구현하기

http://jsonobject.tistory.com/236


Configuring Spring Boot for PostgreSQL

https://dzone.com/articles/configuring-spring-boot-for-postgresql


PostgreSQL 설치 및 사용 방법 정리

http://blog.naver.com/PostView.nhn?blogId=alice_k106&logNo=220847310053


PostgreSQL 데이터 타입

http://teraphonia.tistory.com/611