๐Ÿ—ณ๏ธ์ธ์ฆ/์ธ๊ฐ€ ์„œ๋ฒ„ - ์†Œ์…œ๋กœ๊ทธ์ธ ๊ตฌํ˜„ ๋‘๋ฒˆ์งธ(๊ตฌ๊ธ€๋กœ๊ทธ์ธ๊นŒ์ง€)

์ดํ•˜์–€ยท2023๋…„ 1์›” 25์ผ
0

๐ŸŽฟ Smailegate(Winter-Devcamp)

๋ชฉ๋ก ๋ณด๊ธฐ
21/49
post-thumbnail

๋ˆ„๊ฐ€ ์ด๊ธฐ๋‚˜ ํ•œ๋ฒˆ ํ•ด๋ณด์ž ์ด๊ฑฐ์•ผ...

๊ธฐ์ค€ ๋งํฌ

Spring Bootแ„‹แ…ช AWSแ„…แ…ฉ แ„’แ…ฉแ†ซแ„Œแ…ก แ„€แ…ฎแ„’แ…งแ†ซแ„’แ…กแ„‚แ…ณแ†ซ แ„‹แ…ฐแ†ธแ„‰แ…ฅแ„‡แ…ตแ„‰แ…ณ 5์žฅ

๊ทธ ์™ธ ์ฐธ๊ณ  ๋งํฌ

SpringBoot์—์„œ JPA ์‚ฌ์šฉํ•˜๊ธฐ(4) - JPA Auditing
์Šคํ”„๋ง ๋ถ€ํŠธ๋กœ OAuth2 ๊ตฌํ˜„(ํŽ˜์ด์Šค๋ถ, ๊ตฌ๊ธ€, ์นด์นด์˜ค, ๋„ค์ด๋ฒ„)

์ง„ํ–‰ ์ƒํ™ฉ ์ •๋ฆฌ

  1. ์Šคํ”„๋ง ์‹œํ๋ฆฌํ‹ฐ์™€ ์Šคํ”„๋ง ์‹œํ๋ฆฌํ‹ฐ Oauth2 ํด๋ผ์ด์–ธํŠธ -> ์™„๋ฃŒ
  2. ๊ตฌ๊ธ€ ์„œ๋น„์Šค ๋“ฑ๋ก -> ์™„๋ฃŒ

  1. ๊ตฌ๊ธ€ ๋กœ๊ทธ์ธ ์—ฐ๋™ํ•˜๊ธฐ -> ๊ณผ์ •

ํ”„๋กœ์ ํŠธ ์ƒ์„ฑ

  • ํ”„๋กœ์ ํŠธ๋Š” Spring Initializr์—์„œ ์ƒ์„ฑ
    -> ์˜์กด์„ฑ์ด๋‚˜ ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ๋Š” ๊ตฌํ˜„ํ•˜๋ฉด์„œ ํ•˜๋‚˜์”ฉ ๋„ฃ์–ด๊ฐˆ ์˜ˆ์ •์ด๋‹ค.
    -> ๋ฏธ๋ฆฌ ๋‹ค ๋„ฃ์–ด๋‘๊ณ  ์‹œ์ž‘ํ–ˆ๋˜๊ฒŒ ์˜ค๋ฅ˜์˜ ์›์ธ์ธ๋“ฏ ํ•˜์—ฌ...
    -> ์ฃผ์˜ํ•  ์ 
  • ๋ณธ ํ”„๋กœ์ ํŠธ๋Š” springboot 3.0 ์ด์ƒ์ด๊ธฐ ๋•Œ๋ฌธ์— ๋ณ€๊ฒฝํ•ด์•ผ ํ•œ๋‹ค.javax.persi.. -> jakarta.persi...

- User.java

package com.example.OAuth2Login.domain.user;

import com.example.OAuth2Login.domain.BaseTimeEntity;
import lombok.Builder;
import lombok.Getter;
import lombok.NoArgsConstructor;

import jakarta.persistence.*;

@Getter
@NoArgsConstructor
@Entity
public class User extends BaseTimeEntity {
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long id;

    @Column(nullable = false)
    private String name;

    @Column(nullable = false)
    private String email;

    @Column
    private String picture;

    @Enumerated(EnumType.STRING)
    @Column(nullable = false)
    private Role role;

    @Builder
    public User(String name, String email, String picture, Role role) {
        this.name = name;
        this.email = email;
        this.picture = picture;
        this.role = role;
    }

    public User update(String name, String picture) {
        this.name = name;
        this.picture = picture;

        return this;
    }
    public String getRoleKey() {
        return  this.role.getKey();
    }
}

(์—๋Ÿฌ ๋‚˜๋Š” ๋ถ€๋ถ„์€ ์šฐ์„ ์ ์œผ๋กœ Alt + Enter๋ฅผ ํ†ตํ•ด ์ž๋™ ํ•ด๊ฒฐ -> ์•ˆ๋˜๋ฉด ์ฐพ์•„๋ณด๊ธฐ)
import com.example.OAuth2Login.domain.BaseTimeEntity;
public class User extends BaseTimeEntity {
2๊ฐ€์ง€์—์„œ ๋ฌธ์ œ ๋ฐœ์ƒ

-> ํ•ด๊ฒฐ๋ฐฉ๋ฒ•
1) build.gradle์—์„œ ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ ์ถ”๊ฐ€

  • build.grable
plugins {
	id 'java'
	id 'org.springframework.boot' version '3.0.2'
	id 'io.spring.dependency-management' version '1.1.0'
}

group = 'com.example'
version = '0.0.1-SNAPSHOT'
sourceCompatibility = '17'

repositories {
	mavenCentral()
}

dependencies {
	implementation 'org.springframework.boot:spring-boot-starter-web'
	compileOnly 'org.projectlombok:lombok'
	implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
	implementation 'org.springframework.boot:spring-boot-starter'
	implementation 'org.springframework.boot:spring-boot-starter-oauth2-client'
	testImplementation 'org.springframework.boot:spring-boot-starter-test'
}

tasks.named('test') {
	useJUnitPlatform()
}

implementation 'org.springframework.boot:spring-boot-starter-web'
compileOnly 'org.projectlombok:lombok'
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'

์ด ๋ถ€๋ถ„ ์ถ”๊ฐ€ํ•  ๊ฒƒ

2) BaseTimeEntity.java ์ถ”๊ฐ€
์ด ๋ถ€๋ถ„์€ ์•„์ฃผ ๊ธฐ์ดˆ์ ์ธ ์ž๋ฐ”์˜€๋Š”๋ฐ, import๋ฅผ ํ–ˆ์œผ๋‚˜ ํƒ€๊ฒŸํ•˜๊ณ  ์žˆ๋Š” java ํŒŒ์ผ์ด ์—†์œผ๋‹ˆ ๋‹น์—ฐํžˆ ์˜ค๋ฅ˜๊ฐ€ ๋‚˜๋Š” ๊ฒƒ์ด์—ˆ๋‹ค.

- BaseTimeEntity.java ์ฝ”๋“œ

package com.example.OAuth2Login.domain;

import lombok.Getter;
import org.springframework.data.annotation.CreatedDate;
import org.springframework.data.annotation.LastModifiedDate;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;

import jakarta.persistence.EntityListeners;
import jakarta.persistence.MappedSuperclass;
import java.time.LocalDateTime;

@Getter
@MappedSuperclass
@EntityListeners(AuditingEntityListener.class)

public abstract class BaseTimeEntity {
    @CreatedDate
    private LocalDateTime createdDate;

    @LastModifiedDate
    private LocalDateTime modifiedDate;

}

- Role.java -> ์œ„์˜ User.java์™€ ์œ„์น˜ ๋™์ผ

package com.example.OAuth2Login.domain.user;

import lombok.Getter;
import lombok.RequiredArgsConstructor;

@Getter
@RequiredArgsConstructor
public enum Role {
    GUEST("ROLE_GUEST","์†๋‹˜"),
    USER("ROLE_USER","์ผ๋ฐ˜ ์‚ฌ์šฉ์ž");

    private final String key;
    private final String title;
}

- UserRepository.java
OAuth2Login\src\main\java\com\example\OAuth2Login\domain\user\UserRepository.java

  • ์ฝ”๋“œ
package com.example.OAuth2Login.domain.user;

import lombok.Getter;
import lombok.RequiredArgsConstructor;

@Getter
@RequiredArgsConstructor
public enum Role {
    GUEST("ROLE_GUEST","์†๋‹˜"),
    USER("ROLE_USER","์ผ๋ฐ˜ ์‚ฌ์šฉ์ž");

    private final String key;
    private final String title;
}

์Šคํ”„๋ง ์‹œํ๋ฆฌํ‹ฐ ์„ค์ •

  1. build.gradle์— ๊ด€๋ จ ์˜์กด์„ฑ ์ถ”๊ฐ€ํ•˜๊ธฐ
  • build.gradle
plugins {
	id 'java'
	id 'org.springframework.boot' version '3.0.2'
	id 'io.spring.dependency-management' version '1.1.0'
}

group = 'com.example'
version = '0.0.1-SNAPSHOT'
sourceCompatibility = '17'

repositories {
	mavenCentral()
}

dependencies {
	implementation 'org.springframework.boot:spring-boot-starter-web'
	compileOnly 'org.projectlombok:lombok'
	implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
	implementation 'org.springframework.boot:spring-boot-starter'
	implementation 'org.springframework.boot:spring-boot-starter-oauth2-client'
	testImplementation 'org.springframework.boot:spring-boot-starter-test'
}

tasks.named('test') {
	useJUnitPlatform()
}


  1. ์•ž์œผ๋กœ ์‹œํ๋ฆฌํ‹ฐ ๊ด€๋ จ ํด๋ž˜์Šค๋ฅผ ๋‹ด์„ config.auth ํŒจํ‚ค์ง€๋ฅผ ์ƒ์„ฑ & SecurityConfig.java ์ƒ์„ฑ
  • ์ฃผ์˜ : ์•„์ง CustomOAuth2UserService ํด๋ž˜์Šค๋ฅผ ๋งŒ๋“ค์ง€ ์•Š์•„ ์ปดํŒŒ์ผ ์—๋Ÿฌ๊ฐ€ ๋ฐœ์ƒํ•ด๋„ ๋จ.
    OAuth2Login\src\main\java\com\example\OAuth2Login\config\auth\SecurityConfig.java

  • SecurityConfig.java ์ฝ”๋“œ -> ์—๋Ÿฌ ๋ฐœ์ƒ
    1) "WebSecurityConfigurerAdapter Deprecated" + ".authorizeRequests() is deprecated" ํ•ด๊ฒฐ

  • ์ด์ „(Springboot 2.X์—์„œ ์‚ฌ์šฉํ•˜๋Š” ๋ฐฉ์‹์— ๋”ฐ๋ฅธ ์—๋Ÿฌ ๋ฐœ์ƒ)

.authorizeRequests()
                    .antMatchers("/","/css/**","/images/**","/js/**","/h2-console/**").permitAll()
                    .antMatchers("/api/v1/**").hasRole(Role.USER.name())
                    .anyRequest().authenticated()
  • ์ดํ›„(Springboot 3.X์—์„œ ์‚ฌ์šฉํ•ด์•ผ ํ•˜๋Š” ๋ฐฉ์‹)
    - ์ฐธ๊ณ  ๋งํฌ : Updating to Spring Security 6.0 - replacing Removed and Deprecated functionality for securing requests

    -> ์—ฌ๊ธฐ์—์„œ ์ž˜ ๋ณด๋ฉด ํ•ด๊ฒฐ ๊ฐ€๋Šฅํ•˜๋‹ค(์‚ฌ์‹ค ์ด์ „ ํ”„๋กœ์ ํŠธ ํ• ๋•Œ๋„ ์ด ๋ฌธ์ œ๊ฐ€ ์žˆ์—ˆ๋‹ค.... ํ•ด๊ฒฐ ๋ชปํ•œ๊ฑฐ์˜€๋„ค ใ…Žใ…Žใ…Ž)

    -> ".authorizeRequests()" ๋Œ€์‹  ".authorizeHttpRequests()"
    -> ".antMatchers(..." ๋Œ€์‹  ".requestMatchers(..."

  • ๋ฐ˜์˜๋œ SecurityConfig.java ์ฝ”๋“œ

