๋ณธ๋ฌธ ๋ฐ”๋กœ๊ฐ€๊ธฐ

๐ŸŽจ Projects/์—๋Ÿฌ๋ชจ์Œ10

[์—๋Ÿฌ๋ชจ์Œ] fatal: 'origin' does not appear to be a git repository ์—๋Ÿฌ ์ƒํ™ฉ VSCode์—์„œ ๊นƒํ—ˆ๋ธŒ๋กœ push ํ•  ๋•Œ ๋ฐœ์ƒํ•œ ์—๋Ÿฌ ํ•ด๊ฒฐ ์šฐ์„  git remote -v ๋กœ ํ˜„์žฌ ํ”„๋กœ์ ํŠธ ํด๋”๊ฐ€ ๊นƒํ—ˆ๋ธŒ ๋ ˆํฌ์ง€ํ† ๋ฆฌ์— ์ž˜ ์—ฐ๊ฒฐ๋˜์–ด ์žˆ๋Š”์ง€ ํ™•์ธํ•œ๋‹ค. ๋งŒ์•ฝ ์—ฐ๊ฒฐ๋œ ๋ ˆํฌ์ง€ํ† ๋ฆฌ๊ฐ€ ์—†๋‹ค๋ฉด ์—ฐ๊ฒฐ์‹œ์ผœ์ค˜์•ผ ํ•œ๋‹ค. $ git remote add origin https://github.com/cgy0627/02_PhotoApp.git # ์ด๋ ‡๊ฒŒ ํ•˜๋ฉด https://github.com/cgy0627/02_PhotoApp.git ๋ ˆํฌ์ง€ํ† ๋ฆฌ๊ฐ€ origin ์ด๋ผ๋Š” ์ด๋ฆ„์œผ๋กœ ์—ฐ๊ฒฐ๋œ๋‹ค. ๋‚ด ๊ฒฝ์šฐ์—๋Š” ์ด๋ฏธ ๋ ˆํฌ์ง€ํ† ๋ฆฌ์— ์ž˜ ์—ฐ๊ฒฐ๋˜์–ด ์žˆ์—ˆ๋‹ค. ์ด๋ฏธ ์—ฐ๊ฒฐ์ด ๋˜์–ด ์žˆ๋‹ค๋ฉด ๊นƒํ—ˆ๋ธŒ๋กœ push ํ•  ๋•Œ, ์ด๋ฏธ ์ •ํ•ด์ง„ remote name์„ ์‚ฌ์šฉํ•ด์•ผํ•œ๋‹ค. ์œ„ ์Šคํฌ๋ฆฐ์ƒท์— ๋ณด์‹œ๋‹ค์‹œํ”ผ ๋‚ด ๊ฒฝ์šฐ๋Š” remote name์ด ์ด๋ฏธ 0.. 2023. 4. 29.
[์—๋Ÿฌ๋ชจ์Œ] java.lang.ClassCastException: java.lang.Long cannot be cast to java.lang.String ์—๋Ÿฌ ์ƒํ™ฉ ์ž๋ฐ”์—์„œ ์—ฌ๋Ÿฌ ๋กœ๊ทธ์ธ API๋ฅผ ์ด์šฉํ•ด ๋กœ๊ทธ์ธ์„ ๊ตฌํ˜„ํ•˜๊ณ ์ž ํ•  ๋•Œ ๊ตฌ๊ธ€, ํŽ˜์ด์Šค๋ถ, ๋„ค์ด๋ฒ„๋Š” ๋‹ค ์ž˜ ๋๋Š”๋ฐ ์นด์นด์˜ค UserInfo.java๋งŒ ์ด๋Ÿฐ ์—๋Ÿฌ๊ฐ€ ๋–ด๋‹ค. public class KakaoUserInfo implements OAuth2UserInfo { private Map attributes;// getAttributes() private Map attributesAccount;// getAttributes().get("kakao_account") private Map attributesProfile;// attributesAccount.get("profile") public KakaoUserInfo(Map attributes) { this.attributes = attributes; t.. 2023. 3. 23.
[์—๋Ÿฌ๋ชจ์Œ] com.auth0.jwt.exceptions.AlgorithmMismatchException: The provided Algorithm doesn't match the one defined in the JWT's Header ์—๋Ÿฌ ์„ค๋ช… ์ž๋ฐ” ํ”„๋กœ์ ํŠธ์—์„œ ๋กœ๊ทธ์ธ์„ ๊ตฌํ˜„ํ•˜๊ธฐ ์œ„ํ•ด ์‹œํ๋ฆฌํ‹ฐ ํ•„ํ„ฐ๋ฅผ ํ†ตํ•ด JWT ํ† ํฐ์„ ์ƒ์„ฑํ•˜๊ณ  ํ™•์ธํ•˜๋Š” ๊ณผ์ •์—์„œ ์ƒ๊ธด ์—๋Ÿฌ JwtAuthenticationFilter.java @RequiredArgsConstructor public class JwtAuthenticationFilter extends UsernamePasswordAuthenticationFilter { private final AuthenticationManager authenticationManager; // /login ์š”์ฒญ์„ ํ•˜๋ฉด ์‚ฌ์šฉ์ž ์ •๋ณด๋ฅผ ์ธ์ฆํ•˜๊ธฐ ์œ„ํ•ด ์‹คํ–‰๋˜๋Š” ํ•จ์ˆ˜ @Override public Authentication attemptAuthentication(HttpServletRequest request, HttpServ.. 2023. 3. 21.
[์—๋Ÿฌ๋ชจ์Œ] Failed to evaluate expression 'hasRole('ROLE_USER') or hasRole('ROLE_MANAGER') or hasROLE('ROLE_ADMIN')' ์—๋Ÿฌ ์„ค๋ช… ์ž๋ฐ” ํ”„๋กœ์ ํŠธ์—์„œ SecurityConfig.java๋ฅผ ํ†ตํ•ด ์‹œํ๋ฆฌํ‹ฐ ํ•„ํ„ฐ๋ฅผ ๊ฑฐ์ณ ์›น ํŽ˜์ด์ง€ ์ ‘๊ทผํ•  ๋•Œ ์ƒ๊ธด ์—๋Ÿฌ @Configuration @EnableWebSecurity @EnableGlobalMethodSecurity(securedEnabled = true, prePostEnabled = true) @RequiredArgsConstructor public class SecurityConfig extends WebSecurityConfigurerAdapter{ @Override protected void configure(HttpSecurity http) throws Exception { http.csrf().disable(); http.sessionManagement().sessionC.. 2023. 3. 19.
[์—๋Ÿฌ๋ชจ์Œ] The dependencies of some of the beans in the application context form a cycle ์—๋Ÿฌ ์„ค๋ช… ์ž๋ฐ” ํ”„๋กœ์ ํŠธ ์ค‘ 2๊ฐœ์˜ ํด๋ž˜์Šค๊ฐ€ ์„œ๋กœ๋ฅผ ์ฐธ์กฐํ•˜๋Š” ํ˜•ํƒœ๋ฅผ ๊ฐ€์งˆ ๋•Œ ์ƒ๊ธฐ๋Š” ์—๋Ÿฌ SecurityConfig.java @Configuration @EnableWebSecurity @EnableGlobalMethodSecurity(securedEnabled = true, prePostEnabled = true) @RequiredArgsConstructor public class SecurityConfig extends WebSecurityConfigurerAdapter{ @Autowired private PrincipalOauth2UserService principalOauth2UserService; // ๋ฌธ์ œ๋˜๋Š” ๋ถ€๋ถ„ @Bean public BCryptPasswordEncoder encodePwd.. 2023. 3. 18.
[GitHub] SQL ์ฝ”๋“œ ์ธ์‹ ๋ชปํ•จ ๋ฌธ์ œ ์ƒํ™ฉ GitHub์—์„œ๋Š” ๊ธฐ๋ณธ์ ์œผ๋กœ SQL ์ฝ”๋“œ๋ฅผ ์ธ์‹ํ•˜์ง€ ๋ชปํ•œ๋‹ค. ํ•ด๊ฒฐ SQL์„ ํฌํ•จํ•˜๋Š” ๋ ˆํฌ์ง€ํ† ๋ฆฌ์— .gitattributes๋ผ๋Š” ํŒŒ์ผ์„ ๋งŒ๋“ ๋‹ค. Add file > Create new file # .gitattributes ํŒŒ์ผ ๋‚ด์šฉ *.sql linguist-detectable=true *.sql linguist-language=sql ์ด์ œ ๋ ˆํฌ์ง€ํ† ๋ฆฌ์—์„œ .sql ํŒŒ์ผ๋“ค์„ ์ธ์‹ํ•˜์—ฌ ๋ช‡ ํผ์„ผํŠธ๊ฐ€ SQL ์ฝ”๋“œ์ธ์ง€ ํ‘œ์‹œํ•ด์ค€๋‹ค! ์ฐธ๊ณ  https://github.com/github/linguist/issues/3666 2023. 3. 12.
[์—๋Ÿฌ๋ชจ์Œ] exceeded the 'max_questions' resource ์—๋Ÿฌ ์„ค๋ช… ์ดํด๋ฆฝ์Šค์—์„œ ์Šคํ”„๋ง ๋ถ€ํŠธ ํ”„๋กœ์ ํŠธ ์‹คํ–‰ ์ค‘์— ์ฝ”๋“œ ๊ณ„์† ์ˆ˜์ •-์ €์žฅ-์ˆ˜์ •-์ €์žฅ ๋ฐ˜๋ณตํ•˜๋‹ค ๋ณด๋‹ˆ ์ƒ๊ธด ์—๋Ÿฌ java.sql.SQLSyntaxErrorException: User 'scott' has exceeded the 'max_questions' resource (current value: 1000) ํ•ด๊ฒฐ 1. ์‹คํ–‰ ์ค‘์ด๋˜ ํ”„๋กœ์ ํŠธ๋ฅผ ์ค‘์ง€ ์‹œ์ผฐ๋‹ค๊ฐ€ ๋‹ค์‹œ ์‹คํ–‰ํ•˜๊ธฐ๋งŒ ํ•ด๋„ ํ•ด๊ฒฐ ๋  ๋•Œ๊ฐ€ ์žˆ๋‹ค. 2. MySQL์—์„œ ๋ฌธ์ œ๊ฐ€ ๋ฐœ์ƒํ•œ ์œ ์ € ์™ธ์— ๋‹ค๋ฅธ ์œ ์ €๋กœ ์ ‘์†ํ•ด์„œ max_questions๋ฅผ 0์œผ๋กœ ๋ฆฌ์…‹ํ•ด์ค€๋‹ค. SET @MAX_QUESTIONS=0; FLUSH PRIVILEGES; ์ถ”๊ฐ€ ์„ค๋ช… max_questions๋ž€ 1์‹œ๊ฐ„ ์•ˆ์— MySQL์˜ user๊ฐ€ ์‹คํ–‰ํ•  ์ˆ˜ ์žˆ๋Š” ์ฟผ๋ฆฌ์˜ ๊ฐœ์ˆ˜์ด๋‹ค. ๋‚˜์˜ ์—๋Ÿฌ ๋ฉ”์„ธ์ง€๋ฅผ.. 2023. 3. 8.
๋ฐฑ์ค€ํ—ˆ๋ธŒ ๋นจ๊ฐ„ ์ฒดํฌ ์—๋Ÿฌ ์„ค๋ช… ๋ฐฑ์ค€์—์„œ ๋ฌธ์ œ๋ฅผ ๋งž์ถ”๋ฉด ๋ฐฑ์ค€ํ—ˆ๋ธŒ๊ฐ€ ์ž๋™์œผ๋กœ ๋‚ด ๊นƒํ—ˆ๋ธŒ์— ํ‘ผ ๋ฌธ์ œ๋ฅผ ์—…๋กœ๋“œ ์‹œ์ผœ์ฃผ๋Š”๋ฐ ๋นจ๊ฐ„ ์ฒดํฌ๊ฐ€ ๋œฌ๋‹ค๋Š” ๊ฒƒ์€ ์—…๋กœ๋“œ๊ฐ€ ์‹คํŒจํ–ˆ๋‹ค๋Š” ๊ฒƒ์ด๋‹ค. ํ•ด๊ฒฐ ์„œ๋กœ ๋‹ค๋ฅธ ๋„๋ฉ”์ธ ๊ฐ„ ์•ก์„ธ์Šค ํ•  ์ˆ˜ ์žˆ๊ฒŒ ๋„์™€์ฃผ๋Š” CORS ํฌ๋กฌ ํ™•์žฅ์ž๋ฅผ ์ด์šฉํ•˜๋ฉด ๋œ๋‹ค! (์—ฌ๊ธฐ์„œ ๋‹ค์šด๋ฐ›๊ธฐ) ํ™•์žฅํ”„๋กœ๊ทธ๋žจ์„ ๋‹ค์šด ๋ฐ›๊ณ  ON ์‹œํ‚ค๋ฉด ๋ฐฑ์ค€ํ—ˆ๋ธŒ๊ฐ€ ๋‹ค์‹œ ์ •์ƒ์ ์œผ๋กœ ์ž‘๋™ํ•œ๋‹ค. CORS๋ž€ ์›น ํŽ˜์ด์ง€์—์„œ ๋‹ค๋ฅธ ๋„๋ฉ”์ธ์— ์ ‘๊ทผํ•  ๋•Œ ํ•„์š”ํ•œ ๋ณด์•ˆ ๋งค์ปค๋‹ˆ์ฆ˜์ด๋‹ค. ๋ฐฑ์ค€์—์„œ ๊นƒํ—ˆ๋ธŒ ๋ฆฌ์†Œ์Šค์— ์ ‘๊ทผํ•˜๋ ค๋‹ค ๋ณด๋‹ˆ ๋ฌธ์ œ๊ฐ€ ์ƒ๊ธด๊ฒŒ ์•„๋‹๊นŒ..? ์ฐธ๊ณ  https://www.moesif.com/blog/technical/cors/Authoritative-Guide-to-CORS-Cross-Origin-Resource-Sharing-for-REST-APIs/ 2023. 3. 7.
[์—๋Ÿฌ๋ชจ์Œ] Failed to configure a DataSource ์—๋Ÿฌ ์„ค๋ช… ์ดํด๋ฆฝ์Šค์—์„œ ํ”„๋กœ์ ํŠธ๋ฅผ ์Šคํ”„๋ง ๋ถ€ํŠธ๋กœ ์‹คํ–‰ํ•  ๋•Œ ๋‚˜๋Š” ์—๋Ÿฌ Failed to configure a DataSource: 'url' attribute is not specified and no embedded datasource could be configured. ํ•ด๊ฒฐ ํ”„๋กœ์ ํŠธ์˜ application.properties ํŒŒ์ผ์— JDBC url์„ ์ถ”๊ฐ€ํ•˜๋ฉด ๋œ๋‹ค. # DataSource spring.datasource.url=jdbc:mysql://localhost:3306/[DB์Šคํ‚ค๋งˆ๋ช…]?serverTimeZone=Asia/Seoul spring.datasource.username=[DB์ ‘์†Id] spring.datasource.password=[DB์ ‘์†Password] spring.dataso.. 2023. 3. 3.