๐จ 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. ์ด์ 1 2 ๋ค์