package com.example.OAuth2Login.config.auth;

import com.example.OAuth2Login.domain.user.Role;
import lombok.RequiredArgsConstructor;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
import org.springframework.security.web.SecurityFilterChain;

@Configuration
@RequiredArgsConstructor
@EnableWebSecurity //1
public class SecurityConfig {

    private final CustomOAuth2UserService customOAuth2UserService;

    @Bean
    public SecurityFilterChain filterChain(HttpSecurity http) throws Exception {
        http
                .csrf().disable()
                .headers().frameOptions().disable() //2
                .and()
                .authorizeHttpRequests() //3
                .requestMatchers("/","/css/**","/images/**","/js/**","/h2-console/**").permitAll()
                .requestMatchers("/api/v1/**").hasRole(Role.USER.name()) //4
                .anyRequest().authenticated()//5
                .and()
                .logout()
                .logoutSuccessUrl("/")//6
                .and()
                .oauth2Login()//7
                .userInfoEndpoint()//8
                .userService(customOAuth2UserService);//9
        return http.build();
    }
}
  • ์—๋Ÿฌ ์ƒํ™ฉ

  • CustomOAuth2UserService.java ์ƒ์„ฑ
    ์œ„์น˜ : ๋ฐ”๋กœ ์œ„์˜ SecurityConfig.java์™€ ๋™์ผํ•œ ์œ„์น˜

  • CustomOAuth2UserService.java ์ฝ”๋“œ -> ํ˜„์žฌ ๋‹จ๊ณ„์—๋Š” ์•„์ง ์ƒ์„ฑ๋˜์ง€ ์•Š์€ ํด๋ž˜์Šค๋“ค์ด ์žˆ์–ด ์—๋Ÿฌ ๋ฐœ์ƒํ•˜๋Š” ๊ฒƒ์œผ๋กœ ๋ณด์ž„.

package com.example.OAuth2Login.config.auth;

import com.example.OAuth2Login.domain.user.User;
import com.example.OAuth2Login.domain.user.UserRepository;
import lombok.RequiredArgsConstructor;
import org.springframework.security.core.authority.SimpleGrantedAuthority;
import org.springframework.security.oauth2.client.userinfo.DefaultOAuth2UserService;
import org.springframework.security.oauth2.client.userinfo.OAuth2UserRequest;
import org.springframework.security.oauth2.client.userinfo.OAuth2UserService;
import org.springframework.security.oauth2.core.OAuth2AuthenticationException;
import org.springframework.security.oauth2.core.user.DefaultOAuth2User;
import org.springframework.security.oauth2.core.user.OAuth2User;
import org.springframework.stereotype.Service;

import jakarta.servlet.http.HttpSession;
import java.util.Collections;

@RequiredArgsConstructor
@Service
public class CustomOAuth2UserService implements OAuth2UserService<OAuth2UserRequest, OAuth2User> {
    private final UserRepository userRepository;
    private final HttpSession httpSession;

    @Override
    public OAuth2User loadUser(OAuth2UserRequest userRequest) throws OAuth2AuthenticationException {
        OAuth2UserService<OAuth2UserRequest, OAuth2User> delegate = new DefaultOAuth2UserService();
        OAuth2User oAuth2User = delegate.loadUser(userRequest);

        String registrationId = userRequest
                .getClientRegistration().getRegistrationId(); //1
        String userNameAttributeName = userRequest
                .getClientRegistration().getProviderDetails()
                .getUserInfoEndpoint()
                .getUserNameAttributeName(); //2

        OAuthAttributes attributes = OAuthAttributes.of(registrationId, userNameAttributeName,
                oAuth2User.getAttributes()); //3

        User user = saveOrUpdate(attributes);

        httpSession.setAttribute("user", new SessionUser(user)); //4

        return new DefaultOAuth2User(
                Collections.singleton(new
                        SimpleGrantedAuthority((user.getRoleKey()))),
                attributes.getAttributes(),
                attributes.getNameAttributeKey()
        );
    }

    private User saveOrUpdate (OAuthAttributes attributes) {
        User user = userRepository.findByEmail(attributes.getEmail())
                .map(entity -> entity.update(attributes.getName(), attributes.getPicture()))
                .orElse(attributes.toEntity());
        return userRepository.save(user);
    }
}
  • ์—๋Ÿฌ

  • ์šฐ์„  ๊ณ„์† ์ง„ํ–‰ํ•˜๊ธฐ


  • OAuthAttributesํด๋ž˜์Šค ์ƒ์„ฑ
    -> OAuthAttributes๋Š” Dto๋กœ ๋ด์•ผ ํ•œ๋‹ค -> config.auth.dto ํŒจํ‚ค์ง€์— ์ƒ์„ฑ

  • ์œ„์น˜

- OAuthAttributes.java ์ฝ”๋“œ

package com.example.OAuth2Login.config.auth.dto;

import com.example.OAuth2Login.domain.user.Role;
import com.example.OAuth2Login.domain.user.User;
import lombok.Builder;
import lombok.Getter;

import java.util.Map;

@Getter
public class OAuthAttributes {
    private Map<String, Object> attributes;
    private String nameAttributeKey;
    private String name;
    private String email;
    private String picture;

    @Builder
    public OAuthAttributes(Map<String, Object> attributes, String nameAttributeKey, String name, String email, String picture) {
        this.attributes = attributes;
        this.nameAttributeKey = nameAttributeKey;
        this.name = name;
        this.email = email;
        this.picture = picture;
    }

    public static OAuthAttributes of(String registrationId,
                                     String userNameAttributeName,
                                     Map<String, Object> attributes) {
        return ofGoogle(userNameAttributeName, attributes);
    }

    //1
    private static OAuthAttributes ofGoogle(String
                                                    userNameAttributeName,
                                            Map<String, Object> attributes) {
        return OAuthAttributes.builder()
                .name((String)attributes.get("name"))
                .email((String)attributes.get("email"))
                .picture((String) attributes.get("picture"))
                .attributes(attributes)
                .nameAttributeKey(userNameAttributeName)
                .build();
    }

    //2
    public User toEntity(){
        return User.builder()
                .name(name)
                .email(email)
                .picture(picture)
                .role(Role.GUEST)
                .build();
    }
}

  • ๊ฐ™์€ ํŒจํ‚ค์ง€์— SessionUser ํด๋ž˜์Šค ์ถ”๊ฐ€
  • ์œ„์น˜

- SessionUser.java ์ฝ”๋“œ

package com.example.OAuth2Login.config.auth.dto;

import com.example.OAuth2Login.domain.user.User;
import lombok.Getter;

import java.io.Serializable;

@Getter
public class SessionUser implements Serializable {
    private String name;
    private String email;
    private String picture;

    public SessionUser(User user) {
        this.name = user.getName();
        this.email = user.getEmail();
        this.picture = user.getPicture();
    }
}

  • ํ•ด๋‹น ๊ณผ์ •๊นŒ์ง€ ๋งˆ์นœ ํ›„์—, ๋‹ค์‹œ CustomOAuth2UserService.java ๋“ค์–ด๊ฐ€์„œ Alt_Enter๋กœ ์—๋Ÿฌ ๋‚ ๋ ค์ฃผ๊ธฐ

๋กœ๊ทธ์ธ ๊ธฐ๋Šฅ ํ…Œ์ŠคํŠธ

  • ๋กœ๊ทธ์ธ ๋ฒ„ํŠผ ์ถ”๊ฐ€ํ•˜๊ธฐ
  • src/main/resources/templates/index.mustache ํŒŒ์ผ ์ถ”๊ฐ€ํ•˜๊ธฐ
    -> ์ด ๋‹จ๊ณ„์—์„œ ํ”Œ๋Ÿฌ๊ทธ์ธ installํ•ด์•ผํ•œ๋‹ค.(์œ„์˜ ํŒŒ๋ž€ ์ค„ ์ฐธ๊ณ )

- index.mustache ์ฝ”๋“œ -> ์›๋ž˜ ๋ณด์—ฌ์ค€ ์ฝ”๋“œ๋กœ๋Š” ํƒœ๊ทธ๊ฐ€ ๋‹ค ๋‹ซํžˆ์ง€ ์•Š์•„์„œ ๊ตฌ๊ธ€๋งํ•ด์„œ ๋ฐ‘๋ถ€๋ถ„์„ ์ถ”๊ฐ€ํ•ด์„œ ๋„ฃ์—ˆ๋‹ค.

{{>layout/header}}


