๊ธฐ์ค ๋งํฌ
๊ทธ ์ธ ์ฐธ๊ณ ๋งํฌ
SpringBoot์์ JPA ์ฌ์ฉํ๊ธฐ(4) - JPA Auditing
์คํ๋ง ๋ถํธ๋ก OAuth2 ๊ตฌํ(ํ์ด์ค๋ถ, ๊ตฌ๊ธ, ์นด์นด์ค, ๋ค์ด๋ฒ)
์งํ ์ํฉ ์ ๋ฆฌ
ํ๋ก์ ํธ ์์ฑ
- 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์์ ๋ผ์ด๋ธ๋ฌ๋ฆฌ ์ถ๊ฐ
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;
}
์คํ๋ง ์ํ๋ฆฌํฐ ์ค์
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()
}
์ฃผ์ : ์์ง 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.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();
}
}
๋ก๊ทธ์ธ ๊ธฐ๋ฅ ํ ์คํธ
- 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 ์ฝ๋
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";
}
}
ํ ์คํธ
-> ํ ์คํธ ์คํจ
"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 ์ด๋ ๊ฒ ์์ฑํ๋ค๊ฐ, ์ง์๋ฒ๋ฆฌ๊ณ ๋ค์ ํ๋๋ ์ฑ๊ณตํ ๊ฒ ๊ฐ๋ค.
ํ์ฌ ์ํฉ(~ 2021.01.25 ์์ )
-> 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