h2 데이터베이스 생성 오류 질문
미해결
실전! 스프링 데이터 JPA
localhost로 바꾸고 jdbc:h2:~/datajpa 로 작성하고 해도 저렇게 뜨네요 권한도 755로 변경했습니다 어떻게 해야 할까요?
- JPA
- spring-boot
- jpa
- java
- spring
172만명의 커뮤니티!! 함께 토론해봐요.
미해결
실전! 스프링 데이터 JPA
localhost로 바꾸고 jdbc:h2:~/datajpa 로 작성하고 해도 저렇게 뜨네요 권한도 755로 변경했습니다 어떻게 해야 할까요?
해결됨
실전! 스프링 부트와 JPA 활용2 - API 개발과 성능 최적화
학습하는 분들께 도움이 되고, 더 좋은 답변을 드릴 수 있도록 질문전에 다음을 꼭 확인해주세요. 1. 강의 내용과 관련된 질문을 남겨주세요. 2. 인프런의 질문 게시판과 자주 하는 질문(링크)을 먼저 확인해주세요. (자주 하는 질문 링크: https://bit.ly/3fX6ygx) 3. 질문 잘하기 메뉴얼(링크)을 먼저 읽어주세요. (질문 잘하기 메뉴얼 링크: https://bit.ly/2UfeqCG) 질문 시에는 위 내용은 삭제하고 다음 내용을 남겨주세요. ========================================= [질문 템플릿] 1. 강의 내용과 관련된 질문인가요? (예/아니오) 2. 인프런의 질문 게시판과 자주 하는 질문에 없는 내용인가요? (예/아니오) 3. 질문 잘하기 메뉴얼을 읽어보셨나요? (예/아니오) [질문 내용] 여기에 질문 내용을 남겨주세요. 다른건 다 잘 동작하는데 주문 내역 조회를 하면 Whitelabel Error Page This application has no configured error view, so you are seeing this as a fallback. Thu Feb 09 17:10:38 KST 2023 [80f6a090-2] There was an unexpected error (type=Internal Server Error, status=500). An error happened during template parsing (template: "class path resource [templates/order/orderList.html]") org.thymeleaf.exceptions.TemplateInputException: An error happened during template parsing (template: "class path resource [templates/order/orderList.html]") at org.thymeleaf.templateparser.markup.AbstractMarkupTemplateParser.parse( AbstractMarkupTemplateParser.java:241 ) Suppressed: The stacktrace has been enhanced by Reactor, refer to additional information below: Error has been observed at the following site(s): checkpoint ⇢ Handler jpaBook.jpaShop.controller.OrderController#orderList(OrderSearch, Model) [DispatcherHandler] checkpoint ⇢ HTTP GET "/orders" [ExceptionHandlingWebHandler] Original Stack Trace: at org.thymeleaf.templateparser.markup.AbstractMarkupTemplateParser.parse( AbstractMarkupTemplateParser.java:241 ) at org.thymeleaf.templateparser.markup.AbstractMarkupTemplateParser.parseStandalone( AbstractMarkupTemplateParser.java:100 ) at org.thymeleaf.engine.TemplateManager.parseAndProcess( TemplateManager.java:666 ) at org.thymeleaf.TemplateEngine.process( TemplateEngine.java:1103 ) at org.thymeleaf.TemplateEngine.process( TemplateEngine.java:1077 ) at org.thymeleaf.spring6.SpringWebFluxTemplateEngine.lambda$createFullStream$0( SpringWebFluxTemplateEngine.java:198 ) at reactor.core.publisher.MonoCreate.subscribe( MonoCreate.java:58 ) at reactor.core.publisher.InternalMonoOperator.subscribe( InternalMonoOperator.java:64 ) at reactor.core.publisher.MonoFlatMap$FlatMapMain.onNext( MonoFlatMap.java:165 ) at reactor.core.publisher.MonoIgnoreThen$ThenIgnoreMain.complete( MonoIgnoreThen.java:292 ) at reactor.core.publisher.MonoIgnoreThen$ThenIgnoreMain.onNext( MonoIgnoreThen.java:187 ) at reactor.core.publisher.MonoIgnoreThen$ThenIgnoreMain.subscribeNext( MonoIgnoreThen.java:236 ) at reactor.core.publisher.MonoIgnoreThen$ThenIgnoreMain.onComplete( MonoIgnoreThen.java:203 ) at reactor.core.publisher.MonoPeekTerminal$MonoTerminalPeekSubscriber.onComplete( MonoPeekTerminal.java:299 ) at reactor.core.publisher.MonoWhen$WhenCoordinator.signal( MonoWhen.java:211 ) at reactor.core.publisher.MonoWhen$WhenInner.onComplete( MonoWhen.java:427 ) at reactor.core.publisher.MonoPeekTerminal$MonoTerminalPeekSubscriber.onComplete( MonoPeekTerminal.java:299 ) at reactor.core.publisher.Operators$MonoSubscriber.complete( Operators.java:1840 ) at reactor.core.publisher.MonoCacheTime$CoordinatorSubscriber.signalCached( MonoCacheTime.java:337 ) at reactor.core.publisher.MonoCacheTime$CoordinatorSubscriber.onNext( MonoCacheTime.java:354 ) at reactor.core.publisher.FluxPeek$PeekSubscriber.onNext( FluxPeek.java:200 ) at reactor.core.publisher.FluxSwitchIfEmpty$SwitchIfEmptySubscriber.onNext( FluxSwitchIfEmpty.java:74 ) at reactor.core.publisher.MonoPeekTerminal$MonoTerminalPeekSubscriber.onNext( MonoPeekTerminal.java:180 ) at reactor.core.publisher.MonoPublishOn$PublishOnSubscriber.run( MonoPublishOn.java:181 ) at reactor.core.scheduler.SchedulerTask.call ( SchedulerTask.java:68 ) at reactor.core.scheduler.SchedulerTask.call ( SchedulerTask.java:28 ) at java.base/java.util.concurrent.FutureTask.run( FutureTask.java:264 ) at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run( ScheduledThreadPoolExecutor.java:304 ) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker( ThreadPoolExecutor.java:1136 ) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run( ThreadPoolExecutor.java:635 ) at java.base/java.lang.Thread.run( Thread.java:833 ) Caused by: org.attoparser.ParseException: Exception evaluating SpringEL expression: " item.member.name " (template: "order/orderList" - line 45, col 21) at org.attoparser.MarkupParser.parseDocument( MarkupParser.java:393 ) at org.attoparser.MarkupParser.parse( MarkupParser.java:257 ) at org.thymeleaf.templateparser.markup.AbstractMarkupTemplateParser.parse( AbstractMarkupTemplateParser.java:230 ) at org.thymeleaf.templateparser.markup.AbstractMarkupTemplateParser.parseStandalone( AbstractMarkupTemplateParser.java:100 ) at org.thymeleaf.engine.TemplateManager.parseAndProcess( TemplateManager.java:666 ) at org.thymeleaf.TemplateEngine.process( TemplateEngine.java:1103 ) at org.thymeleaf.TemplateEngine.process( TemplateEngine.java:1077 ) at org.thymeleaf.spring6.SpringWebFluxTemplateEngine.lambda$createFullStream$0( SpringWebFluxTemplateEngine.java:198 ) at reactor.core.publisher.MonoCreate.subscribe( MonoCreate.java:58 ) at reactor.core.publisher.InternalMonoOperator.subscribe( InternalMonoOperator.java:64 ) at reactor.core.publisher.MonoFlatMap$FlatMapMain.onNext( MonoFlatMap.java:165 ) at reactor.core.publisher.MonoIgnoreThen$ThenIgnoreMain.complete( MonoIgnoreThen.java:292 ) at reactor.core.publisher.MonoIgnoreThen$ThenIgnoreMain.onNext( MonoIgnoreThen.java:187 ) at reactor.core.publisher.MonoIgnoreThen$ThenIgnoreMain.subscribeNext( MonoIgnoreThen.java:236 ) at reactor.core.publisher.MonoIgnoreThen$ThenIgnoreMain.onComplete( MonoIgnoreThen.java:203 ) at reactor.core.publisher.MonoPeekTerminal$MonoTerminalPeekSubscriber.onComplete( MonoPeekTerminal.java:299 ) at reactor.core.publisher.MonoWhen$WhenCoordinator.signal( MonoWhen.java:211 ) at reactor.core.publisher.MonoWhen$WhenInner.onComplete( MonoWhen.java:427 ) at reactor.core.publisher.MonoPeekTerminal$MonoTerminalPeekSubscriber.onComplete( MonoPeekTerminal.java:299 ) at reactor.core.publisher.Operators$MonoSubscriber.complete( Operators.java:1840 ) at reactor.core.publisher.MonoCacheTime$CoordinatorSubscriber.signalCached( MonoCacheTime.java:337 ) at reactor.core.publisher.MonoCacheTime$CoordinatorSubscriber.onNext( MonoCacheTime.java:354 ) at reactor.core.publisher.FluxPeek$PeekSubscriber.onNext( FluxPeek.java:200 ) at reactor.core.publisher.FluxSwitchIfEmpty$SwitchIfEmptySubscriber.onNext( FluxSwitchIfEmpty.java:74 ) at reactor.core.publisher.MonoPeekTerminal$MonoTerminalPeekSubscriber.onNext( MonoPeekTerminal.java:180 ) at reactor.core.publisher.MonoPublishOn$PublishOnSubscriber.run( MonoPublishOn.java:181 ) at reactor.core.scheduler.SchedulerTask.call ( SchedulerTask.java:68 ) at reactor.core.scheduler.SchedulerTask.call ( SchedulerTask.java:28 ) at java.base/java.util.concurrent.FutureTask.run( FutureTask.java:264 ) at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run( ScheduledThreadPoolExecutor.java:304 ) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker( ThreadPoolExecutor.java:1136 ) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run( ThreadPoolExecutor.java:635 ) at java.base/java.lang.Thread.run( Thread.java:833 ) Caused by: org.thymeleaf.exceptions.TemplateProcessingException: Exception evaluating SpringEL expression: " item.member.name " (template: "order/orderList" - line 45, col 21) at org.thymeleaf.spring6.expression.SPELVariableExpressionEvaluator.evaluate( SPELVariableExpressionEvaluator.java:292 ) at org.thymeleaf.standard.expression.VariableExpression.executeVariableExpression( VariableExpression.java:166 ) at org.thymeleaf.standard.expression.SimpleExpression.executeSimple( SimpleExpression.java:66 ) at org.thymeleaf.standard.expression.Expression.execute( Expression.java:109 ) at org.thymeleaf.standard.expression.Expression.execute( Expression.java:138 ) at org.thymeleaf.standard.processor.AbstractStandardExpressionAttributeTagProcessor.doProcess( AbstractStandardExpressionAttributeTagProcessor.java:144 ) at org.thymeleaf.processor.element.AbstractAttributeTagProcessor.doProcess( AbstractAttributeTagProcessor.java:74 ) at org.thymeleaf.processor.element.AbstractElementTagProcessor.process( AbstractElementTagProcessor.java:95 ) at org.thymeleaf.util.ProcessorConfigurationUtils$ElementTagProcessorWrapper.process( ProcessorConfigurationUtils.java:633 ) at org.thymeleaf.engine.ProcessorTemplateHandler.handleOpenElement( ProcessorTemplateHandler.java:1314 ) at org.thymeleaf.engine.OpenElementTag.beHandled( OpenElementTag.java:205 ) at org.thymeleaf.engine.Model.process( Model.java:282 ) at org.thymeleaf.engine.Model.process( Model.java:290 ) at org.thymeleaf.engine.IteratedGatheringModelProcessable.processIterationModel( IteratedGatheringModelProcessable.java:368 ) at org.thymeleaf.engine.IteratedGatheringModelProcessable.process( IteratedGatheringModelProcessable.java:222 ) at org.thymeleaf.engine.ProcessorTemplateHandler.handleCloseElement( ProcessorTemplateHandler.java:1640 ) at org.thymeleaf.engine.TemplateHandlerAdapterMarkupHandler.handleCloseElementEnd( TemplateHandlerAdapterMarkupHandler.java:388 ) at org.thymeleaf.templateparser.markup.InlinedOutputExpressionMarkupHandler$InlineMarkupAdapterPreProcessorHandler.handleCloseElementEnd( InlinedOutputExpressionMarkupHandler.java:322 ) at org.thymeleaf.standard.inline.OutputExpressionInlinePreProcessorHandler.handleCloseElementEnd( OutputExpressionInlinePreProcessorHandler.java:220 ) at org.thymeleaf.templateparser.markup.InlinedOutputExpressionMarkupHandler.handleCloseElementEnd( InlinedOutputExpressionMarkupHandler.java:164 ) at org.attoparser.HtmlElement.handleCloseElementEnd( HtmlElement.java:169 ) at org.attoparser.HtmlMarkupHandler.handleCloseElementEnd( HtmlMarkupHandler.java:412 ) at org.attoparser.MarkupEventProcessorHandler.handleCloseElementEnd( MarkupEventProcessorHandler.java:473 ) at org.attoparser.ParsingElementMarkupUtil.parseCloseElement( ParsingElementMarkupUtil.java:201 ) at org.attoparser.MarkupParser.parseBuffer( MarkupParser.java:725 ) at org.attoparser.MarkupParser.parseDocument( MarkupParser.java:301 ) ... 32 more Caused by: org.springframework.expression.spel.SpelEvaluationException: EL1021E: A problem occurred whilst attempting to access the property 'name': 'Unable to access property 'name' through getter method' at org.springframework.expression.spel.ast.PropertyOrFieldReference.readProperty( PropertyOrFieldReference.java:209 ) at org.springframework.expression.spel.ast.PropertyOrFieldReference.getValueInternal( PropertyOrFieldReference.java:104 ) at org.springframework.expression.spel.ast.PropertyOrFieldReference$AccessorLValue.getValue( PropertyOrFieldReference.java:405 ) at org.springframework.expression.spel.ast.CompoundExpression.getValueInternal( CompoundExpression.java:92 ) at org.springframework.expression.spel.ast.SpelNodeImpl.getValue( SpelNodeImpl.java:112 ) at org.springframework.expression.spel.standard.SpelExpression.getValue( SpelExpression.java:338 ) at org.thymeleaf.spring6.expression.SPELVariableExpressionEvaluator.evaluate( SPELVariableExpressionEvaluator.java:265 ) ... 57 more Caused by: org.springframework.expression.AccessException: Unable to access property 'name' through getter method at org.springframework.expression.spel.support .ReflectivePropertyAccessor$OptimalPropertyAccessor.read( ReflectivePropertyAccessor.java:685 ) at org.springframework.expression.spel.ast.PropertyOrFieldReference.readProperty( PropertyOrFieldReference.java:204 ) ... 63 more Caused by: java.lang.reflect.InvocationTargetException at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke( DirectMethodHandleAccessor.java:119 ) at java.base/java.lang.reflect.Method.invoke( Method.java:577 ) at org.springframework.expression.spel.support .ReflectivePropertyAccessor$OptimalPropertyAccessor.read( ReflectivePropertyAccessor.java:681 ) ... 64 more Caused by: org.hibernate.LazyInitializationException: could not initialize proxy [jpaBook.jpaShop.domain.Member#1] - no Session at org.hibernate.proxy.AbstractLazyInitializer.initialize( AbstractLazyInitializer.java:164 ) at org.hibernate.proxy.AbstractLazyInitializer.getImplementation( AbstractLazyInitializer.java:309 ) at org.hibernate.proxy.pojo.bytebuddy.ByteBuddyInterceptor.intercept( ByteBuddyInterceptor.java:44 ) at org.hibernate.proxy.ProxyConfiguration$InterceptorDispatcher.intercept( ProxyConfiguration.java:102 ) at jpaBook.jpaShop.domain.Member$HibernateProxy$qF4ptgCa.getName(Unknown Source) at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke( DirectMethodHandleAccessor.java:104 ) ... 66 more 이러한 오류가 뜹니다. orderList.html 에서 item.member.name 에 접근하려다가 오류가 나는 것 같은데 잘 모르겠어서 질문드립니다.
해결됨
배달앱 클론코딩 [with React Native]
안녕하세요. 현재 패키지명을 바꾸려고 하고 있는데 다른 파일들은 다 있는 buck 파일이 없어서 패키지명을 바꾸는데 애를 먹고 있습니다. 혹시 buck 파일이 없는 이유를 아실까요? 처음부터 보면서 따라갔고 다시 돌려보았으나 혹시 제가 놓친 부분이 있어서 그러한 것인지 알고 싶습니다.
해결됨
실전! 스프링 부트와 JPA 활용1 - 웹 애플리케이션 개발
안녕하세요 비즈니스 메서드에 관해 궁금한 게 생겨서 질문드립니다. 강의 중에 엔티티를 변경할 때는 Setter대신 비즈니스 메서드를 별도 작성하여 제공하라고 해주셨는데 1) 등록이나 수정(save, update) 같은 것을 할 때 domain 쪽에 비즈니스 메서드를 작성하라는 뜻이 맞나요? 2) 구글링을 해보니 빌더 패턴, 정적펙토리 메소드 라는 기술도 존재하던데 비즈니스 메서드를 포함한 3가지는 궁극적으로 하는일이 비슷하다고 생각하는데 다른가요?
미해결
배달앱 클론코딩 [with React Native]
앱 이름을 바꿀때 app.json 파일을 건들지 않고, 다시 프로젝트를 만드는게 좋다고 하셨는데, 혹시 실제로 사용자들이 보는 앱 이름이랑 Play Store에 올라간 이름만 바꾸고 싶더라도 프로젝트를 새로 만드는것이 낫나요? https://marsland.tistory.com/515 아니면 새로 프로젝트를 만들지 않고 위 링크처럼 disPlayName이랑 strings.xml에 app_name만 바꿔도 될까요?
미해결
비전공자를 위한 진짜 입문 올인원 개발 부트캠프
제가 axios 설치 이후 npm start에서 지속적으로 오류가 나길래 stackflow를 보고 -i npm ~... 무엇을 터미널에서 진행시키고. node_modules 폴더와 package.json & lock.json 파일 삭제후 npm start 다시 했는데 아래와 같이 모듈 오류가 지속적으로 뜨네요. 모듈 파일명들이 전에는 @로 시작하는 파일들이 다 날라간 것 같구요. 모듈 중 Axios 폴더에서 index.d.ts 파일에서 오류가 발견되고 있는 상황입니다. 그랩님 조금만 도와주실 수 있을까요
미해결
배달앱 클론코딩 [with React Native]
errorResponse 에서 타입 에러가 납니다. 이것 저것 다 넣어봤는데 타입스크립트는 처음이라 뭘 고쳐야할 지 잘 모르겠어요ㅜㅜ SignIn.tsx import React, {useCallback, useRef, useState} from 'react'; import { ActivityIndicator, Alert, Pressable, StyleSheet, Text, TextInput, View, } from 'react-native'; import {NativeStackScreenProps} from '@react-navigation/native-stack'; import {RootStackParamList} from '../../AppInner'; import DismissKeyboardView from '../components/DismissKeyboardView'; import { useAppDispatch } from '../store'; import axios, { AxiosError } from 'axios'; import Config from 'react-native-config'; import userSlice from '../slices/user'; import EncryptedStorage from 'react-native-encrypted-storage'; type SignInScreenProps = NativeStackScreenProps<RootStackParamList, 'SignIn'>; function SignIn({navigation}: SignInScreenProps) { const dispatch = useAppDispatch(); const [loading, setLoading] = useState(false); const [email, setEmail] = useState(''); const [password, setPassword] = useState(''); const emailRef = useRef<TextInput | null>(null); const passwordRef = useRef<TextInput | null>(null); const onChangeEmail = useCallback((text: string) => { setEmail(text.trim()); }, []); const onChangePassword = useCallback((text: string) => { setPassword(text.trim()); }, []); const onSubmit = useCallback(async() => { if (!email || !email.trim()) { return Alert.alert('알림', '이메일을 입력해주세요.'); } if (!password || !password.trim()) { return Alert.alert('알림', '비밀번호를 입력해주세요.'); } try { setLoading(true); const response = await axios.post(`${Config.API_URL}/login`, { email, password, }); console.log(response.data); Alert.alert('알림', '로그인 되었습니다.'); dispatch( userSlice.actions.setUser({ name: response.data.data.name, email: response.data.data.email, accessToken: response.data.data.accessToken, refreshToken: response.data.data.refreshToken, }), ); await EncryptedStorage.setItem( 'refreshToken', response.data.data.refreshToken, ); } catch (error) { const errorResponse = (error as AxiosError).response; if (errorResponse) { Alert.alert('알림', errorResponse.data.message); } } finally { setLoading(false); } }, [loading, dispatch, email, password]); const toSignUp = useCallback(() => { navigation.navigate('SignUp'); }, [navigation]); const canGoNext = email && password; return ( <DismissKeyboardView> <View style={styles.inputWrapper}> <Text style={styles.label}>이메일</Text> <TextInput style={styles.textInput} placeholder="이메일을 입력해주세요." placeholderTextColor="#666" value={email} onChangeText={onChangeEmail} importantForAccessibility="yes" autoComplete="email" textContentType="emailAddress" // IOS keyboardType="email-address" returnKeyType="next" clearButtonMode="while-editing" onSubmitEditing={() => { passwordRef.current?.focus(); }} blurOnSubmit={false} ref={emailRef} /> </View> <View style={styles.inputWrapper}> <Text style={styles.label}>비밀번호</Text> <TextInput style={styles.textInput} placeholder="비밀번호를 입력해주세요(영문,숫자,특수문자)" placeholderTextColor="#666" importantForAutofill="yes" value={password} onChangeText={onChangePassword} importantForAccessibility="yes" autoComplete="password" textContentType="password" // IOS // keyboardType="decimal-pad" secureTextEntry returnKeyType="send" clearButtonMode="while-editing" // IOS onSubmitEditing={onSubmit} ref={passwordRef} /> </View> <View style={styles.buttonZone}> <Pressable onPress={onSubmit} style={ !canGoNext ? styles.loginButton : StyleSheet.compose(styles.loginButton, styles.loginButtonActive) } disabled={!canGoNext || loading}> {loading ? ( <ActivityIndicator color="white" /> ) : ( <Text style={styles.loginButtonText}>로그인</Text> )} </Pressable> <Pressable onPress={toSignUp}> <Text>회원가입하기</Text> </Pressable> </View> </DismissKeyboardView> ); } const styles = StyleSheet.create({ textInput: { padding: 5, borderBottomWidth: StyleSheet.hairlineWidth, }, inputWrapper: { padding: 20, }, label: { fontWeight: 'bold', fontSize: 16, marginBottom: 20, }, buttonZone: { alignItems: 'center', }, loginButton: { backgroundColor: 'gray', paddingHorizontal: 20, paddingVertical: 10, borderRadius: 5, marginBottom: 10, }, loginButtonActive: { backgroundColor: 'blue', }, loginButtonText: { color: 'white', fontSize: 16, }, }); export default SignIn;
해결됨
스프링 시큐리티 OAuth2
OAuth2AuthorizationService 구현체를 JdbcOAuth2AuthorizationService로 변경하였습니다. Spring Authorization Server 버전은 1.0 입니다. @Bean public OAuth2AuthorizationService authorizationService(JdbcTemplate jdbcTemplate, RegisteredClientRepository registeredClientRepository) { return new JdbcOAuth2AuthorizationService(jdbcTemplate, registeredClientRepository); } DB Schema : Spring Authorization Server 에서 제공 /* IMPORTANT: If using PostgreSQL, update ALL columns defined with 'blob' to 'text', as PostgreSQL does not support the 'blob' data type. */ CREATE TABLE oauth2_authorization ( id varchar(100) NOT NULL, registered_client_id varchar(100) NOT NULL, principal_name varchar(200) NOT NULL, authorization_grant_type varchar(100) NOT NULL, authorized_scopes varchar(1000) DEFAULT NULL, attributes blob DEFAULT NULL, state varchar(500) DEFAULT NULL, authorization_code_value blob DEFAULT NULL, authorization_code_issued_at timestamp DEFAULT NULL, authorization_code_expires_at timestamp DEFAULT NULL, authorization_code_metadata blob DEFAULT NULL, access_token_value blob DEFAULT NULL, access_token_issued_at timestamp DEFAULT NULL, access_token_expires_at timestamp DEFAULT NULL, access_token_metadata blob DEFAULT NULL, access_token_type varchar(100) DEFAULT NULL, access_token_scopes varchar(1000) DEFAULT NULL, oidc_id_token_value blob DEFAULT NULL, oidc_id_token_issued_at timestamp DEFAULT NULL, oidc_id_token_expires_at timestamp DEFAULT NULL, oidc_id_token_metadata blob DEFAULT NULL, refresh_token_value blob DEFAULT NULL, refresh_token_issued_at timestamp DEFAULT NULL, refresh_token_expires_at timestamp DEFAULT NULL, refresh_token_metadata blob DEFAULT NULL, PRIMARY KEY (id) ); authorization code 발급시 로그인 화면 계정 정보 입력 후 MariaDB에 저장할떄 .BadSqlGrammarException 예외가 발생합니다, 질문1)에러 로그를 보면 insertAuthorization 메소드에서 attribute 컬럼에 Principal Class 자체를 저장하는 과정에서 발생하고 있습니다, 다만, 퀴리를 DB에서 직접 실행하면 저장이 되는것 으로 보아 Spring JDBCTemplate에서 변환시 오루가 발생하는거 같은데 원인이 궁급합니다. private void insertAuthorization(OAuth2Authorization authorization) { List<SqlParameterValue> parameters = this.authorizationParametersMapper.apply(authorization); try (LobCreator lobCreator = this.lobHandler.getLobCreator()) { PreparedStatementSetter pss = new LobCreatorArgumentPreparedStatementSetter(lobCreator, parameters.toArray()); this.jdbcOperations.update(SAVE_AUTHORIZATION_SQL, pss); } } Caused by: java.sql.SQLSyntaxErrorException: (conn=952251) Could not convert [{"@class":"java.util.Collections$UnmodifiableMap"," java.security .Principal":{"@class":" org.springframework.security .authentication.UsernamePasswordAuthenticationToken","authorities":["java.util.Collections$UnmodifiableRandomAccessList",[{"@class":" org.springframework.security .core.authority.SimpleGrantedAuthority","authority":"ROLE_USER"}]],"details":{"@class":" org.springframework.security .web.authentication.WebAuthenticationDetails","remoteAddress":"0:0:0:0:0:0:0:1","sessionId":"B8C2C171954B719820D6592F6102AF9B"},"authenticated":true,"principal":{"@class":" org.springframework.security .core.userdetails.User","password":null,"username":"user1","authorities":["java.util.Collections$UnmodifiableSet",[{"@class":" org.springframework.security .core.authority.SimpleGrantedAuthority","authority":"ROLE_USER"}]],"accountNonExpired":true,"accountNonLocked":true,"credentialsNonExpired":true,"enabled":true},"credentials":null}," org.springframework.security .oauth2.core.endpoint.OAuth2AuthorizationRequest":{"@class":" org.springframework.security .oauth2.core.endpoint.OAuth2AuthorizationRequest","authorizationUri":" http://localhost:9000/oauth2/authorize","authorizationGrantType":{"value":"authorization_code"},"responseType":{"value":"code"},"clientId":"messaging-client","redirectUri":"http://127.0.0.1:8080/login/oauth2/code/messaging-client-oidc","scopes":["java.util.Collections$UnmodifiableSet",["openid"]],"state":null,"additionalParameters":{"@class":"java.util.Collections$UnmodifiableMap","grant_type":"authorization_code"},"authorizationRequestUri":"http://localhost:9000/oauth2/authorize?response_type=code&client_id=messaging-client&scope=openid&redirect_uri=http://127.0.0.1:8080/login/oauth2/code/messaging-client-oidc&grant_type=authorization_code","attributes":{"@class":"java.util.Collections$UnmodifiableMap"} }}] to -4 RegisteredClientRepository는 구현체를 JdbcRegisteredClientRepository 로 변경해도 이상없이 동작 하고 있고 JdbcAuthorizationConsentService는 JdbcOAuth2AuthorizationService 오류로 동의 단게가 진행되지 않아서 확인해보지 않았습니다. 질문2)이외에도Authorization Server에서 blob 컴럼에 Class 자체를 저장하는 사례가 많이 있는데 커스참 구현체를 만들어서 Class 를 저장하지 않고 Authorization Server 필요한 항목만 JSON 으로 저장 하거나 테이블을 정규화 하여 Map 에 담아 주는것이 좋은 방법일까요? 참고로 Attribe는 JwtGenerator에서 보면 nonce 을 가지고 오고 있습니다. if (AuthorizationGrantType.AUTHORIZATION_CODE.equals(context.getAuthorizationGrantType())) { OAuth2AuthorizationRequest authorizationRequest = context.getAuthorization().getAttribute( OAuth2AuthorizationRequest.class.getName()); String nonce = (String) authorizationRequest.getAdditionalParameters().get(OidcParameterNames.NONCE); if (StringUtils.hasText(nonce)) { claimsBuilder.claim(IdTokenClaimNames.NONCE, nonce); } } 에러로그 전문 org.springframework.jdbc.BadSqlGrammarException: PreparedStatementCallback; bad SQL grammar [INSERT INTO oauth2_authorization (id, registered_client_id, principal_name, authorization_grant_type, authorized_scopes, attributes, state, authorization_code_value, authorization_code_issued_at, authorization_code_expires_at,authorization_code_metadata,access_token_value,access_token_issued_at,access_token_expires_at,access_token_metadata,access_token_type,access_token_scopes,oidc_id_token_value,oidc_id_token_issued_at,oidc_id_token_expires_at,oidc_id_token_metadata,refresh_token_value,refresh_token_issued_at,refresh_token_expires_at,refresh_token_metadata) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)] at org.springframework.jdbc.support .SQLExceptionSubclassTranslator.doTranslate( SQLExceptionSubclassTranslator.java:101 ) ~[spring-jdbc-6.0.4.jar:6.0.4] at org.springframework.jdbc.support .AbstractFallbackSQLExceptionTranslator.translate( AbstractFallbackSQLExceptionTranslator.java:70 ) ~[spring-jdbc-6.0.4.jar:6.0.4] at org.springframework.jdbc.core.JdbcTemplate.translateException( JdbcTemplate.java:1538 ) ~[spring-jdbc-6.0.4.jar:6.0.4] at org.springframework.jdbc.core.JdbcTemplate.execute( JdbcTemplate.java:667 ) ~[spring-jdbc-6.0.4.jar:6.0.4] at org.springframework.jdbc.core.JdbcTemplate.update( JdbcTemplate.java:960 ) ~[spring-jdbc-6.0.4.jar:6.0.4] at org.springframework.jdbc.core.JdbcTemplate.update( JdbcTemplate.java:1015 ) ~[spring-jdbc-6.0.4.jar:6.0.4] at org.springframework.security .oauth2.server.authorization.JdbcOAuth2AuthorizationService.insertAuthorization( JdbcOAuth2AuthorizationService.java:211 ) ~[spring-security-oauth2-authorization-server-1.0.0.jar:1.0.0] at org.springframework.security.oauth2.server.authorization.JdbcOAuth2AuthorizationService.save ( JdbcOAuth2AuthorizationService.java:189 ) ~[spring-security-oauth2-authorization-server-1.0.0.jar:1.0.0] at org.springframework.security .oauth2.server.authorization.authentication.OAuth2AuthorizationCodeRequestAuthenticationProvider.authenticate( OAuth2AuthorizationCodeRequestAuthenticationProvider.java:209 ) ~[spring-security-oauth2-authorization-server-1.0.0.jar:1.0.0] at org.springframework.security .authentication.ProviderManager.authenticate( ProviderManager.java:182 ) ~[spring-security-core-6.0.1.jar:6.0.1] at org.springframework.security .oauth2.server.authorization.web.OAuth2AuthorizationEndpointFilter.doFilterInternal( OAuth2AuthorizationEndpointFilter.java:166 ) ~[spring-security-oauth2-authorization-server-1.0.0.jar:1.0.0] at org.springframework.web.filter.OncePerRequestFilter.doFilter( OncePerRequestFilter.java:116 ) ~[spring-web-6.0.4.jar:6.0.4] at org.springframework.security .web.FilterChainProxy$VirtualFilterChain.doFilter( FilterChainProxy.java:374 ) ~[spring-security-web-6.0.1.jar:6.0.1] at org.springframework.security .oauth2.server.authorization.web.OAuth2AuthorizationServerMetadataEndpointFilter.doFilterInternal( OAuth2AuthorizationServerMetadataEndpointFilter.java:84 ) ~[spring-security-oauth2-authorization-server-1.0.0.jar:1.0.0] at org.springframework.web.filter.OncePerRequestFilter.doFilter( OncePerRequestFilter.java:116 ) ~[spring-web-6.0.4.jar:6.0.4] at org.springframework.security .web.FilterChainProxy$VirtualFilterChain.doFilter( FilterChainProxy.java:374 ) ~[spring-security-web-6.0.1.jar:6.0.1] at org.springframework.security .web.authentication.logout.LogoutFilter.doFilter( LogoutFilter.java:107 ) ~[spring-security-web-6.0.1.jar:6.0.1] at org.springframework.security .web.authentication.logout.LogoutFilter.doFilter( LogoutFilter.java:93 ) ~[spring-security-web-6.0.1.jar:6.0.1] at org.springframework.security .web.FilterChainProxy$VirtualFilterChain.doFilter( FilterChainProxy.java:374 ) ~[spring-security-web-6.0.1.jar:6.0.1] at org.springframework.security .web.csrf.CsrfFilter.doFilterInternal( CsrfFilter.java:116 ) ~[spring-security-web-6.0.1.jar:6.0.1] at org.springframework.web.filter.OncePerRequestFilter.doFilter( OncePerRequestFilter.java:116 ) ~[spring-web-6.0.4.jar:6.0.4] at org.springframework.security .web.FilterChainProxy$VirtualFilterChain.doFilter( FilterChainProxy.java:374 ) ~[spring-security-web-6.0.1.jar:6.0.1] at org.springframework.security .web.header.HeaderWriterFilter.doHeadersAfter( HeaderWriterFilter.java:90 ) ~[spring-security-web-6.0.1.jar:6.0.1] at org.springframework.security .web.header.HeaderWriterFilter.doFilterInternal( HeaderWriterFilter.java:75 ) ~[spring-security-web-6.0.1.jar:6.0.1] at org.springframework.web.filter.OncePerRequestFilter.doFilter( OncePerRequestFilter.java:116 ) ~[spring-web-6.0.4.jar:6.0.4] at org.springframework.security .web.FilterChainProxy$VirtualFilterChain.doFilter( FilterChainProxy.java:374 ) ~[spring-security-web-6.0.1.jar:6.0.1] at org.springframework.security .oauth2.server.authorization.config.annotation.web.configurers.AuthorizationServerContextFilter.doFilterInternal( AuthorizationServerContextFilter.java:61 ) ~[spring-security-oauth2-authorization-server-1.0.0.jar:1.0.0] at org.springframework.web.filter.OncePerRequestFilter.doFilter( OncePerRequestFilter.java:116 ) ~[spring-web-6.0.4.jar:6.0.4] at org.springframework.security .web.FilterChainProxy$VirtualFilterChain.doFilter( FilterChainProxy.java:374 ) ~[spring-security-web-6.0.1.jar:6.0.1] at org.springframework.security .web.context.SecurityContextHolderFilter.doFilter( SecurityContextHolderFilter.java:82 ) ~[spring-security-web-6.0.1.jar:6.0.1] at org.springframework.security .web.context.SecurityContextHolderFilter.doFilter( SecurityContextHolderFilter.java:69 ) ~[spring-security-web-6.0.1.jar:6.0.1] at org.springframework.security .web.FilterChainProxy$VirtualFilterChain.doFilter( FilterChainProxy.java:374 ) ~[spring-security-web-6.0.1.jar:6.0.1] at org.springframework.security .web.context.request.async.WebAsyncManagerIntegrationFilter.doFilterInternal( WebAsyncManagerIntegrationFilter.java:62 ) ~[spring-security-web-6.0.1.jar:6.0.1] at org.springframework.web.filter.OncePerRequestFilter.doFilter( OncePerRequestFilter.java:116 ) ~[spring-web-6.0.4.jar:6.0.4] at org.springframework.security .web.FilterChainProxy$VirtualFilterChain.doFilter( FilterChainProxy.java:374 ) ~[spring-security-web-6.0.1.jar:6.0.1] at org.springframework.security .web.session.DisableEncodeUrlFilter.doFilterInternal( DisableEncodeUrlFilter.java:42 ) ~[spring-security-web-6.0.1.jar:6.0.1] at org.springframework.web.filter.OncePerRequestFilter.doFilter( OncePerRequestFilter.java:116 ) ~[spring-web-6.0.4.jar:6.0.4] at org.springframework.security .web.FilterChainProxy$VirtualFilterChain.doFilter( FilterChainProxy.java:374 ) ~[spring-security-web-6.0.1.jar:6.0.1] at org.springframework.security .web.FilterChainProxy.doFilterInternal( FilterChainProxy.java:233 ) ~[spring-security-web-6.0.1.jar:6.0.1] at org.springframework.security .web.FilterChainProxy.doFilter( FilterChainProxy.java:191 ) ~[spring-security-web-6.0.1.jar:6.0.1] at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate( DelegatingFilterProxy.java:351 ) ~[spring-web-6.0.4.jar:6.0.4] at org.springframework.web.filter.DelegatingFilterProxy.doFilter( DelegatingFilterProxy.java:267 ) ~[spring-web-6.0.4.jar:6.0.4] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter( ApplicationFilterChain.java:185 ) ~[tomcat-embed-core-10.1.5.jar:10.1.5] at org.apache.catalina.core.ApplicationFilterChain.doFilter( ApplicationFilterChain.java:158 ) ~[tomcat-embed-core-10.1.5.jar:10.1.5] at org.springframework.web.filter.RequestContextFilter.doFilterInternal( RequestContextFilter.java:100 ) ~[spring-web-6.0.4.jar:6.0.4] at org.springframework.web.filter.OncePerRequestFilter.doFilter( OncePerRequestFilter.java:116 ) ~[spring-web-6.0.4.jar:6.0.4] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter( ApplicationFilterChain.java:185 ) ~[tomcat-embed-core-10.1.5.jar:10.1.5] at org.apache.catalina.core.ApplicationFilterChain.doFilter( ApplicationFilterChain.java:158 ) ~[tomcat-embed-core-10.1.5.jar:10.1.5] at org.springframework.web.filter.FormContentFilter.doFilterInternal( FormContentFilter.java:93 ) ~[spring-web-6.0.4.jar:6.0.4] at org.springframework.web.filter.OncePerRequestFilter.doFilter( OncePerRequestFilter.java:116 ) ~[spring-web-6.0.4.jar:6.0.4] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter( ApplicationFilterChain.java:185 ) ~[tomcat-embed-core-10.1.5.jar:10.1.5] at org.apache.catalina.core.ApplicationFilterChain.doFilter( ApplicationFilterChain.java:158 ) ~[tomcat-embed-core-10.1.5.jar:10.1.5] at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal( CharacterEncodingFilter.java:201 ) ~[spring-web-6.0.4.jar:6.0.4] at org.springframework.web.filter.OncePerRequestFilter.doFilter( OncePerRequestFilter.java:116 ) ~[spring-web-6.0.4.jar:6.0.4] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter( ApplicationFilterChain.java:185 ) ~[tomcat-embed-core-10.1.5.jar:10.1.5] at org.apache.catalina.core.ApplicationFilterChain.doFilter( ApplicationFilterChain.java:158 ) ~[tomcat-embed-core-10.1.5.jar:10.1.5] at org.apache.catalina.core.StandardWrapperValve.invoke( StandardWrapperValve.java:177 ) ~[tomcat-embed-core-10.1.5.jar:10.1.5] at org.apache.catalina.core.StandardContextValve.invoke( StandardContextValve.java:97 ) ~[tomcat-embed-core-10.1.5.jar:10.1.5] at org.apache.catalina.authenticator.AuthenticatorBase.invoke( AuthenticatorBase.java:542 ) ~[tomcat-embed-core-10.1.5.jar:10.1.5] at org.apache.catalina.core.StandardHostValve.invoke( StandardHostValve.java:119 ) ~[tomcat-embed-core-10.1.5.jar:10.1.5] at org.apache.catalina.valves.ErrorReportValve.invoke( ErrorReportValve.java:92 ) ~[tomcat-embed-core-10.1.5.jar:10.1.5] at org.apache.catalina.core.StandardEngineValve.invoke( StandardEngineValve.java:78 ) ~[tomcat-embed-core-10.1.5.jar:10.1.5] at org.apache.catalina.connector.CoyoteAdapter.service( CoyoteAdapter.java:357 ) ~[tomcat-embed-core-10.1.5.jar:10.1.5] at org.apache.coyote.http11.Http11Processor.service( Http11Processor.java:400 ) ~[tomcat-embed-core-10.1.5.jar:10.1.5] at org.apache.coyote.AbstractProcessorLight.process( AbstractProcessorLight.java:65 ) ~[tomcat-embed-core-10.1.5.jar:10.1.5] at org.apache.coyote.AbstractProtocol$ConnectionHandler.process( AbstractProtocol.java:859 ) ~[tomcat-embed-core-10.1.5.jar:10.1.5] at org.apache.tomcat.util.net .NioEndpoint$SocketProcessor.doRun( NioEndpoint.java:1734 ) ~[tomcat-embed-core-10.1.5.jar:10.1.5] at org.apache.tomcat.util.net.SocketProcessorBase.run ( SocketProcessorBase.java:52 ) ~[tomcat-embed-core-10.1.5.jar:10.1.5] at org.apache.tomcat.util.threads.ThreadPoolExecutor.runWorker( ThreadPoolExecutor.java:1191 ) ~[tomcat-embed-core-10.1.5.jar:10.1.5] at org.apache.tomcat.util.threads.ThreadPoolExecutor$Worker.run( ThreadPoolExecutor.java:659 ) ~[tomcat-embed-core-10.1.5.jar:10.1.5] at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run( TaskThread.java:61 ) ~[tomcat-embed-core-10.1.5.jar:10.1.5] at java.base/java.lang.Thread.run( Thread.java:833 ) ~[na:na] Caused by: java.sql.SQLSyntaxErrorException: (conn=952251) Could not convert [{"@class":"java.util.Collections$UnmodifiableMap"," java.security .Principal":{"@class":" org.springframework.security .authentication.UsernamePasswordAuthenticationToken","authorities":["java.util.Collections$UnmodifiableRandomAccessList",[{"@class":" org.springframework.security .core.authority.SimpleGrantedAuthority","authority":"ROLE_USER"}]],"details":{"@class":" org.springframework.security .web.authentication.WebAuthenticationDetails","remoteAddress":"0:0:0:0:0:0:0:1","sessionId":"B8C2C171954B719820D6592F6102AF9B"},"authenticated":true,"principal":{"@class":" org.springframework.security .core.userdetails.User","password":null,"username":"user1","authorities":["java.util.Collections$UnmodifiableSet",[{"@class":" org.springframework.security .core.authority.SimpleGrantedAuthority","authority":"ROLE_USER"}]],"accountNonExpired":true,"accountNonLocked":true,"credentialsNonExpired":true,"enabled":true},"credentials":null}," org.springframework.security .oauth2.core.endpoint.OAuth2AuthorizationRequest":{"@class":" org.springframework.security .oauth2.core.endpoint.OAuth2AuthorizationRequest","authorizationUri":" http://localhost:9000/oauth2/authorize","authorizationGrantType":{"value":"authorization_code"},"responseType":{"value":"code"},"clientId":"messaging-client","redirectUri":"http://127.0.0.1:8080/login/oauth2/code/messaging-client-oidc","scopes":["java.util.Collections$UnmodifiableSet",["openid"]],"state":null,"additionalParameters":{"@class":"java.util.Collections$UnmodifiableMap","grant_type":"authorization_code"},"authorizationRequestUri":"http://localhost:9000/oauth2/authorize?response_type=code&client_id=messaging-client&scope=openid&redirect_uri=http://127.0.0.1:8080/login/oauth2/code/messaging-client-oidc&grant_type=authorization_code","attributes":{"@class":"java.util.Collections$UnmodifiableMap"} }}] to -4 at org.mariadb.jdbc.export.ExceptionFactory.createException( ExceptionFactory.java:282 ) ~[mariadb-java-client-3.0.10.jar:na] at org.mariadb.jdbc.export.ExceptionFactory.create( ExceptionFactory.java:336 ) ~[mariadb-java-client-3.0.10.jar:na] at org.mariadb.jdbc.BasePreparedStatement.setInternalObject( BasePreparedStatement.java:1172 ) ~[mariadb-java-client-3.0.10.jar:na] at org.mariadb.jdbc.BasePreparedStatement.setObject( BasePreparedStatement.java:608 ) ~[mariadb-java-client-3.0.10.jar:na] at com.zaxxer.hikari.pool.HikariProxyPreparedStatement.setObject( HikariProxyPreparedStatement.java ) ~[HikariCP-5.0.1.jar:na] at org.springframework.jdbc.core.StatementCreatorUtils.setValue( StatementCreatorUtils.java:415 ) ~[spring-jdbc-6.0.4.jar:6.0.4] at org.springframework.jdbc.core.StatementCreatorUtils.setParameterValueInternal( StatementCreatorUtils.java:236 ) ~[spring-jdbc-6.0.4.jar:6.0.4] at org.springframework.jdbc.core.StatementCreatorUtils.setParameterValue( StatementCreatorUtils.java:152 ) ~[spring-jdbc-6.0.4.jar:6.0.4] at org.springframework.jdbc.core.ArgumentPreparedStatementSetter.doSetValue( ArgumentPreparedStatementSetter.java:65 ) ~[spring-jdbc-6.0.4.jar:6.0.4] at org.springframework.security .oauth2.server.authorization.JdbcOAuth2AuthorizationService$LobCreatorArgumentPreparedStatementSetter.doSetValue( JdbcOAuth2AuthorizationService.java:621 ) ~[spring-security-oauth2-authorization-server-1.0.0.jar:1.0.0] at org.springframework.jdbc.core.ArgumentPreparedStatementSetter.setValues( ArgumentPreparedStatementSetter.java:50 ) ~[spring-jdbc-6.0.4.jar:6.0.4] at org.springframework.jdbc.core.JdbcTemplate.lambda$update$2( JdbcTemplate.java:963 ) ~[spring-jdbc-6.0.4.jar:6.0.4] at org.springframework.jdbc.core.JdbcTemplate.execute( JdbcTemplate.java:651 ) ~[spring-jdbc-6.0.4.jar:6.0.4] ... 68 common frames omitted
미해결
배달앱 클론코딩 [with React Native]
우와요기이츠 배달앱을 누르자마자 그 즉시 꺼집니다. 이유를 알고 싶습니다.
해결됨
자바와 스프링 부트로 생애 최초 서버 만들기, 누구나 쉽게 개발부터 배포까지! [서버 개발 올인원 패키지]
안녕하세요. 질문이 있습니다, @Id @GeneratedValue(...) private Long id; 이렇게는 사용해봤는데 처음에 =null 을 사용하신 이유가 궁금합니다.
미해결
핸즈온 리액트 네이티브
AuthRoutes 부분을 못 읽는것 같습니다. 깃허브에 코드올린거 그대로 복붙해도 에러가 납니다. AuthRoutes 에 있는 SIGN_IN SIGN_UP 이부분이 에러가 납니다. 에러 메세지는 undefined is not an object (evaluating'_routes.AuthRoutes.SIGN_IN') 입니다.
해결됨
처음 배우는 리액트 네이티브
app.storage가 정의되어있지 않다고 뜨면서 Sign up이 되지 않습니다. 처음에 Firebase 버전이 안맞아서 계속 에러가 떠서 게시판에 검색 한 후에 강사님이 올려주신 코드를 참고하여 강의 코드와는 약간 다르게 수정하였는데, 그것때문인지는 몰라도 계속 같은 에러가 발생합니다. <2023.02.07 22:05 수정> const ref = app.storage().ref(`/profile/${user.uid}/photo/png`); 위 부분에 오타가 있어서 const ref = app.storage().ref(`/profile/${user.uid}/photo.png`); 이렇게 수정하였는데도 똑같이 오류가 납니다. 아래는 깃헙 주소입니다. https://github.com/frica12/React-native/tree/main/rn-chat 아래는 firebase.js 코드입니다. import { initializeApp } from "firebase/app"; import { getAuth, signInWithEmailAndPassword, createUserWithEmailAndPassword, } from "firebase/auth"; import config from "../firebase.json"; const app = initializeApp(config); const auth = getAuth(app); export const signin = async ({ email, password }) => { const { user } = await signInWithEmailAndPassword(auth, email, password); return user; }; const uploadImage = async (uri) => { if (uri.startsWith("https")) { return uri; } const blob = await new Promise((resolve, reject) => { const xhr = new XMLHttpRequest(); xhr.onload = function () { resolve(xhr.response); }; xhr.onerror = function () { reject(new TypeError("Network request failed")); }; xhr.responseType = "blob"; xhr.open("GET", uri, true); xhr.send(null); }); const user = auth.currentUser; const ref = app.storage().ref(`/profile/${user.uid}/photo/png`); const snapshot = await ref.put(blob, { contentType: "image/png" }); blob.close(); return await snapshot.ref.getDownloadURL(); }; export const signup = async ({ name, email, password, photo }) => { const { user } = await createUserWithEmailAndPassword(auth, email, password); const photoURL = await uploadImage(photo); await user.updateProfile({ displayName: name, photoURL }); };
해결됨
실전! 스프링 부트와 JPA 활용2 - API 개발과 성능 최적화
우선 2개의 질문을 참고하였습니다. 이것과 이것입니다. 두개의 글을 종합해 보면, V1에서 Order리스트를 반환할때는 Lazy방식이기 때문에 Member객체가 프록시 객체이고, Jackson이 해당 해당 객체를 접근하는 순간 초기화한다는 것입니다. 그리고 해당 프록시 객체를 JSON으로 읽을수 있도록 도와주는 것이 하이버네이트5모듈이라는 것입니다. 여기서 궁금한 점이 //강제 지연 로딩 설정 hibernate5Module.configure(Hibernate5Module.Feature.FORCE_LAZY_LOADING, true); 이 코드입니다. 해당 코드는 강제 지연 로딩 설정이라고 하는데 강의 21분 20초경 LAZY를 강제 초기화 한다고 나와있습니다. 저는 위의 코드와 for (Order order : orders) { order.getMember().getName(); order.getDelivery().getAddress(); } 이 코드가 같은 역할을 한다고 이해했습니다. 위의 두개의 코드를 삭제하면, 포스트맨으로 요청을 보냈을 때, Member, orderItems, Delivery에는 null 값이 들어갑니다. 두개의 코드중 하나를 넣으면 요청을 넣었을때 Member, orderItems, Delivery에 실제 값이 들어가게 됩니다. 하지만 위의 두 글을 종합한 내용을 보면 Jackson이 해당 해당 객체를 접근하는 순간 초기화 라는 내용이 있습니다. 그렇다면 이미 초기화 된 프록시 객체일텐데 왜 위의 강제초기화 코드를 넣어야 실제 값이 들어가게 되는지 궁금합니다. jackson이 프록시 객체에 접근할때 초기화가 되어서 두 코드를 넣지 않아도 null이 아닌 실제 값이 나와야하는 것 아닌가요? 글이 너무 길어 죄송합니다..ㅠㅠ
미해결
배달앱 클론코딩 [with React Native]
javac의 위치가 잘못된건가요??
미해결
배달앱 클론코딩 [with React Native]
FoodDeliveryApp에 들어간 후 npm run android를 통해 실행했지만 FoodDeliveryApp이 없습니다.
미해결
자바와 스프링 부트로 생애 최초 서버 만들기, 누구나 쉽게 개발부터 배포까지! [서버 개발 올인원 패키지]
안녕하세요. 선생님 따라서 코딩중인데 구글링결과대로 시도해봐도 딱히 해결되지 않아서 질문 남겼습니다... 제목 그대로 import 자체가 되지 않아요 ㅠ
미해결
자바 ORM 표준 JPA 프로그래밍 - 기본편
<요구사항> 사용자가 맘에 드는 장소를 저장 할 수 있다. Place 에서 FavoritePlace 를 Join 하고 싶다. <관계도> Place(1) - (N)FavoritePlace(N) - (1)User <질문내용> Place 에는 FavoritePlace 필드가 없기 때문에 join 을 사용 할 수 가 없어서 , 양방향 매핑을 이용 하였습니다. 이럴 경우 양방향 매핑을 사용하는것이 맞는지 궁금하고, FavoirtePlace 의 상태가 변경될때의,연관관계 편의메서드를 구현하였는데 흐름은 Place 가 가지고 있는 list 를 순회하여, 바뀌기전의 FavoirtePlace 를 삭제하고 새로운 FavoirtePlace 를 add 하는 로직을 선택하였습니다. 그러다보니 수많은 List 중 FavoirtePlace 하나를 순회하여 찾아 제거 하는 작업이 조금 버거울거같다는 고민이 생겼습니다. 제가 이해한 양방향을 써야 하는 상황이 이부분이 맞는지, 위와 같은 상황에서 어떻게 해결하는게 조금 더 현명할지 조언 듣고 싶습니다! 감사합니다
미해결
배달앱 클론코딩 [with React Native]
npx react-native init FoodDeliveryApp --template react-native-template-typescript를 치면 계속 이러한 에러메세지가 뜨면서 생성이 되지 않습니다. Command failed: yarn add react-native Usage Error: The nearest package directory (C:\Users\USER\AppData\Local\Temp\rncli-init-template-IJ9QGa) doesn't seem to be part of the project declared in C:\Users\USER. - If C:\Users\USER isn't intended to be a project, remove any yarn.lock and/or package.json file there. - If C:\Users\USER is intended to be a project, it might be that you forgot to list AppData/Local/Temp/rncli-init-template-IJ9QGa in its workspace configuration. - Finally, if C:\Users\USER is fine and you intend AppData/Local/Temp/rncli-init-template-IJ9QGa to be treated as a completely separate project (not even a workspace), create an empty yarn.lock file in it. $ yarn add [--json] [-E,--exact] [-T,--tilde] [-C,--caret] [-D,--dev] [-P,--peer] [-O,--optional] [--prefer-dev] [-i,--interactive] [--cached] [--mode #0] ... 않습니다.
미해결
자바와 스프링 부트로 생애 최초 서버 만들기, 누구나 쉽게 개발부터 배포까지! [서버 개발 올인원 패키지]
BookMemoryRepository랑 BookMysqlRepository에 @Repository를 모두 붙이면 빨간줄이 강의상에선 나는데 저는 이상이 없는 데 혹시 스프링 버전 차이인건지 궁금합니다.
해결됨
자바 ORM 표준 JPA 프로그래밍 - 기본편
학습하는 분들께 도움이 되고, 더 좋은 답변을 드릴 수 있도록 질문전에 다음을 꼭 확인해주세요. 1. 강의 내용과 관련된 질문을 남겨주세요. 2. 인프런의 질문 게시판과 자주 하는 질문(링크)을 먼저 확인해주세요. (자주 하는 질문 링크: https://bit.ly/3fX6ygx) 3. 질문 잘하기 메뉴얼(링크)을 먼저 읽어주세요. (질문 잘하기 메뉴얼 링크: https://bit.ly/2UfeqCG) 질문 시에는 위 내용은 삭제하고 다음 내용을 남겨주세요. ========================================= [질문 템플릿] 1. 강의 내용과 관련된 질문인가요? (예) 2. 인프런의 질문 게시판과 자주 하는 질문에 없는 내용인가요? (예) 3. 질문 잘하기 메뉴얼을 읽어보셨나요? (예) [질문 내용] Joincolumn의 name속성은 그저 member테이블의 조인컬럼의 컬럼명을 지정하는것뿐 team과 매핑하는것과는 관련이없다. member와 team을 연관관계맺는것은 referencedColumnName속성이 하지만 이것을 생략하면 자동으로 team의 pk값으로 연관관계를 맺어줘서 생략한다. 이게 맞을까요?