<h1>์Šคํ”„๋ง๋ถ€ํŠธ๋กœ ์‹œ์ž‘ํ•˜๋Š” ์›น ์„œ๋น„์Šค Ver.2</h1>
<div class="col-md-12">
    <div class="row">
        <div class="col-md-6">
            <a href="/posts/save" role="button" class="btn btn-primary">๊ธ€ ๋“ฑ๋ก</a>
            {{#userName}}
                Logged in as: <span id="user">{{userName}}</span>
                <a href="/logout" class="btn btn-info active" role="button">Logout</a>
            {{/userName}}
            {{^userName}}
                <a href="/oauth2/authorization/google" class="btn btn-success active" role="button">Google Login</a>
                <a href="/oauth2/authorization/naver" class="btn btn-secondary active" role="button">Naver Login</a>
            {{/userName}}
        </div>
    </div>
    <br>
    <!-- ๋ชฉ๋ก ์ถœ๋ ฅ ์˜์—ญ -->
    <table class="table table-horizontal table-bordered">
        <thead class="thead-strong">
        <tr>
            <th>๊ฒŒ์‹œ๊ธ€๋ฒˆํ˜ธ</th>
            <th>์ œ๋ชฉ</th>
            <th>์ž‘์„ฑ์ž</th>
            <th>์ตœ์ข…์ˆ˜์ •์ผ</th>
        </tr>
        </thead>
        <tbody id="tbody">
        {{#posts}}
            <tr>
                <td>{{id}}</td>
                <td><a href="/posts/update/{{id}}">{{title}}</a></td>
                <td>{{author}}</td>
                <td>{{modifiedDate}}</td>
            </tr>
        {{/posts}}
        </tbody>
    </table>
</div>
{{>layout/footer}}

  • index.mustache์—์„œ userName์„ ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ๋„๋ก userName์„ Model์— ์ถ”๊ฐ€ํ•˜๋Š” ์ฝ”๋“œ ์ƒ์„ฑ

  • IndexController.java

  • ์œ„์น˜ : ๊ธฐ๋ณธ ํŒจํ‚ค์ง€ ์•„๋ž˜์— web ํŒจํ‚ค์ง€ ์ƒ์„ฑํ•˜๊ณ , indexController.java ์ƒ์„ฑํ•ด์•ผํ•œ๋‹ค.

    - IndexController.java ์ฝ”๋“œ

package com.example.OAuth2Login.web;

import com.example.OAuth2Login.config.auth.dto.SessionUser;
import com.example.OAuth2Login.service.posts.PostsService;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;

@RequiredArgsConstructor
@Controller
public class IndexController {
    private final PostService postService;
    @GetMapping("/")
    public String index(Model model){
        model.addAttribute("posts", postsService.findAllDesc());
        SessionUser user = (SessionUser) httpSession.getAttribute("user");
        if(user != null) {
            model.addAttribute("userName", user.getName());
        }
        return "index";
    }
}

์—๋Ÿฌ ๋ฐœ์ƒ

-> ์ž์„ธํžˆ ์‚ดํŽด๋ณด๋ฉด service/posts์˜ PostsService.java๊ฐ€ ์—†์–ด ๋ฐœ์ƒํ–ˆ์Œ์„ ์•Œ ์ˆ˜ ์žˆ๋‹ค.

-> ํ•ด๊ฒฐ
1) service/posts ํŒจํ‚ค์ง€ ์ƒ์„ฑ & PostsService.java ์ž‘์„ฑ

  • ์œ„์น˜

2) ๊ทธ ๊ณผ์ •์—์„œ ์ด๋ ‡๊ฒŒ import ํ•˜๊ธฐ ์œ„ํ•œ ํŒŒ์ผ๋“ค์„ ๋ชจ๋‘ ์ƒ์„ฑํ•ด์ค˜์•ผ ํ•œ๋‹ค.
(์ด ๋ถ€๋ถ„์€ ๊ธฐ์ค€์œผ๋กœ ๋ณด๊ณ  ํ–ˆ๋˜ ๋ธ”๋กœ๊ทธ์—๋Š” ๋‚ด์šฉ์ด ์—†์–ด ์ฐพ์•˜๋‹ค.)
์ฐธ๊ณ  ๊นƒํ—ˆ๋ธŒ ๋งํฌ : https://github.com/gkdud583/freelec-springboot2-webservice

- PostsService.java ์ฝ”๋“œ

package com.example.OAuth2Login.service.posts;

import com.example.OAuth2Login.domain.posts.Posts;
import com.example.OAuth2Login.domain.posts.PostsRepository;
import com.example.OAuth2Login.web.dto.PostsListResponseDto;
import com.example.OAuth2Login.web.dto.PostsResponseDto;
import com.example.OAuth2Login.web.dto.PostsSaveRequestDto;
import com.example.OAuth2Login.web.dto.PostsUpdateRequestDto;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;
import java.util.stream.Collectors;

@RequiredArgsConstructor
@Service
public class PostsService {
    private final PostsRepository postsRepository;

    @Transactional
    public Long save(PostsSaveRequestDto requestDto){
        return postsRepository.save(requestDto.toEntity()).getId();
    }

    @Transactional
    public Long update(Long id, PostsUpdateRequestDto requestDto){
        Posts posts = postsRepository.findById(id)
                .orElseThrow(() -> new IllegalArgumentException(("ํ•ด๋‹น ๊ฒŒ์‹œ๊ธ€์ด ์—†์Šต๋‹ˆ๋‹ค. id="+id)));
        posts.update(requestDto.getTitle(), requestDto.getContent());

        return id;
    }

    public PostsResponseDto findById(Long id){
        Posts entity = postsRepository.findById(id)
                .orElseThrow(() -> new IllegalArgumentException("ํ•ด๋‹น ๊ฒŒ์‹œ๊ธ€์ด ์—†์Šต๋‹ˆ๋‹ค. id="+id));
        return new PostsResponseDto(entity);
    }

    @Transactional(readOnly = true)
    public List<PostsListResponseDto> findAllDesc(){
        return postsRepository.findAllDesc().stream()
                .map(PostsListResponseDto::new)
                .collect(Collectors.toList());
    }

    @Transactional
    public void delete(Long id){
        Posts posts = postsRepository.findById(id)
                .orElseThrow(() -> new IllegalArgumentException("ํ•ด๋‹น ๊ฒŒ์‹œ๊ธ€์ด ์—†์Šต๋‹ˆ๋‹ค. id=" + id));
        postsRepository.delete(posts);


    }

}

  • ๋‹ค์‹œ indexController.java๋กœ ๋Œ์•„์™€์„œ ํ•œ๊ฐ€์ง€ ํŒŒ์ผ๋งŒ ๋” ๋งŒ๋“ค์–ด์ฃผ๋ฉด ๋  ๊ฒƒ ๊ฐ™๋‹ค.
    (์ด ์—ญ์‹œ ์ข€ ์œ„์— ์žˆ๋Š” ๊นƒํ—ˆ๋ธŒ ๋งํฌ๋ฅผ ๋ณด๋ฉฐ ์ฐพ์•˜๋‹ค.)

    -> LoginUser.java๊นŒ์ง€ ๋„ฃ์–ด์ฃผ๊ณ , ๋‹ค์‹œ ๋Œ์•„์™€ ํ•ด๊ฒฐํ•˜๋‹ˆ ๋“œ๋””์–ด ๋๋‹ค.

- indexController.java ์ฝ”๋“œ

package com.example.OAuth2Login.web;

import com.example.OAuth2Login.config.auth.LoginUser;
import com.example.OAuth2Login.config.auth.dto.SessionUser;
import com.example.OAuth2Login.service.posts.PostsService;
import com.example.OAuth2Login.web.dto.PostsResponseDto;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;


@RequiredArgsConstructor
@Controller
public class IndexController {
    private final PostsService postsService;

    @GetMapping("/")
    public String index(Model model, @LoginUser SessionUser user){
        model.addAttribute("posts", postsService.findAllDesc());

        if(user != null){
            model.addAttribute("userName", user.getName());
        }
        return "index";

    }

    @GetMapping("/posts/save")
    public String postsSave(){
        return "posts-save";
    }

    @GetMapping("/posts/update/{id}")
    public String postsUpdate(@PathVariable Long id, Model model){
        PostsResponseDto dto = postsService.findById(id);
        model.addAttribute("post", dto);

        return "posts-update";

    }
}

ํ…Œ์ŠคํŠธ

-> ํ…Œ์ŠคํŠธ ์‹คํŒจ

  • ์ด์œ ๋Š” ๋ญ˜๊นŒ?
  1. ํ˜„์žฌ ์ƒํ™ฉ
    build๋Š” success์ธ ์ƒํƒœ.
    ํ•˜์ง€๋งŒ, runํ–ˆ์„ ๊ฒฝ์šฐ ์ปค๋„ฅ์…˜์— ๋ฌธ์ œ๊ฐ€ ์ƒ๊ธฐ๋Š” ๊ฒƒ ๊ฐ™๋‹ค.

"2023-01-25T17:25:26.807+09:00 ERROR 17460 --- [ main] com.zaxxer.hikari.pool.HikariPool : HikariPool-1 - Exception during pool initialization."
์ด ๋ถ€๋ถ„์—์„œ ํƒ€์ž„์•„์›ƒ์œผ๋กœ ์—๋Ÿฌ๊ฐ€ ๋ฐœ์ƒํ•˜๋Š” ๋“ฏ ํ•œ๋ฐ....
์–ด๋–ป๊ฒŒ ์ฒ˜๋ฆฌํ•ด์•ผํ• ์ง€ ๊ณ ๋ฏผ์ด๋‹ค.

- ์—๋Ÿฌ ๋กœ๊ทธ ์ „๋ฌธ

"C:\Program Files\Java\jdk-17.0.5\bin\java.exe" -agentlib:jdwp=transport=dt_socket,address=127.0.0.1:57592,suspend=y,server=n -javaagent:C:\Users\dlgkd\AppData\Local\JetBrains\IdeaIC2022.3\captureAgent\debugger-agent.jar -Dfile.encoding=UTF-8 -classpath "C:\Users\dlgkd\OneDrive\๋ฐ”ํƒ• ํ™”๋ฉด\OAuth2Login\out\production\classes;C:\Users\dlgkd\OneDrive\๋ฐ”ํƒ• ํ™”๋ฉด\OAuth2Login\out\production\resources;C:\Users\dlgkd\.gradle\caches\modules-2\files-2.1\org.springframework.boot\spring-boot-starter-web\3.0.2\3f6a2cb4cb11bac3611f5a95e234589eb190dd29\spring-boot-starter-web-3.0.2.jar;C:\Users\dlgkd\.gradle\caches\modules-2\files-2.1\org.springframework.boot\spring-boot-starter-data-jpa\3.0.2\fc0dbe82effb33d3d89b4cf2ec6b7968ad2af558\spring-boot-starter-data-jpa-3.0.2.jar;C:\Users\dlgkd\.gradle\caches\modules-2\files-2.1\org.springframework.boot\spring-boot-starter-jdbc\3.0.2\662285456edce14301de88fc0ab4937643a51b50\spring-boot-starter-jdbc-3.0.2.jar;C:\Users\dlgkd\.gradle\caches\modules-2\files-2.1\org.springframework.boot\spring-boot-starter-oauth2-client\3.0.2\f2040c40dd86f8d1e402d0d06ff162f2d4194b38\spring-boot-starter-oauth2-client-3.0.2.jar;C:\Users\dlgkd\.gradle\caches\modules-2\files-2.1\org.springframework.boot\spring-boot-starter\3.0.2\a9426629b5a83ad64fbe4e1d24081cccf4cdab14\spring-boot-starter-3.0.2.jar;C:\Users\dlgkd\.gradle\caches\modules-2\files-2.1\org.springframework.boot\spring-boot-starter-json\3.0.2\11b9a2903af9014696d2576605bb73e8bca6ee19\spring-boot-starter-json-3.0.2.jar;C:\Users\dlgkd\.gradle\caches\modules-2\files-2.1\org.springframework.boot\spring-boot-starter-tomcat\3.0.2\4d50f0cdcb4b8f74221ae823dd77c18290473045\spring-boot-starter-tomcat-3.0.2.jar;C:\Users\dlgkd\.gradle\caches\modules-2\files-2.1\org.springframework\spring-webmvc\6.0.4\84ee8a9107480c92186ef8216ba0e1dca6ee1665\spring-webmvc-6.0.4.jar;C:\Users\dlgkd\.gradle\caches\modules-2\files-2.1\org.springframework\spring-web\6.0.4\de18e3e75a0e56534d9df5978bd2f43f950e1b4a\spring-web-6.0.4.jar;C:\Users\dlgkd\.gradle\caches\modules-2\files-2.1\com.mysql\mysql-connector-j\8.0.32\41ec3f8cdaccf6c46a47d7cd628eeb59a926d9d4\mysql-connector-j-8.0.32.jar;C:\Users\dlgkd\.gradle\caches\modules-2\files-2.1\org.springframework.boot\spring-boot-starter-aop\3.0.2\cfb3ff6a7f8d47c9703f140387f39a837b81ab52\spring-boot-starter-aop-3.0.2.jar;C:\Users\dlgkd\.gradle\caches\modules-2\files-2.1\org.hibernate.orm\hibernate-core\6.1.6.Final\e2ff7dfc50d16377da7bedbf48a0a2e9db30ac66\hibernate-core-6.1.6.Final.jar;C:\Users\dlgkd\.gradle\caches\modules-2\files-2.1\org.springframework.data\spring-data-jpa\3.0.1\96f4ea7c780b6c902f83f4fd3c98dffe3ac5fbec\spring-data-jpa-3.0.1.jar;C:\Users\dlgkd\.gradle\caches\modules-2\files-2.1\org.springframework\spring-aspects\6.0.4\5baf7a2260278ca9748be9dd8278d6519ff2da00\spring-aspects-6.0.4.jar;C:\Users\dlgkd\.gradle\caches\modules-2\files-2.1\com.zaxxer\HikariCP\5.0.1\a74c7f0a37046846e88d54f7cb6ea6d565c65f9c\HikariCP-5.0.1.jar;C:\Users\dlgkd\.gradle\caches\modules-2\files-2.1\org.springframework\spring-jdbc\6.0.4\97304a02dec542762c19a7b39e1124f1714f7be9\spring-jdbc-6.0.4.jar;C:\Users\dlgkd\.gradle\caches\modules-2\files-2.1\org.springframework.security\spring-security-oauth2-client\6.0.1\8426e276ce3a840f1d1eafb3af90567c9686fafd\spring-security-oauth2-client-6.0.1.jar;C:\Users\dlgkd\.gradle\caches\modules-2\files-2.1\org.springframework.security\spring-security-oauth2-jose\6.0.1\90f1aa9e212ed86d65fa7adf1b6dc07e4077aa54\spring-security-oauth2-jose-6.0.1.jar;C:\Users\dlgkd\.gradle\caches\modules-2\files-2.1\org.springframework.security\spring-security-config\6.0.1\30cbecc3573f430aa2fc25f5f6be5c1662184efe\spring-security-config-6.0.1.jar;C:\Users\dlgkd\.gradle\caches\modules-2\files-2.1\org.springframework.security\spring-security-core\6.0.1\7d54b69c31cee7ff8d68dfb852cd904ed65af3cd\spring-security-core-6.0.1.jar;C:\Users\dlgkd\.gradle\caches\modules-2\files-2.1\org.springframework.boot\spring-boot-autoconfigure\3.0.2\42ad589ec930e05a2ed702a4940955ff97b16a8c\spring-boot-autoconfigure-3.0.2.jar;C:\Users\dlgkd\.gradle\caches\modules-2\files-2.1\org.springframework.boot\spring-boot\3.0.2\69d2e0a07f7df180a4aacdc47c47a3db656857dc\spring-boot-3.0.2.jar;C:\Users\dlgkd\.gradle\caches\modules-2\files-2.1\org.springframework.boot\spring-boot-starter-logging\3.0.2\1c5c71058a0297534d5c5f33a5d125bbbdb6a390\spring-boot-starter-logging-3.0.2.jar;C:\Users\dlgkd\.gradle\caches\modules-2\files-2.1\jakarta.annotation\jakarta.annotation-api\2.1.1\48b9bda22b091b1f48b13af03fe36db3be6e1ae3\jakarta.annotation-api-2.1.1.jar;C:\Users\dlgkd\.gradle\caches\modules-2\files-2.1\org.springframework\spring-core\6.0.4\8e24ad493887023cf5fac93541c72516f8ed9f6a\spring-core-6.0.4.jar;C:\Users\dlgkd\.gradle\caches\modules-2\files-2.1\org.yaml\snakeyaml\1.33\2cd0a87ff7df953f810c344bdf2fe3340b954c69\snakeyaml-1.33.jar;C:\Users\dlgkd\.gradle\caches\modules-2\files-2.1\com.fasterxml.jackson.datatype\jackson-datatype-jsr310\2.14.1\f24e8cb1437e05149b7a3049ebd6700f42e664b1\jackson-datatype-jsr310-2.14.1.jar;C:\Users\dlgkd\.gradle\caches\modules-2\files-2.1\com.fasterxml.jackson.module\jackson-module-parameter-names\2.14.1\2e05a86dba3d4b05074b6a313c4d5b7ff844c8dd\jackson-module-parameter-names-2.14.1.jar;C:\Users\dlgkd\.gradle\caches\modules-2\files-2.1\com.fasterxml.jackson.datatype\jackson-datatype-jdk8\2.14.1\da194197d187bf24a8699514344ebf0abd7c342a\jackson-datatype-jdk8-2.14.1.jar;C:\Users\dlgkd\.gradle\caches\modules-2\files-2.1\com.fasterxml.jackson.core\jackson-databind\2.14.1\268524b9056cae1211b9f1f52560ef19347f4d17\jackson-databind-2.14.1.jar;C:\Users\dlgkd\.gradle\caches\modules-2\files-2.1\org.apache.tomcat.embed\tomcat-embed-websocket\10.1.5\14529cbd593571dc9029272ddc9166b5ef113fc2\tomcat-embed-websocket-10.1.5.jar;C:\Users\dlgkd\.gradle\caches\modules-2\files-2.1\org.apache.tomcat.embed\tomcat-embed-core\10.1.5\21417d3ef8189e2af05aae0a765ad9204d7211b5\tomcat-embed-core-10.1.5.jar;C:\Users\dlgkd\.gradle\caches\modules-2\files-2.1\org.apache.tomcat.embed\tomcat-embed-el\10.1.5\c125df13af42a0fc0cd342370449b1276181e2a1\tomcat-embed-el-10.1.5.jar;C:\Users\dlgkd\.gradle\caches\modules-2\files-2.1\org.springframework\spring-context\6.0.4\4fffcbb7eb4f1e9f1a4c9d3ca60098f7c063fc05\spring-context-6.0.4.jar;C:\Users\dlgkd\.gradle\caches\modules-2\files-2.1\org.springframework\spring-aop\6.0.4\c47b65c09a5a6fc41293b6aa981fcbe24a3adcd0\spring-aop-6.0.4.jar;C:\Users\dlgkd\.gradle\caches\modules-2\files-2.1\org.springframework\spring-beans\6.0.4\7d903607ecfcdefccd0d48aea8724632479b3e83\spring-beans-6.0.4.jar;C:\Users\dlgkd\.gradle\caches\modules-2\files-2.1\org.springframework\spring-expression\6.0.4\a908e6d3c46fcd6b58221d8427bbaf284bbbee0c\spring-expression-6.0.4.jar;C:\Users\dlgkd\.gradle\caches\modules-2\files-2.1\io.micrometer\micrometer-observation\1.10.3\32cc59dc8b5f00fba9fa88b7139898b0f7905db7\micrometer-observation-1.10.3.jar;C:\Users\dlgkd\.gradle\caches\modules-2\files-2.1\org.aspectj\aspectjweaver\1.9.19\afbffb1210239fbba5cad73093c5b216d515838f\aspectjweaver-1.9.19.jar;C:\Users\dlgkd\.gradle\caches\modules-2\files-2.1\jakarta.persistence\jakarta.persistence-api\3.1.0\66901fa1c373c6aff65c13791cc11da72060a8d6\jakarta.persistence-api-3.1.0.jar;C:\Users\dlgkd\.gradle\caches\modules-2\files-2.1\jakarta.transaction\jakarta.transaction-api\2.0.1\51a520e3fae406abb84e2e1148e6746ce3f80a1a\jakarta.transaction-api-2.0.1.jar;C:\Users\dlgkd\.gradle\caches\modules-2\files-2.1\org.springframework\spring-orm\6.0.4\c9958d0879bdc05f7221c0b49d90a1b8825da540\spring-orm-6.0.4.jar;C:\Users\dlgkd\.gradle\caches\modules-2\files-2.1\org.springframework.data\spring-data-commons\3.0.1\a748e9d73fe23bec3a8604c68da74446a887d59\spring-data-commons-3.0.1.jar;C:\Users\dlgkd\.gradle\caches\modules-2\files-2.1\org.springframework\spring-tx\6.0.4\f8a50c2547179328a5f2202591d6341e3cbf1708\spring-tx-6.0.4.jar;C:\Users\dlgkd\.gradle\caches\modules-2\files-2.1\org.slf4j\slf4j-api\2.0.6\88c40d8b4f33326f19a7d3c0aaf2c7e8721d4953\slf4j-api-2.0.6.jar;C:\Users\dlgkd\.gradle\caches\modules-2\files-2.1\org.springframework.security\spring-security-oauth2-core\6.0.1\18502f2e6892ca1120f7ac3fce280c948667487\spring-security-oauth2-core-6.0.1.jar;C:\Users\dlgkd\.gradle\caches\modules-2\files-2.1\org.springframework.security\spring-security-web\6.0.1\3f0c00dcddb23941983f844cad3221141f1b873a\spring-security-web-6.0.1.jar;C:\Users\dlgkd\.gradle\caches\modules-2\files-2.1\com.nimbusds\oauth2-oidc-sdk\9.43.1\a25abc8ea0a91296063d55dbb57b698f81a4649c\oauth2-oidc-sdk-9.43.1.jar;C:\Users\dlgkd\.gradle\caches\modules-2\files-2.1\com.nimbusds\nimbus-jose-jwt\9.24.4\29a1f6a00a4daa3e1873f6bf4f16ddf4d6fd6d37\nimbus-jose-jwt-9.24.4.jar;C:\Users\dlgkd\.gradle\caches\modules-2\files-2.1\org.springframework.security\spring-security-crypto\6.0.1\2384513fec136174d4be8ebaf3a2cf9aecef5416\spring-security-crypto-6.0.1.jar;C:\Users\dlgkd\.gradle\caches\modules-2\files-2.1\ch.qos.logback\logback-classic\1.4.5\28e7dc0b208d6c3f15beefd73976e064b4ecfa9b\logback-classic-1.4.5.jar;C:\Users\dlgkd\.gradle\caches\modules-2\files-2.1\org.apache.logging.log4j\log4j-to-slf4j\2.19.0\30f4812e43172ecca5041da2cb6b965cc4777c19\log4j-to-slf4j-2.19.0.jar;C:\Users\dlgkd\.gradle\caches\modules-2\files-2.1\org.slf4j\jul-to-slf4j\2.0.6\c4d348977a83a0bfcf42fd6fd1fee6e7904f1a0c\jul-to-slf4j-2.0.6.jar;C:\Users\dlgkd\.gradle\caches\modules-2\files-2.1\org.springframework\spring-jcl\6.0.4\2d6523d00fc40cdb2c2f409113447940d2c872b5\spring-jcl-6.0.4.jar;C:\Users\dlgkd\.gradle\caches\modules-2\files-2.1\com.fasterxml.jackson.core\jackson-annotations\2.14.1\2a6ad504d591a7903ffdec76b5b7252819a2d162\jackson-annotations-2.14.1.jar;C:\Users\dlgkd\.gradle\caches\modules-2\files-2.1\com.fasterxml.jackson.core\jackson-core\2.14.1\7a07bc535ccf0b7f6929c4d0f2ab9b294ef7c4a3\jackson-core-2.14.1.jar;C:\Users\dlgkd\.gradle\caches\modules-2\files-2.1\io.micrometer\micrometer-commons\1.10.3\334080a1a6b849d09d3ef96d7b243fc3c16b2e5a\micrometer-commons-1.10.3.jar;C:\Users\dlgkd\.gradle\caches\modules-2\files-2.1\com.github.stephenc.jcip\jcip-annotations\1.0-1\ef31541dd28ae2cefdd17c7ebf352d93e9058c63\jcip-annotations-1.0-1.jar;C:\Users\dlgkd\.gradle\caches\modules-2\files-2.1\com.nimbusds\content-type\2.2\9a894bce7646dd4086652d85b88013229f23724b\content-type-2.2.jar;C:\Users\dlgkd\.gradle\caches\modules-2\files-2.1\net.minidev\json-smart\2.4.8\7c62f5f72ab05eb54d40e2abf0360a2fe9ea477f\json-smart-2.4.8.jar;C:\Users\dlgkd\.gradle\caches\modules-2\files-2.1\com.nimbusds\lang-tag\1.7\97c73ecd70bc7e8eefb26c5eea84f251a63f1031\lang-tag-1.7.jar;C:\Users\dlgkd\.gradle\caches\modules-2\files-2.1\ch.qos.logback\logback-core\1.4.5\e9bb2ea70f84401314da4300343b0a246c8954da\logback-core-1.4.5.jar;C:\Users\dlgkd\.gradle\caches\modules-2\files-2.1\org.apache.logging.log4j\log4j-api\2.19.0\ea1b37f38c327596b216542bc636cfdc0b8036fa\log4j-api-2.19.0.jar;C:\Users\dlgkd\.gradle\caches\modules-2\files-2.1\net.minidev\accessors-smart\2.4.8\6e1bee5a530caba91893604d6ab41d0edcecca9a\accessors-smart-2.4.8.jar;C:\Users\dlgkd\.gradle\caches\modules-2\files-2.1\org.ow2.asm\asm\9.1\a99500cf6eea30535eeac6be73899d048f8d12a8\asm-9.1.jar;C:\Users\dlgkd\.gradle\caches\modules-2\files-2.1\org.jboss.logging\jboss-logging\3.5.0.Final\c19307cc11f28f5e2679347e633a3294d865334d\jboss-logging-3.5.0.Final.jar;C:\Users\dlgkd\.gradle\caches\modules-2\files-2.1\org.hibernate.common\hibernate-commons-annotations\6.0.2.Final\fa5a14ef3d2e5c3c99b53a4bef756a3268d69187\hibernate-commons-annotations-6.0.2.Final.jar;C:\Users\dlgkd\.gradle\caches\modules-2\files-2.1\org.jboss\jandex\2.4.2.Final\1e1c385990b258ff1a24c801e84aebbacf70eb39\jandex-2.4.2.Final.jar;C:\Users\dlgkd\.gradle\caches\modules-2\files-2.1\com.fasterxml\classmate\1.5.1\3fe0bed568c62df5e89f4f174c101eab25345b6c\classmate-1.5.1.jar;C:\Users\dlgkd\.gradle\caches\modules-2\files-2.1\net.bytebuddy\byte-buddy\1.12.22\984e536b4f3fb668b21f15b90c1e8704292d4bdd\byte-buddy-1.12.22.jar;C:\Users\dlgkd\.gradle\caches\modules-2\files-2.1\org.glassfish.jaxb\jaxb-runtime\4.0.1\7abfa1ee788a8f090dc598c45876ef068731e72b\jaxb-runtime-4.0.1.jar;C:\Users\dlgkd\.gradle\caches\modules-2\files-2.1\jakarta.xml.bind\jakarta.xml.bind-api\4.0.0\bbb399208d288b15ec101fa4fcfc4bd77cedc97a\jakarta.xml.bind-api-4.0.0.jar;C:\Users\dlgkd\.gradle\caches\modules-2\files-2.1\jakarta.inject\jakarta.inject-api\2.0.0\46fc8560b6fd17b78396d88f39c1a730457671f0\jakarta.inject-api-2.0.0.jar;C:\Users\dlgkd\.gradle\caches\modules-2\files-2.1\org.antlr\antlr4-runtime\4.10.1\10839f875928f59c622d675091d51a43ea0dc5f7\antlr4-runtime-4.10.1.jar;C:\Users\dlgkd\.gradle\caches\modules-2\files-2.1\org.glassfish.jaxb\jaxb-core\4.0.1\b4707bb31dfcf54ae424b930741f0cd62d672af9\jaxb-core-4.0.1.jar;C:\Users\dlgkd\.gradle\caches\modules-2\files-2.1\jakarta.activation\jakarta.activation-api\2.1.1\88c774ab863a21fb2fc4219af95379fafe499a31\jakarta.activation-api-2.1.1.jar;C:\Users\dlgkd\.gradle\caches\modules-2\files-2.1\org.eclipse.angus\angus-activation\1.0.0\f0ceddd49f92109fbfad9125e958f5bfd3f2aa1\angus-activation-1.0.0.jar;C:\Users\dlgkd\.gradle\caches\modules-2\files-2.1\org.glassfish.jaxb\txw2\4.0.1\797720dfe2e15504f6014fb82eb873051a653c75\txw2-4.0.1.jar;C:\Users\dlgkd\.gradle\caches\modules-2\files-2.1\com.sun.istack\istack-commons-runtime\4.1.1\9b3769c76235bc283b060da4fae2318c6d53f07e\istack-commons-runtime-4.1.1.jar;C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2022.3.1\lib\idea_rt.jar" com.example.OAuth2Login.OAuth2LoginApplication
Connected to the target VM, address: '127.0.0.1:57592', transport: 'socket'

  .   ____          _            __ _ _
 /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
 \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
  '  |____| .__|_| |_|_| |_\__, | / / / /
 =========|_|==============|___/=/_/_/_/
 :: Spring Boot ::                (v3.0.2)

2023-01-25T17:37:51.223+09:00  INFO 23564 --- [           main] c.e.OAuth2Login.OAuth2LoginApplication   : Starting OAuth2LoginApplication using Java 17.0.5 with PID 23564 (C:\Users\dlgkd\OneDrive\๋ฐ”ํƒ• ํ™”๋ฉด\OAuth2Login\out\production\classes started by dlgkd in C:\Users\dlgkd\OneDrive\๋ฐ”ํƒ• ํ™”๋ฉด\OAuth2Login)
2023-01-25T17:37:51.228+09:00  INFO 23564 --- [           main] c.e.OAuth2Login.OAuth2LoginApplication   : The following 1 profile is active: "oauth"
2023-01-25T17:37:52.015+09:00  INFO 23564 --- [           main] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data JPA repositories in DEFAULT mode.
2023-01-25T17:37:52.094+09:00  INFO 23564 --- [           main] .s.d.r.c.RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 68 ms. Found 2 JPA repository interfaces.
2023-01-25T17:37:52.790+09:00  INFO 23564 --- [           main] o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat initialized with port(s): 8080 (http)
2023-01-25T17:37:52.802+09:00  INFO 23564 --- [           main] o.apache.catalina.core.StandardService   : Starting service [Tomcat]
2023-01-25T17:37:52.802+09:00  INFO 23564 --- [           main] o.apache.catalina.core.StandardEngine    : Starting Servlet engine: [Apache Tomcat/10.1.5]
2023-01-25T17:37:52.940+09:00  INFO 23564 --- [           main] o.a.c.c.C.[Tomcat].[localhost].[/]       : Initializing Spring embedded WebApplicationContext
2023-01-25T17:37:52.942+09:00  INFO 23564 --- [           main] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 1658 ms
2023-01-25T17:37:53.143+09:00  INFO 23564 --- [           main] o.hibernate.jpa.internal.util.LogHelper  : HHH000204: Processing PersistenceUnitInfo [name: default]
2023-01-25T17:37:53.208+09:00  INFO 23564 --- [           main] org.hibernate.Version                    : HHH000412: Hibernate ORM core version 6.1.6.Final
2023-01-25T17:37:53.391+09:00  WARN 23564 --- [           main] org.hibernate.orm.deprecation            : HHH90000021: Encountered deprecated setting [javax.persistence.sharedCache.mode], use [jakarta.persistence.sharedCache.mode] instead
2023-01-25T17:37:53.534+09:00  INFO 23564 --- [           main] com.zaxxer.hikari.HikariDataSource       : HikariPool-1 - Starting...
2023-01-25T17:37:54.625+09:00 ERROR 23564 --- [           main] com.zaxxer.hikari.pool.HikariPool        : HikariPool-1 - Exception during pool initialization.

com.mysql.cj.jdbc.exceptions.CommunicationsException: Communications link failure

The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.
	at com.mysql.cj.jdbc.exceptions.SQLError.createCommunicationsException(SQLError.java:174) ~[mysql-connector-j-8.0.32.jar:8.0.32]
	at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:64) ~[mysql-connector-j-8.0.32.jar:8.0.32]
	at com.mysql.cj.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:824) ~[mysql-connector-j-8.0.32.jar:8.0.32]
	at com.mysql.cj.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:444) ~[mysql-connector-j-8.0.32.jar:8.0.32]
	at com.mysql.cj.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:237) ~[mysql-connector-j-8.0.32.jar:8.0.32]
	at com.mysql.cj.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:198) ~[mysql-connector-j-8.0.32.jar:8.0.32]
	at com.zaxxer.hikari.util.DriverDataSource.getConnection(DriverDataSource.java:138) ~[HikariCP-5.0.1.jar:na]
	at com.zaxxer.hikari.pool.PoolBase.newConnection(PoolBase.java:359) ~[HikariCP-5.0.1.jar:na]
	at com.zaxxer.hikari.pool.PoolBase.newPoolEntry(PoolBase.java:201) ~[HikariCP-5.0.1.jar:na]
	at com.zaxxer.hikari.pool.HikariPool.createPoolEntry(HikariPool.java:470) ~[HikariCP-5.0.1.jar:na]
	at com.zaxxer.hikari.pool.HikariPool.checkFailFast(HikariPool.java:561) ~[HikariCP-5.0.1.jar:na]
	at com.zaxxer.hikari.pool.HikariPool.<init>(HikariPool.java:100) ~[HikariCP-5.0.1.jar:na]
	at com.zaxxer.hikari.HikariDataSource.getConnection(HikariDataSource.java:112) ~[HikariCP-5.0.1.jar:na]
	at org.hibernate.engine.jdbc.connections.internal.DatasourceConnectionProviderImpl.getConnection(DatasourceConnectionProviderImpl.java:122) ~[hibernate-core-6.1.6.Final.jar:6.1.6.Final]
	at org.hibernate.engine.jdbc.env.internal.JdbcEnvironmentInitiator$ConnectionProviderJdbcConnectionAccess.obtainConnection(JdbcEnvironmentInitiator.java:284) ~[hibernate-core-6.1.6.Final.jar:6.1.6.Final]
	at org.hibernate.engine.jdbc.env.internal.JdbcEnvironmentInitiator.initiateService(JdbcEnvironmentInitiator.java:177) ~[hibernate-core-6.1.6.Final.jar:6.1.6.Final]
	at org.hibernate.engine.jdbc.env.internal.JdbcEnvironmentInitiator.initiateService(JdbcEnvironmentInitiator.java:36) ~[hibernate-core-6.1.6.Final.jar:6.1.6.Final]
	at org.hibernate.boot.registry.internal.StandardServiceRegistryImpl.initiateService(StandardServiceRegistryImpl.java:119) ~[hibernate-core-6.1.6.Final.jar:6.1.6.Final]
	at org.hibernate.service.internal.AbstractServiceRegistryImpl.createService(AbstractServiceRegistryImpl.java:255) ~[hibernate-core-6.1.6.Final.jar:6.1.6.Final]
	at org.hibernate.service.internal.AbstractServiceRegistryImpl.initializeService(AbstractServiceRegistryImpl.java:230) ~[hibernate-core-6.1.6.Final.jar:6.1.6.Final]
	at org.hibernate.service.internal.AbstractServiceRegistryImpl.getService(AbstractServiceRegistryImpl.java:207) ~[hibernate-core-6.1.6.Final.jar:6.1.6.Final]
	at org.hibernate.boot.model.relational.Database.<init>(Database.java:44) ~[hibernate-core-6.1.6.Final.jar:6.1.6.Final]
	at org.hibernate.boot.internal.InFlightMetadataCollectorImpl.getDatabase(InFlightMetadataCollectorImpl.java:218) ~[hibernate-core-6.1.6.Final.jar:6.1.6.Final]
	at org.hibernate.boot.internal.InFlightMetadataCollectorImpl.<init>(InFlightMetadataCollectorImpl.java:191) ~[hibernate-core-6.1.6.Final.jar:6.1.6.Final]
	at org.hibernate.boot.model.process.spi.MetadataBuildingProcess.complete(MetadataBuildingProcess.java:138) ~[hibernate-core-6.1.6.Final.jar:6.1.6.Final]
	at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.metadata(EntityManagerFactoryBuilderImpl.java:1350) ~[hibernate-core-6.1.6.Final.jar:6.1.6.Final]
	at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.build(EntityManagerFactoryBuilderImpl.java:1421) ~[hibernate-core-6.1.6.Final.jar:6.1.6.Final]
	at org.springframework.orm.jpa.vendor.SpringHibernateJpaPersistenceProvider.createContainerEntityManagerFactory(SpringHibernateJpaPersistenceProvider.java:66) ~[spring-orm-6.0.4.jar:6.0.4]
	at org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.createNativeEntityManagerFactory(LocalContainerEntityManagerFactoryBean.java:376) ~[spring-orm-6.0.4.jar:6.0.4]
	at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.buildNativeEntityManagerFactory(AbstractEntityManagerFactoryBean.java:409) ~[spring-orm-6.0.4.jar:6.0.4]
	at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.afterPropertiesSet(AbstractEntityManagerFactoryBean.java:396) ~[spring-orm-6.0.4.jar:6.0.4]
	at org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.afterPropertiesSet(LocalContainerEntityManagerFactoryBean.java:352) ~[spring-orm-6.0.4.jar:6.0.4]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1797) ~[spring-beans-6.0.4.jar:6.0.4]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1747) ~[spring-beans-6.0.4.jar:6.0.4]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:599) ~[spring-beans-6.0.4.jar:6.0.4]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:521) ~[spring-beans-6.0.4.jar:6.0.4]
	at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:326) ~[spring-beans-6.0.4.jar:6.0.4]
	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) ~[spring-beans-6.0.4.jar:6.0.4]
	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:324) ~[spring-beans-6.0.4.jar:6.0.4]
	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:200) ~[spring-beans-6.0.4.jar:6.0.4]
	at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1130) ~[spring-context-6.0.4.jar:6.0.4]
	at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:905) ~[spring-context-6.0.4.jar:6.0.4]
	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:584) ~[spring-context-6.0.4.jar:6.0.4]
	at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:146) ~[spring-boot-3.0.2.jar:3.0.2]
	at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:730) ~[spring-boot-3.0.2.jar:3.0.2]
	at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:432) ~[spring-boot-3.0.2.jar:3.0.2]
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:308) ~[spring-boot-3.0.2.jar:3.0.2]
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1302) ~[spring-boot-3.0.2.jar:3.0.2]
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1291) ~[spring-boot-3.0.2.jar:3.0.2]
	at com.example.OAuth2Login.OAuth2LoginApplication.main(OAuth2LoginApplication.java:11) ~[classes/:na]
