seorinha / Mountain

0 stars 0 forks source link

카카오 로그인 api 구현 #7

Open seorinha opened 7 months ago

seorinha commented 7 months ago

~22 수

seorinha commented 4 months ago

com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException: Unrecognized field "connected_at" (class com.project.kakao.KakaoProfile), not marked as ignorable (4 known properties: "kakaoAccount", "id", "connectedAt", "properties"]) at [Source: (String)"{"id":3340965840,"connected_at":"2024-02-20T12:50:34Z","properties":{"nickname":"서린","profile_image":"http://k.kakaocdn.net/dn/BsIPx/btsEA67iCrY/5ATUQ4Xy5zWM59CwQYCw71/img_640x640.jpg","thumbnail_image":"http://k.kakaocdn.net/dn/BsIPx/btsEA67iCrY/5ATUQ4Xy5zWM59CwQYCw71/img_110x110.jpg"},"kakao_account":{"profile_nickname_needs_agreement":false,"profile_image_needs_agreement":false,"profile":{"nickname":"서린","thumbnail_image_url":"http://k.kakaocdn.net/dn/BsIPx/btsEA67iCrY/5ATUQ4Xy5zWM59CwQYCw71/"[truncated 148 chars]; line: 1, column: 34] (through reference chain: com.project.kakao.KakaoProfile["connected_at"])

2024-02-22 13:43:33,396 ERROR [org.apache.catalina.core.ContainerBase.[Tomcat].[localhost].[/].[dispatcherServlet]] Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is java.lang.NullPointerException: Cannot invoke "com.project.kakao.KakaoProfile.getId()" because "kakaoProfile" is null] with root cause java.lang.NullPointerException: Cannot invoke "com.project.kakao.KakaoProfile.getId()" because "kakaoProfile" is null

-> 카카오에서 카카오 사용자의 profile 정보를 넘겨줄 때 snake_case형식으로 주는데 jsonschema2pojo에서 자동으로 CamelCase로 변경해서 생성해줬기 때문에 생긴 에러

-> KakaoProfile.java의 변수들을 snake_case로 수정

seorinha commented 4 months ago

Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'commentBO': Unsatisfied dependency expressed through field 'userBO';

Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'userBO': Unsatisfied dependency expressed through field 'userRepository';

Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userRepository' defined in com.project.user.repository.UserRepository defined in @EnableJpaRepositories declared on JpaRepositoriesRegistrar.

Caused by: org.springframework.data.repository.query.QueryCreationException: Could not create query for public abstract java.util.

Caused by: java.lang.IllegalArgumentException: Failed to create query for method public abstract java.util.Optional com.project.user.repository.UserRepository.findbyKakaoName(java.lang.String)! No property 'findbyKakaoName' found for type 'UserEntity'

Caused by: org.springframework.data.mapping.PropertyReferenceException: No property 'findbyKakaoName' found for type 'UserEntity'

-> userEntity에 findbyKakaoName과 일치하는 속성이 없으므로 이 메소드를 사용자를 찾는 데 사용할 수 없기 때문에 발생

-> getUserEntityByName()/findByName()으로 메소드를 수정

seorinha commented 4 months ago

Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled. 2024-02-22 16:50:18,096 ERROR [org.springframework.boot.diagnostics.LoggingFailureAnalysisReporter]


APPLICATION FAILED TO START


Description:

Field passwordEncoder in com.project.kakao.KakaoController required a bean of type 'com.project.user.PasswordEncoder' that could not be found.

The injection point has the following annotations:

Action:

Consider defining a bean of type 'com.project.user.PasswordEncoder' in your configuration.

-> com.project.kakao.KakaoController에서 passwordEncoder 필드를 사용하려고 하는데, 해당 타입의 빈을 찾을 수 없다는 에러

-> PasswordEncoder클래스를 interface로 수정

seorinha commented 4 months ago

There was an unexpected error (type=Internal Server Error, status=500).

Validation error messages from TagLibraryValidator for [c] in [/WEB-INF/jsp/include/header.jsp]

34: Illegal text inside "c:choose" tag: "