Caused by: com.mysql.cj.exceptions.CJCommunicationsException: Communications link failure

The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.
	at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[na:na]
	at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:77) ~[na:na]
	at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[na:na]
	at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:499) ~[na:na]
	at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:480) ~[na:na]
	at com.mysql.cj.exceptions.ExceptionFactory.createException(ExceptionFactory.java:61) ~[mysql-connector-j-8.0.32.jar:8.0.32]
	at com.mysql.cj.exceptions.ExceptionFactory.createException(ExceptionFactory.java:105) ~[mysql-connector-j-8.0.32.jar:8.0.32]
	at com.mysql.cj.exceptions.ExceptionFactory.createException(ExceptionFactory.java:151) ~[mysql-connector-j-8.0.32.jar:8.0.32]
	at com.mysql.cj.exceptions.ExceptionFactory.createCommunicationsException(ExceptionFactory.java:167) ~[mysql-connector-j-8.0.32.jar:8.0.32]
	at com.mysql.cj.protocol.a.NativeSocketConnection.connect(NativeSocketConnection.java:89) ~[mysql-connector-j-8.0.32.jar:8.0.32]
	at com.mysql.cj.NativeSession.connect(NativeSession.java:120) ~[mysql-connector-j-8.0.32.jar:8.0.32]
	at com.mysql.cj.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:944) ~[mysql-connector-j-8.0.32.jar:8.0.32]
	at com.mysql.cj.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:814) ~[mysql-connector-j-8.0.32.jar:8.0.32]
	... 47 common frames omitted
Caused by: java.net.ConnectException: Connection refused: no further information
	at java.base/sun.nio.ch.Net.pollConnect(Native Method) ~[na:na]
	at java.base/sun.nio.ch.Net.pollConnectNow(Net.java:672) ~[na:na]
	at java.base/sun.nio.ch.NioSocketImpl.timedFinishConnect(NioSocketImpl.java:542) ~[na:na]
	at java.base/sun.nio.ch.NioSocketImpl.connect(NioSocketImpl.java:597) ~[na:na]
	at java.base/java.net.SocksSocketImpl.connect(SocksSocketImpl.java:327) ~[na:na]
	at java.base/java.net.Socket.connect(Socket.java:633) ~[na:na]
	at com.mysql.cj.protocol.StandardSocketFactory.connect(StandardSocketFactory.java:153) ~[mysql-connector-j-8.0.32.jar:8.0.32]
	at com.mysql.cj.protocol.a.NativeSocketConnection.connect(NativeSocketConnection.java:63) ~[mysql-connector-j-8.0.32.jar:8.0.32]
	... 50 common frames omitted

2023-01-25T17:37:54.631+09:00  WARN 23564 --- [           main] o.h.e.j.e.i.JdbcEnvironmentInitiator     : HHH000342: Could not obtain connection to query metadata

com.mysql.cj.jdbc.exceptions.CommunicationsException: Communications link failure

The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.
	at com.mysql.cj.jdbc.exceptions.SQLError.createCommunicationsException(SQLError.java:174) ~[mysql-connector-j-8.0.32.jar:8.0.32]
	at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:64) ~[mysql-connector-j-8.0.32.jar:8.0.32]
	at com.mysql.cj.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:824) ~[mysql-connector-j-8.0.32.jar:8.0.32]
	at com.mysql.cj.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:444) ~[mysql-connector-j-8.0.32.jar:8.0.32]
	at com.mysql.cj.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:237) ~[mysql-connector-j-8.0.32.jar:8.0.32]
	at com.mysql.cj.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:198) ~[mysql-connector-j-8.0.32.jar:8.0.32]
	at com.zaxxer.hikari.util.DriverDataSource.getConnection(DriverDataSource.java:138) ~[HikariCP-5.0.1.jar:na]
	at com.zaxxer.hikari.pool.PoolBase.newConnection(PoolBase.java:359) ~[HikariCP-5.0.1.jar:na]
	at com.zaxxer.hikari.pool.PoolBase.newPoolEntry(PoolBase.java:201) ~[HikariCP-5.0.1.jar:na]
	at com.zaxxer.hikari.pool.HikariPool.createPoolEntry(HikariPool.java:470) ~[HikariCP-5.0.1.jar:na]
	at com.zaxxer.hikari.pool.HikariPool.checkFailFast(HikariPool.java:561) ~[HikariCP-5.0.1.jar:na]
	at com.zaxxer.hikari.pool.HikariPool.<init>(HikariPool.java:100) ~[HikariCP-5.0.1.jar:na]
	at com.zaxxer.hikari.HikariDataSource.getConnection(HikariDataSource.java:112) ~[HikariCP-5.0.1.jar:na]
	at org.hibernate.engine.jdbc.connections.internal.DatasourceConnectionProviderImpl.getConnection(DatasourceConnectionProviderImpl.java:122) ~[hibernate-core-6.1.6.Final.jar:6.1.6.Final]
	at org.hibernate.engine.jdbc.env.internal.JdbcEnvironmentInitiator$ConnectionProviderJdbcConnectionAccess.obtainConnection(JdbcEnvironmentInitiator.java:284) ~[hibernate-core-6.1.6.Final.jar:6.1.6.Final]
	at org.hibernate.engine.jdbc.env.internal.JdbcEnvironmentInitiator.initiateService(JdbcEnvironmentInitiator.java:177) ~[hibernate-core-6.1.6.Final.jar:6.1.6.Final]
	at org.hibernate.engine.jdbc.env.internal.JdbcEnvironmentInitiator.initiateService(JdbcEnvironmentInitiator.java:36) ~[hibernate-core-6.1.6.Final.jar:6.1.6.Final]
	at org.hibernate.boot.registry.internal.StandardServiceRegistryImpl.initiateService(StandardServiceRegistryImpl.java:119) ~[hibernate-core-6.1.6.Final.jar:6.1.6.Final]
	at org.hibernate.service.internal.AbstractServiceRegistryImpl.createService(AbstractServiceRegistryImpl.java:255) ~[hibernate-core-6.1.6.Final.jar:6.1.6.Final]
	at org.hibernate.service.internal.AbstractServiceRegistryImpl.initializeService(AbstractServiceRegistryImpl.java:230) ~[hibernate-core-6.1.6.Final.jar:6.1.6.Final]
	at org.hibernate.service.internal.AbstractServiceRegistryImpl.getService(AbstractServiceRegistryImpl.java:207) ~[hibernate-core-6.1.6.Final.jar:6.1.6.Final]
	at org.hibernate.boot.model.relational.Database.<init>(Database.java:44) ~[hibernate-core-6.1.6.Final.jar:6.1.6.Final]
	at org.hibernate.boot.internal.InFlightMetadataCollectorImpl.getDatabase(InFlightMetadataCollectorImpl.java:218) ~[hibernate-core-6.1.6.Final.jar:6.1.6.Final]
	at org.hibernate.boot.internal.InFlightMetadataCollectorImpl.<init>(InFlightMetadataCollectorImpl.java:191) ~[hibernate-core-6.1.6.Final.jar:6.1.6.Final]
	at org.hibernate.boot.model.process.spi.MetadataBuildingProcess.complete(MetadataBuildingProcess.java:138) ~[hibernate-core-6.1.6.Final.jar:6.1.6.Final]
	at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.metadata(EntityManagerFactoryBuilderImpl.java:1350) ~[hibernate-core-6.1.6.Final.jar:6.1.6.Final]
	at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.build(EntityManagerFactoryBuilderImpl.java:1421) ~[hibernate-core-6.1.6.Final.jar:6.1.6.Final]
	at org.springframework.orm.jpa.vendor.SpringHibernateJpaPersistenceProvider.createContainerEntityManagerFactory(SpringHibernateJpaPersistenceProvider.java:66) ~[spring-orm-6.0.4.jar:6.0.4]
	at org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.createNativeEntityManagerFactory(LocalContainerEntityManagerFactoryBean.java:376) ~[spring-orm-6.0.4.jar:6.0.4]
	at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.buildNativeEntityManagerFactory(AbstractEntityManagerFactoryBean.java:409) ~[spring-orm-6.0.4.jar:6.0.4]
	at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.afterPropertiesSet(AbstractEntityManagerFactoryBean.java:396) ~[spring-orm-6.0.4.jar:6.0.4]
	at org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.afterPropertiesSet(LocalContainerEntityManagerFactoryBean.java:352) ~[spring-orm-6.0.4.jar:6.0.4]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1797) ~[spring-beans-6.0.4.jar:6.0.4]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1747) ~[spring-beans-6.0.4.jar:6.0.4]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:599) ~[spring-beans-6.0.4.jar:6.0.4]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:521) ~[spring-beans-6.0.4.jar:6.0.4]
	at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:326) ~[spring-beans-6.0.4.jar:6.0.4]
	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) ~[spring-beans-6.0.4.jar:6.0.4]
	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:324) ~[spring-beans-6.0.4.jar:6.0.4]
	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:200) ~[spring-beans-6.0.4.jar:6.0.4]
	at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1130) ~[spring-context-6.0.4.jar:6.0.4]
	at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:905) ~[spring-context-6.0.4.jar:6.0.4]
	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:584) ~[spring-context-6.0.4.jar:6.0.4]
	at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:146) ~[spring-boot-3.0.2.jar:3.0.2]
	at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:730) ~[spring-boot-3.0.2.jar:3.0.2]
	at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:432) ~[spring-boot-3.0.2.jar:3.0.2]
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:308) ~[spring-boot-3.0.2.jar:3.0.2]
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1302) ~[spring-boot-3.0.2.jar:3.0.2]
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1291) ~[spring-boot-3.0.2.jar:3.0.2]
	at com.example.OAuth2Login.OAuth2LoginApplication.main(OAuth2LoginApplication.java:11) ~[classes/:na]
Caused by: com.mysql.cj.exceptions.CJCommunicationsException: Communications link failure

The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.
	at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[na:na]
	at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:77) ~[na:na]
	at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[na:na]
	at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:499) ~[na:na]
	at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:480) ~[na:na]
	at com.mysql.cj.exceptions.ExceptionFactory.createException(ExceptionFactory.java:61) ~[mysql-connector-j-8.0.32.jar:8.0.32]
	at com.mysql.cj.exceptions.ExceptionFactory.createException(ExceptionFactory.java:105) ~[mysql-connector-j-8.0.32.jar:8.0.32]
	at com.mysql.cj.exceptions.ExceptionFactory.createException(ExceptionFactory.java:151) ~[mysql-connector-j-8.0.32.jar:8.0.32]
	at com.mysql.cj.exceptions.ExceptionFactory.createCommunicationsException(ExceptionFactory.java:167) ~[mysql-connector-j-8.0.32.jar:8.0.32]
	at com.mysql.cj.protocol.a.NativeSocketConnection.connect(NativeSocketConnection.java:89) ~[mysql-connector-j-8.0.32.jar:8.0.32]
	at com.mysql.cj.NativeSession.connect(NativeSession.java:120) ~[mysql-connector-j-8.0.32.jar:8.0.32]
	at com.mysql.cj.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:944) ~[mysql-connector-j-8.0.32.jar:8.0.32]
	at com.mysql.cj.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:814) ~[mysql-connector-j-8.0.32.jar:8.0.32]
	... 47 common frames omitted
Caused by: java.net.ConnectException: Connection refused: no further information
	at java.base/sun.nio.ch.Net.pollConnect(Native Method) ~[na:na]
	at java.base/sun.nio.ch.Net.pollConnectNow(Net.java:672) ~[na:na]
	at java.base/sun.nio.ch.NioSocketImpl.timedFinishConnect(NioSocketImpl.java:542) ~[na:na]
	at java.base/sun.nio.ch.NioSocketImpl.connect(NioSocketImpl.java:597) ~[na:na]
	at java.base/java.net.SocksSocketImpl.connect(SocksSocketImpl.java:327) ~[na:na]
	at java.base/java.net.Socket.connect(Socket.java:633) ~[na:na]
	at com.mysql.cj.protocol.StandardSocketFactory.connect(StandardSocketFactory.java:153) ~[mysql-connector-j-8.0.32.jar:8.0.32]
	at com.mysql.cj.protocol.a.NativeSocketConnection.connect(NativeSocketConnection.java:63) ~[mysql-connector-j-8.0.32.jar:8.0.32]
	... 50 common frames omitted

2023-01-25T17:37:54.634+09:00 ERROR 23564 --- [           main] j.LocalContainerEntityManagerFactoryBean : Failed to initialize JPA EntityManagerFactory: Unable to create requested service [org.hibernate.engine.jdbc.env.spi.JdbcEnvironment]
2023-01-25T17:37:54.635+09:00  WARN 23564 --- [           main] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resource [org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaConfiguration.class]: Unable to create requested service [org.hibernate.engine.jdbc.env.spi.JdbcEnvironment]
2023-01-25T17:37:54.637+09:00  INFO 23564 --- [           main] o.apache.catalina.core.StandardService   : Stopping service [Tomcat]
2023-01-25T17:37:54.648+09:00  INFO 23564 --- [           main] .s.b.a.l.ConditionEvaluationReportLogger : 

Error starting ApplicationContext. To display the condition evaluation report re-run your application with 'debug' enabled.
2023-01-25T17:37:54.666+09:00 ERROR 23564 --- [           main] o.s.boot.SpringApplication               : Application run failed

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resource [org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaConfiguration.class]: Unable to create requested service [org.hibernate.engine.jdbc.env.spi.JdbcEnvironment]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1751) ~[spring-beans-6.0.4.jar:6.0.4]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:599) ~[spring-beans-6.0.4.jar:6.0.4]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:521) ~[spring-beans-6.0.4.jar:6.0.4]
	at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:326) ~[spring-beans-6.0.4.jar:6.0.4]
	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) ~[spring-beans-6.0.4.jar:6.0.4]
	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:324) ~[spring-beans-6.0.4.jar:6.0.4]
	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:200) ~[spring-beans-6.0.4.jar:6.0.4]
	at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1130) ~[spring-context-6.0.4.jar:6.0.4]
	at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:905) ~[spring-context-6.0.4.jar:6.0.4]
	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:584) ~[spring-context-6.0.4.jar:6.0.4]
	at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:146) ~[spring-boot-3.0.2.jar:3.0.2]
	at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:730) ~[spring-boot-3.0.2.jar:3.0.2]
	at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:432) ~[spring-boot-3.0.2.jar:3.0.2]
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:308) ~[spring-boot-3.0.2.jar:3.0.2]
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1302) ~[spring-boot-3.0.2.jar:3.0.2]
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1291) ~[spring-boot-3.0.2.jar:3.0.2]
	at com.example.OAuth2Login.OAuth2LoginApplication.main(OAuth2LoginApplication.java:11) ~[classes/:na]
Caused by: org.hibernate.service.spi.ServiceException: Unable to create requested service [org.hibernate.engine.jdbc.env.spi.JdbcEnvironment]
	at org.hibernate.service.internal.AbstractServiceRegistryImpl.createService(AbstractServiceRegistryImpl.java:267) ~[hibernate-core-6.1.6.Final.jar:6.1.6.Final]
	at org.hibernate.service.internal.AbstractServiceRegistryImpl.initializeService(AbstractServiceRegistryImpl.java:230) ~[hibernate-core-6.1.6.Final.jar:6.1.6.Final]
	at org.hibernate.service.internal.AbstractServiceRegistryImpl.getService(AbstractServiceRegistryImpl.java:207) ~[hibernate-core-6.1.6.Final.jar:6.1.6.Final]
	at org.hibernate.boot.model.relational.Database.<init>(Database.java:44) ~[hibernate-core-6.1.6.Final.jar:6.1.6.Final]
	at org.hibernate.boot.internal.InFlightMetadataCollectorImpl.getDatabase(InFlightMetadataCollectorImpl.java:218) ~[hibernate-core-6.1.6.Final.jar:6.1.6.Final]
	at org.hibernate.boot.internal.InFlightMetadataCollectorImpl.<init>(InFlightMetadataCollectorImpl.java:191) ~[hibernate-core-6.1.6.Final.jar:6.1.6.Final]
	at org.hibernate.boot.model.process.spi.MetadataBuildingProcess.complete(MetadataBuildingProcess.java:138) ~[hibernate-core-6.1.6.Final.jar:6.1.6.Final]
	at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.metadata(EntityManagerFactoryBuilderImpl.java:1350) ~[hibernate-core-6.1.6.Final.jar:6.1.6.Final]
	at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.build(EntityManagerFactoryBuilderImpl.java:1421) ~[hibernate-core-6.1.6.Final.jar:6.1.6.Final]
	at org.springframework.orm.jpa.vendor.SpringHibernateJpaPersistenceProvider.createContainerEntityManagerFactory(SpringHibernateJpaPersistenceProvider.java:66) ~[spring-orm-6.0.4.jar:6.0.4]
	at org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.createNativeEntityManagerFactory(LocalContainerEntityManagerFactoryBean.java:376) ~[spring-orm-6.0.4.jar:6.0.4]
	at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.buildNativeEntityManagerFactory(AbstractEntityManagerFactoryBean.java:409) ~[spring-orm-6.0.4.jar:6.0.4]
	at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.afterPropertiesSet(AbstractEntityManagerFactoryBean.java:396) ~[spring-orm-6.0.4.jar:6.0.4]
	at org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.afterPropertiesSet(LocalContainerEntityManagerFactoryBean.java:352) ~[spring-orm-6.0.4.jar:6.0.4]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1797) ~[spring-beans-6.0.4.jar:6.0.4]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1747) ~[spring-beans-6.0.4.jar:6.0.4]
	... 16 common frames omitted
Caused by: org.hibernate.HibernateException: Unable to determine Dialect without JDBC metadata (please set 'javax.persistence.jdbc.url', 'hibernate.connection.url', or 'hibernate.dialect')
	at org.hibernate.engine.jdbc.dialect.internal.DialectFactoryImpl.determineDialect(DialectFactoryImpl.java:147) ~[hibernate-core-6.1.6.Final.jar:6.1.6.Final]
	at org.hibernate.engine.jdbc.dialect.internal.DialectFactoryImpl.buildDialect(DialectFactoryImpl.java:60) ~[hibernate-core-6.1.6.Final.jar:6.1.6.Final]
	at org.hibernate.engine.jdbc.env.internal.JdbcEnvironmentInitiator.initiateService(JdbcEnvironmentInitiator.java:244) ~[hibernate-core-6.1.6.Final.jar:6.1.6.Final]
	at org.hibernate.engine.jdbc.env.internal.JdbcEnvironmentInitiator.initiateService(JdbcEnvironmentInitiator.java:36) ~[hibernate-core-6.1.6.Final.jar:6.1.6.Final]
	at org.hibernate.boot.registry.internal.StandardServiceRegistryImpl.initiateService(StandardServiceRegistryImpl.java:119) ~[hibernate-core-6.1.6.Final.jar:6.1.6.Final]
	at org.hibernate.service.internal.AbstractServiceRegistryImpl.createService(AbstractServiceRegistryImpl.java:255) ~[hibernate-core-6.1.6.Final.jar:6.1.6.Final]
	... 31 common frames omitted

Disconnected from the target VM, address: '127.0.0.1:57592', transport: 'socket'

Process finished with exit code 1

์˜คํ›„ 5์‹œ 43๋ถ„ ์„ฑ๊ณต

  • ํ™˜๊ฒฝ๋ณ€์ˆ˜ ํŽธ์ง‘

  • ์ด๋ฆ„ ์ง€์ •์„ ํ•ด์ฃผ๊ณ  value ์ž‘์„ฑ์—์„œ DB์˜ URL์„ ๊ธฐ๋ณธ ํฌํŠธ์ธ 80์„ :80 ์ด๋ ‡๊ฒŒ ์ž‘์„ฑํ–ˆ๋‹ค๊ฐ€, ์ง€์›Œ๋ฒ„๋ฆฌ๊ณ  ๋‹ค์‹œ ํ–ˆ๋”๋‹ˆ ์„ฑ๊ณตํ•œ ๊ฒƒ ๊ฐ™๋‹ค.

  • ๋นŒ๋“œ & Run

์ž์ž˜ํ•œ ์—๋Ÿฌ ๋ฐœ์ƒํ•˜๋Š”๊ฑฐ ํ™•์ธํ•˜๊ณ , ๊ทธ๊ฒƒ๊นŒ์ง€ ์ตœ์ข…์ ์œผ๋กœ ๊ณ ์ณ์„œ ์ผ๋‹จ ๊ตฌ๊ธ€ ๋กœ๊ทธ์ธ๊นŒ์ง€๋Š” ์„ฑ๊ณต์ž…๋‹ˆ๋‹ค๐Ÿ˜ญ

ํ˜„์žฌ ์ƒํ™ฉ(~ 2021.01.25 ์ž์ •)

  • ๊ตฌ๊ธ€ ๋กœ๊ทธ์ธ์€ ์„ฑ๊ณตํ–ˆ์ง€๋งŒ, localhost:8080์œผ๋กœ ์ ‘์†ํ•˜๋ฉด -> ๊ทธ๋ƒฅ ์ธ์ฆ ์ฐฝ์ด ๋ฐ”๋กœ ์—ด๋ฆผ.
  • ํ˜„์žฌ๊นŒ์ง€์˜ ์˜ˆ์ธก
    1. ์ ‘์† ์‹œ ์ธ์ฆ์„ ๋ฐ”๋กœ ์š”๊ตฌํ•˜๋Š” ๊ฒƒ -> ์„ค์ • ๋ณ€๊ฒฝ ํ•„์š”

-> SecurityConfig.java ํŒŒ์ผ
ํ•ด๋‹น ๋ถ€๋ถ„์€ ์ธ์ฆ๊ณผ ๊ด€๋ จ์—†์ด uri๋ฅผ ์š”์ฒญํ•˜๋ฉด ๊ทธ๋ƒฅ ๋ฐ”๋กœ ์š”์ฒญ์— ์‘๋‹ตํ•ด์ฃผ๋Š” ๊ฒƒ





-> ํ•ด๋‹น ๋ถ€๋ถ„์€ ํ•ด๋‹น uri ์š”์ฒญ ์‹œ ์ธ์ฆ์„ ignore ํ•ด์ฃผ๋Š” ๊ฒƒ


2. index.mustache์„ ์ฐพ์ง€ ๋ชปํ•˜๋Š” ๋ฌธ์ œ

  • mustache ํ”Œ๋Ÿฌ๊ทธ์ธ ์„ค์น˜ & build.gradle์— ์ถ”๊ฐ€ํ•จ.

  • ๊ทธ๋Ÿผ์—๋„ ๋ถˆ๊ตฌํ•˜๊ณ  ์•ˆ๋จ.

  • ๋‚ด ์ƒ๊ฐ -> ์—๋Ÿฌ ๋กœ๊ทธ์˜ ์ด ๋ถ€๋ถ„๋•Œ๋ฌธ์— ์•ˆ๋˜๊ณ , ์ด ํ”„๋กœ์ ํŠธ๊ฐ€ index.mustache๋ฅผ ๋งคํ•‘ํ•˜์ง€ ๋ชปํ•˜๋Š” ๊ฒƒ ๊ฐ™๋‹ค..

  • ํ•ด๊ฒฐํ•ด๋ณด์ž..
    1) shift + shift -> mustache ๊ฒ€์ƒ‰ -> ๋งจ ์•„๋ž˜ ์ค„ ์นœ ๋ถ€๋ถ„ ํด๋ฆญ

2) ๋“ค์–ด๊ฐ€์„œ ํ•ด๋‹น ๋ถ€๋ถ„ ์ฐ๊ธฐ

3) ๋””๋ฒ„๊ทธ ๋ฒ„ํŠผ ํด๋ฆญ ํ•ด ์„œ๋ฒ„ ๊ตฌ๋™

4) localhost:8080 ๋‹ค์‹œ ์ ‘์†ํ•˜๊ณ , ๋‹ค์‹œ ํ”„๋กœ์ ํŠธ๋กœ ๋Œ์•„์™€์„œ Debugger ๋ณด๊ธฐ

5) ๊ฒฐ๊ณผ

-> ๋‚ด์ผ ๋‹ค์‹œ ์ด ๋ถ€๋ถ„์— ๋Œ€ํ•ด์„œ ํŒŒ๋ด์•ผํ•  ๊ฒƒ ๊ฐ™๋‹ค.


์ง€๊ธˆ๊นŒ์ง€ ์ฐธ๊ณ ํ•œ ๋งํฌ ๋ชจ๋‘ ๋ณต๋ถ™
https://itstudy-mary.tistory.com/173
https://yeahajeong.tistory.com/48
https://www.google.com/search?q=%EC%8A%A4%ED%94%84%EB%A7%81+createviewname&oq=%EC%8A%A4%ED%94%84%EB%A7%81+createviewname&aqs=chrome..69i57j0i546l2j0i30i546.7660j0j7&sourceid=chrome&ie=UTF-8
https://srzero.tistory.com/entry/Spring-Multi-Resolver-%EA%B5%AC%ED%98%84
https://www.inflearn.com/questions/213225/%ED%9A%8C%EC%9B%90-%EA%B8%B0%EB%8A%A5-%ED%85%8C%EC%8A%A4%ED%8A%B8-%EB%AC%B8%EC%9D%98-%EB%93%9C%EB%A6%BD%EB%8B%88%EB%8B%A4
https://blog-001.tistory.com/10
https://blog.naver.com/chogar/221925309816
http://yoonbumtae.com/?p=3541
https://dev-coco.tistory.com/85
https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FbY4kj3%2FbtradRNxaEs%2FNFhdzcemKnRfdZAp1bMfuk%2Fimg.png
https://www.google.com/search?q=xampp+mysql+workbench+%EC%82%AC%EC%9A%A9&sxsrf=AJOqlzU-aLf7G7TR3T8g_N99_djZbY8kew%3A1674634806295&ei=NubQY9y-EcKu2roPjpyfuAI&ved=0ahUKEwjcsYfmpOL8AhVCl1YBHQ7OBycQ4dUDCA8&uact=5&oq=xampp+mysql+workbench+%EC%82%AC%EC%9A%A9&gs_lcp=Cgxnd3Mtd2l6LXNlcnAQAzIFCCEQoAEyBQghEKABOgQIABBHOgUIABCABDoECAAQHjoGCAAQCBAeOgYIABAFEB5KBAhBGABKBAhGGABQuQNY8Qhg0ApoAXACeACAAZ8BiAHDBZIBAzAuNpgBAKABAcgBCsABAQ&sclient=gws-wiz-serp
https://kth990303.tistory.com/307
https://adunhansa.tistory.com/349
https://www.inflearn.com/questions/31659/login-%EA%B5%AC%ED%98%84%ED%95%A0%EB%95%8C
https://dev-coco.tistory.com/128
https://www.google.com/search?q=%EC%8A%A4%ED%94%84%EB%A7%81+%EC%86%8C%EC%85%9C%EB%A1%9C%EA%B7%B8%EC%9D%B8+%EA%B5%AC%EA%B8%80+%EB%A1%9C%EA%B7%B8%EC%9D%B8+%ED%99%94%EB%A9%B4+%EB%82%98%EC%98%B4&sxsrf=AJOqlzUSgDc3qaxxe4vO1andEa9F_h95jA%3A1674644373840&ei=lQvRY5vuMry22roPwKO54Ao&ved=0ahUKEwjbjJy4yOL8AhU8m1YBHcBRDqwQ4dUDCA8&uact=5&oq=%EC%8A%A4%ED%94%84%EB%A7%81+%EC%86%8C%EC%85%9C%EB%A1%9C%EA%B7%B8%EC%9D%B8+%EA%B5%AC%EA%B8%80+%EB%A1%9C%EA%B7%B8%EC%9D%B8+%ED%99%94%EB%A9%B4+%EB%82%98%EC%98%B4&gs_lcp=Cgxnd3Mtd2l6LXNlcnAQAzIECCEQFTIECCEQFToKCAAQRxDWBBCwAzoECCMQJ0oECEEYAEoECEYYAFD3B1jMC2CkDGgCcAF4AYABswGIAbEFkgEDMC41mAEAoAEByAEKwAEB&sclient=gws-wiz-serp
https://velog.io/@persestitan/Spring-Security-3.0.0%EB%B2%84%EC%A0%84%EC%97%90%EC%84%9C%EC%8A%A4%ED%94%84%EB%A7%81-%EC%8B%9C%ED%81%90%EB%A6%AC%ED%8B%B0-%EC%84%A4%EC%A0%95%ED%95%98%EA%B8%B0
https://zhfvkq.tistory.com/23
https://samtao.tistory.com/73
https://withbbang.tistory.com/entry/%EB%A7%88%EC%9D%B4%ED%81%AC%EB%A1%9C%EC%86%8C%ED%94%84%ED%8A%B8-%EC%97%A3%EC%A7%80Edge-%EC%9D%B8%ED%84%B0%EB%84%B7-%EA%B2%80%EC%83%89%EA%B8%B0%EB%A1%9D%EB%B0%A9%EB%AC%B8%EA%B8%B0%EB%A1%9D-%EC%9E%90%EB%8F%99-%EC%82%AD%EC%A0%9C-%EC%84%A4%EC%A0%95-%EB%B0%A9%EB%B2%95
https://velog.io/@swchoi0329/%EC%8A%A4%ED%94%84%EB%A7%81-%EC%8B%9C%ED%81%90%EB%A6%AC%ED%8B%B0%EC%99%80-OAuth-2.0%EC%9C%BC%EB%A1%9C-%EB%A1%9C%EA%B7%B8%EC%9D%B8-%EA%B8%B0%EB%8A%A5-%EA%B5%AC%ED%98%84
https://www.google.com/search?q=%22ERROR%22+dispatch+for+GET+%22/error%3Fcontinue%22,+parameters%3D%7Bmasked%7D&sxsrf=AJOqlzU02mBQAXcVxMTdaZi_1JG_nLDQlQ:1674652560293&source=lnms&tbm=isch&sa=X&ved=2ahUKEwjOyOn35uL8AhWLh1YBHYk-BWgQ_AUoAnoECAEQBA&biw=1920&bih=929&dpr=1#imgrc=Ql4p5dU2e8fESM
https://supawer0728.github.io/2019/04/04/spring-error-handling/

https://datamoney.tistory.com/333
https://github.com/gkdud583/freelec-springboot2-webservice/tree/master/src/main/resources/templates
https://myeongju00.tistory.com/51?category=1026256
https://velog.io/@pjh612/Deprecated%EB%90%9C-WebSecurityConfigurerAdapter-%EC%96%B4%EB%96%BB%EA%B2%8C-%EB%8C%80%EC%B2%98%ED%95%98%EC%A7%80
https://blog.userinsight.co.kr/26
https://stackoverflow.com/questions/74683225/updating-to-spring-security-6-0-replacing-removed-and-deprecated-functionality
https://itjy2.tistory.com/115
https://www.google.com/search?q=private+field+%27postService%27+is+assigned+but+never+accessed&oq=private+field+%27postService%27+is+assigned+but+never+accessed&aqs=chrome..69i57j33i10i160.21402j1j7&sourceid=chrome&ie=UTF-8
https://goddaehee.tistory.com/210
https://www.google.com/search?q=%EC%8A%A4%ED%94%84%EB%A7%81+Completed+500+INTERNAL_SERVER_ERROR&sxsrf=AJOqlzUJsj7Cy1ZJ63hEakJsj2wTI_XSag%3A1674639108268&ei=BPfQY7yDEKiM2roPybKY2AQ&ved=0ahUKEwi8lbPptOL8AhUohlYBHUkZBksQ4dUDCA8&uact=5&oq=%EC%8A%A4%ED%94%84%EB%A7%81+Completed+500+INTERNAL_SERVER_ERROR&gs_lcp=Cgxnd3Mtd2l6LXNlcnAQAzIFCAAQogQyBQgAEKIEMgUIABCiBDoECCMQJzoGCAAQBxAeOggIABAHEB4QCjoJCAAQBxAeEPEESgQIQRgASgQIRhgAUABYxA5gxw9oA3ABeASAAagBiAGdDJIBBDEuMTKYAQCgAQHAAQE&sclient=gws-wiz-serp
https://velog.io/@kwakwoohyun/%EC%9D%B4%EC%8A%88%EC%B2%98%EB%A6%AC-OAuth2-google-login-400-redirecturimismatch
https://www.google.com/search?q=%EC%8A%A4%ED%94%84%EB%A7%81+%EC%8B%9C%ED%81%90%EB%A6%AC%ED%8B%B0+%EB%A3%A8%ED%8A%B8%ED%8E%98%EC%9D%B4%EC%A7%80+%EC%9D%B8%EC%A6%9D+%EC%95%88%ED%95%98%EA%B2%8C&sxsrf=AJOqlzUnSA0pDtZGL1o72cIyffgd0MiArA%3A1674644922087&ei=ug3RY_zvBM_M2roPtfCVsA0&ved=0ahUKEwj8tNK9yuL8AhVPplYBHTV4BdYQ4dUDCA8&uact=5&oq=%EC%8A%A4%ED%94%84%EB%A7%81+%EC%8B%9C%ED%81%90%EB%A6%AC%ED%8B%B0+%EB%A3%A8%ED%8A%B8%ED%8E%98%EC%9D%B4%EC%A7%80+%EC%9D%B8%EC%A6%9D+%EC%95%88%ED%95%98%EA%B2%8C&gs_lcp=Cgxnd3Mtd2l6LXNlcnAQAzIFCCEQoAE6CggAEEcQ1gQQsAM6BAgjECdKBAhBGABKBAhGGABQvApYww1giA9oAnABeAGAAZ4BiAGnBZIBAzAuNZgBAKABAcgBBMABAQ&sclient=gws-wiz-serp


ํ”„๋กœ์ ํŠธ ํŒŒ์ผ
OAuth2Login.zip

profile
์–ธ์  ๊ฐ€ ๋‚ด ์ฝ”๋“œ๋กœ ์„ธ์ƒ์— ๊ธฐ์—ฌํ•  ์ˆ˜ ์žˆ๋„๋ก, BE&Data Science ๊ฐœ๋ฐœ ๊ธฐ๋ก ๋…ธํŠธโ˜˜๏ธ

0๊ฐœ์˜ ๋Œ“๊ธ€