묻고 답해요
164만명의 커뮤니티!! 함께 토론해봐요.
인프런 TOP Writers
-
미해결[리뉴얼] React로 NodeBird SNS 만들기
quill editor 사용 이미지 업로드 질문 있습니다.
/back/routes/post const router = require('express').Router(); const multer = require('multer'); const fs = require('fs'); const path = require('path'); try { fs.accessSync('uploads'); } catch (error) { console.log('uploads 폴더가 없으므로 생성합니다.'); fs.mkdirSync('uploads'); } const upload = multer({ storage: multer.diskStorage({ destination: function (req, file, done) { done(null, 'uploads/'); }, // 이미지.png filename: function (req, file, cb) { const ext = path.extname(file.originalname); // 확장자 추출(.png) const basename = path.basename(file.originalname, ext); // 이미지 done(null, basename + new Data().getTime() + ext); // 이미지20210124.png }, }), limits: { fileSize: 20 * 1024 * 1024 }, // 파일크기: 20MB }); // 지금은 하드디스크에 저장하지만 AWS 배포 시 storage 옵션만 S3 서비스로 갈아끼울 예정 // POST /post/images router.post('/images', isLoggedIn, upload.array('image'), (req, res, next) => { console.log(req.files); // 업로드가 어떻게 됬는지 정보들이 담겨있음 res.json(req.files.map((v) => v.filename)); // 어디로 업로드 됬는지에 대한 파일명들을 프론트로 전송 }); // 먼저 파일명만 return 해준다. -> v.filename, 추후 배포 시 이미지는 지우지 않는다.(자산이다) 백엔드에서 multer를 이용해 이미지 업로드 시 upload라는 파일을 생성하고, multer를 통해 저장위치와 파일도 추출했습니다. 이후 POST /post/images 라우터에서 프론트의 key 값이 일치해야 파일을 가져오는데 1. 현재 quill editor를 사용, image file을 올리면 사진이 첨부되지 않고 요청에 대한 result를 받아오지 못합니다. (saga) 그런데 SUCCESS 까지는 잘 넘어갑니다. // saga post function uploadImagesAPI(data) { return axios.post(`/post/images`, data); // data: post.id } function* uploadImages(action) { try { const result = yield call(uploadImagesAPI, action.data); console.log('result', result); // yield delay(1000); yield put({ type: UPLOAD_IMAGES_SUCCESS, data: result.data, }); } catch (err) { yield put({ type: UPLOAD_IMAGES_FAILURE, error: err.response.data, }); } } 2. quill editor 사용법과 많은 코드들을 참고하여 작성한 로직입니다. //* quill text editor const QuillNoSSRWrapper = dynamic(import('react-quill'), { ssr: false, loading: () => <p>Loading ...</p>, }); const formats = [ 'header', 'font', 'size', 'bold', 'italic', 'underline', 'strike', 'blockquote', 'list', 'bullet', 'indent', 'link', 'image', 'video', ]; //* AddPost const AddPost = () => { const dispatch = useDispatch(); const { me, addPostError, imagePaths } = useSelector((state) => state.user); console.log('imagePaths', imagePaths); const [title, onChangeTitle] = useInput(''); const [category, setCategory] = useState(); const [content, setContent] = useState(''); const quillRef = useRef(); //* quill text editor const imageHandler = (e) => { console.log('에디터의 이미지 버튼을 클릭하면 이 핸들러가 시작됩니다.'); // true const input = document.createElement('input'); // 1. 이미지를 저장할 input type=file DOM을 만든다. // 속성 써주기 input.setAttribute('type', 'file'); input.setAttribute('accept', 'image/*'); input.click(); // 에디터 이미지버튼을 클릭하면 이 input이 클릭된다. input이 클릭되면 파일 선택창이 나타난다. input.addEventListener('change', async () => { console.log('onChange'); const file = input.files[0]; const imageFormData = new FormData(); // multer에 맞는 형식으로 데이터 만들어준다. [].forEach.call(file, (f) => { imageFormData.append('image', f); // formData는 키-밸류 구조 }); dispatch({ type: UPLOAD_IMAGES_REQUEST, data: imageFormData, }); }); }; //* quill text editor // useMemo를 사용한 이유는 modules가 렌더링마다 변하면 에디터에서 입력이 끊기는 버그가 발생 const modules = useMemo( () => ({ toolbar: { container: [ [{ header: [1, 2, false] }], ['bold', 'italic', 'underline', 'strike', 'blockquote'], [{ list: 'ordered' }, { list: 'bullet' }, { indent: '-1' }, { indent: '+1' }], ['link', 'image'], ['clean'], ], handlers: { image: imageHandler }, }, }), [], ); const onSubmit = useCallback( (e) => { e.preventDefault(); if (!title) { return alert('제목을 입력하세요'); } else if (!category) { return alert('카테고리를 설정하세요'); } else if (!content) { return alert('게시글을 작성하세요'); } const formData = new FormData(); imagePaths.forEach((p) => { formData.append('image', p); }); formData.append({ title: title, category: category, content: content }); // dispatch loadPostRequest dispatch({ type: ADD_POST_REQUEST, data: formData, }); // error 없으면 community 목록으로 이동 if (!addPostError) { Router.push('/community'); } }, [title, category, content], ); <QuillNoSSRWrapper ref={quillRef} modules={modules} formats={formats} theme="snow" placeholder={`${me?.nickname}님의 글을 입력해주세요`} value={content} onChange={setContent} /> 참고: https://github.com/ko7452/e-Library/tree/master/prepare 혹시 제가 quill editor를 잘못 사용하거나 이해를 못하는 듯 한데.. 조언 주실 수 있을까요?
-
미해결파이썬(Python) 기초부터 실무까지 part.1
10강 변수와 계산(실습-2) ex06 질문
10강 변수와 계산(실습-2) ex06 에 질문드립니다. 분을 구하는 함수 (time // 60) % 60 에서 왜 '% 60'을 써서 다시 60으로 나눈 나머지를 구하나요? 함수를 (time // 60)만 써도 몫이 '분'의 값으로 나오지않나요? 이해가 잘 되지 않습니다.
-
미해결Spring Cloud로 개발하는 마이크로서비스 애플리케이션(MSA)
비교적 최신 버전에서 에러가 발생합니다.
에러 내용을 자세하게 이해하진 못했지만 사용중인 임베디드 톰캣 버전에서 `hasIpAddress` 를 찾지 못하는 것 같습니다.스프링 버전은 2.6.2 사용중이고, starter-security 그대로 사용하고 있습니다. `hasIpAddress` 대신 다른 메서드를 사용하면 가능은 한데 의도한 것과 다른 것 같아서 남깁니다. java.lang.UnsupportedOperationException: public abstract java.lang.String javax.servlet.ServletRequest.getRemoteAddr() is not supported at org.springframework.security.web.FilterInvocation$UnsupportedOperationExceptionInvocationHandler.invoke(FilterInvocation.java:326) ~[spring-security-web-5.6.1.jar:5.6.1] at com.sun.proxy.$Proxy150.getRemoteAddr(Unknown Source) ~[na:na] at javax.servlet.ServletRequestWrapper.getRemoteAddr(ServletRequestWrapper.java:241) ~[tomcat-embed-core-9.0.56.jar:4.0.FR] at org.springframework.security.web.util.matcher.IpAddressMatcher.matches(IpAddressMatcher.java:65) ~[spring-security-web-5.6.1.jar:5.6.1]
-
미해결시스템엔지니어가 알려주는 리눅스 실전편 Bash Shell Script
macOS Monterey 12.1 에서 Vagrant 설치 오류 해결한 방법 적습니다.
Mac OS Monterey 12.1 에서 서버 구축 스크립트가 정상적으로 실행 안되는 문제가 있음 Mac Os Monterey 12.1에서 Virtual Box의 Headless 설정 불가능 Vagrantfile에서 v.gui = true 로 수정 반드시 6.1.30 이상의 VirtualBox를 설치 할 것. v.gui = true 수정 시 Virtual Box의 Verision이 6.1.30 이하라면 Mac이 알수 없는 오류로 재시작 됨. 손쉬운 사용에 VirtualBox 권한을 추가할 것 시스템 환경설정 → 보안 및 개인 정보 보호 → 손쉬운 사용 오른쪽에 VirtualBox를 추가 할 것 https://superuser.com/questions/1683747/vagrant-virtualbox-not-working-after-upgrading-to-monterey https://www.virtualbox.org/ticket/20636 Mac OS Monterey 12.1 VirtualBox 6.1.32 vagrant 2.2.14 이거 실행 시키느라 하루종일 삽질해서 다른분들은 그러지 마시라고 올립니다. 환경이 달라서 안될 수 도 있는데 저는 이렇게 겨우 작동시켰네요. 이제 다시 수업들으러 갑니다.
-
미해결만들면서 배우는 리액트 : 기초
15강에서 props 로 function 을 넘겨주는 코드 문의 드립니다
- 학습 관련 질문을 남겨주세요. 상세히 작성하면 더 좋아요! - 먼저 유사한 질문이 있었는지 검색해보세요. - 서로 예의를 지키며 존중하는 문화를 만들어가요. - 잠깐! 인프런 서비스 운영 관련 문의는 1:1 문의하기를 이용해주세요. Form 컴포넌트에 선언되어 있던 handleFormSubmit() 을 App 컴포넌트로 이동 후 Form 컴포넌트로 handleFormSubmit() 를 넘겨 주기 위해서 다음과 같이 코드를 작성하는데요. const Form = ({ handleFormSubmit }) => { return ( <form onSubmit={handleFormSubmit}> <input type="text" name="name" placeholder="영어 대사를 입력해주세요" /> <button type="submit">생성</button> </form> ) } props 로 handleFormSubmit 형태로 넘겨주지 않고 {handleFormSubmit} 형태로 넘겨주는 이유는 무엇인가요? ( {..} 형태는 html tag 시 react 의 표현식을 넘겨줄 때 사용하는 것으로 이해하고 있었습니다 )
-
미해결[신규 개정판] 이것이 진짜 크롤링이다 - 실전편 (인공지능 수익화)
don flag달지 않고 그냥 if 문을 두번 써도 되네요
- 학습 관련 질문을 남겨주세요. 상세히 작성하면 더 좋아요! - 먼저 유사한 질문이 있었는지 검색해보세요. - 서로 예의를 지키며 존중하는 문화를 만들어가요. - 잠깐! 인프런 서비스 운영 관련 문의는 1:1 문의하기를 이용해주세요. if rank > 100: break if rank > 100: print("100개가 출력되었음") break 로만 써도 되네요.
-
미해결[신규 개정판] 이것이 진짜 크롤링이다 - 실전편 (인공지능 수익화)
product_price = soup.selet_one("span.total-price>strong").text에서 'NoneType' object is not callable
- 학습 관련 질문을 남겨주세요. 상세히 작성하면 더 좋아요! - 먼저 유사한 질문이 있었는지 검색해보세요. - 서로 예의를 지키며 존중하는 문화를 만들어가요. - 잠깐! 인프런 서비스 운영 관련 문의는 1:1 문의하기를 이용해주세요. 검색어는 usb허브였습니다. try except도 해봤는데 모든 상품 가격이 모두 0원으로 나옵니다. 개발자 도구에서 확인했는데 "span.total-price>strong"가 맞습니다. 전체 두개 밖에 없는게 맞구요. 어쩄든 오류가 나는데 해결방안이 보이지 않습니다.
-
미해결실전! 스프링 부트와 JPA 활용1 - 웹 애플리케이션 개발
IntelliJ - html에서 resources/static 경로 링크 관련 문의
안녕하세요. 구글링과 커뮤니티 검색을 계속 했는데 결국 답을 못찾아서 질문 남깁니다. "홈 화면과 레이아웃" 챕터에서 header.html에 보면 css가 link되어 있는데,소스에 있는 대로 "/css/bootstrap.min.css" 하면 프로그램은 정상동작이 잘 됩니다. 하지만, Intellij에서는 "Cannot resolve directory 'css'" warning이 나오고, 이 메시지를 없애기 위해 "/static/css/bootstrap.min.css"로 변경을 하면 당연히 프로그램 실행시 css를 못찾게 됩니다. 프로그램 실행에는 문제가 없지만, IntelliJ를 사용하여 효과적으로 개발하기 위해 해당 내용을 꼭 수정하고 싶어서 문의드립니다. 영한님 강의영상에선 제대로 연결이 되어 있는 것 같아서요. (강의영상 17:45) 환경 : IntelliJ IDEA 2021.3.1 (Ultimate Edition) 화면 캡처
-
해결됨[C++과 언리얼로 만드는 MMORPG 게임 개발 시리즈] Part1: C++ 프로그래밍 입문
c++공부 방법에 관해서...
덕분에 c++강의 잘 듣고 있지만 요즘 고민이 있어서, 한가지 여쭤보고자 합니다. 이전에 '포인터' 때문에 많이 애를 먹었는데, '클래스' 파트로 들어오고나니 더 힘들더군요 ㅜㅜ 이부분이 지루하고 많이들 어렵다고 하지만, 막상 처음 겪게 되니 요즘 공부하면서 멘탈에 금이가기 시작 하더군요... 혹시 이런 어려운 파트들은 어떻게 극복할 수 있는지 팁좀 알려 주실 수 있을까요?
-
해결됨[C#과 유니티로 만드는 MMORPG 게임 개발 시리즈] Part4: 게임 서버
JobQueue Flush함수 질문있습니다.
jobQueue에 데이터를 넣고 뺄 때 lock을 걸어야하는 것은 이해가 되는데 action에 데이터를 넘겨받고서는 lock이 풀린상황이니 invoke하기 전에 다른 스레드가 action을 바꿔치는 경우도 가능하지 않을까 하는 생각이 들어서 질문드립니다.
-
미해결비전공자를 위한 진짜 입문 올인원 개발 부트캠프
defaultformatter이 오류가 떠요
editor.defaultformatter 부분에서 오류가 떠서 밑줄이 쳐지는 거 같은데 왜 이런 오류가 뜨는지 설명해주시면 좋겠습니다.
-
해결됨실전! Querydsl
QueryProjection 수동으로 만들면 어떨까요?
안녕하세요! 초보개발자 명아주입니다. QueryProejction 사용 시, DTO가 QueryDSL 에 의존적인게 단점이라고 하셨습니다. 그 외에는 컴파일 레벨에서 체크할 수 있다는게 정말 큰 장점인 것 같습니다. 그래서 혹시 의존성을 갖지 않으면서 이걸 사용할 방법이 없을까? 라는 의문으로 한가지 테스트를 해보고 찾은 해결 방법은 CustomQUserDto 를 직접 만들어서 쓰면 어떨까 싶습니다. CustomQUserDto는 레포지토리 계층에서만 쓰고, 반환값은 UserDto로 나가니까 서비스에서는 CustomQUserDto를 몰라도 상관이 없을것 같다고 생각했습니다. package study.querydsl.repository.dto;import com.querydsl.core.types.ConstructorExpression;import com.querydsl.core.types.Expression;import com.querydsl.dto.UserDto;public class CustomQUserDto extends ConstructorExpression<UserDto> { public CustomQUserDto(Expression<String> name, Expression<Integer> age) { super(UserDto.class, new Class<?>[]{String.class, int.class}, name, age); //혹은 심플하게 super(UserDto.class, name, age); 라고 해도 됩니다. }} 샘플코드는 자동생성된 QMemberDto를 참고해서 이렇게 짜봤습니다. serialVersionUID는 어떻게 처리해야될지 몰라서 없앴고 없어도 테스트 상에서는 문제없었습니다. @Testpublic void findUserDtoByManualQueryProjection() throws Exception { //given //when List<UserDto> result = query .select(new CustomQUserDto(member.username, member.age)) .from(member) .fetch(); //then for (UserDto userDto : result) { System.out.println("userDto = " + userDto); }} 위처럼 테스트를 진행해봤을때 정상적으로 동작하는걸 확인했는데요. 혹시 이런식으로 QueryProjectionDto를 수동으로 만들어서 사용하시는 경우가 있으신지 궁금합니다. 감사합니다. 명아주 드림 새해 복많이 받으세요~~~~ p.s 한가지 질문드리고 싶은점이 있는데, 강의들으면서 따라 치는 코드를 깃허브에 올리고 있는데 혹시 문제가 된다면 비공개 레포로 변경하려고 합니다. 답변 주시는 대로 원하시는대로 처리하겠습니다!
-
미해결실전! 스프링 데이터 JPA
count query
안녕하세요 개발자님 스프링 커리큘럼 수강중인 학생입니다. 다름이 아니라 수업중 헷갈리는 부분이 있어 질문드립니다. 제가 알기로는 일대다 관계에서 left join을 하면 데이터가 뻥튀기(?) 된다고 알고 있는데 이때 join을 안하고 count쿼리를 따로 날리면 의도한 갯수가 안나올것 같다는 생각이 들었습니다. 그럼 team을 기준으로 left join을 할때는 count query를 따로 사용하면 안되는게 맞나요?? 제가 잘 이해한건지 궁금합니다. 글 읽어주셔 감사합니다. 좋은하루 되십시오
-
미해결스프링 핵심 원리 - 기본편
@Autowired 필드 명, @Qualifier에 관해서
강의 @Autowired필드 명, @Qualifier, @Primary 강의와 관련하여 질문 드립니다. 강의에서는 앞선 강의에서 보여주신 lombok을 사용하시지 않고 생성자를 만들어 코드를 작성해주셨는데 @Component@RequiredArgsConstructor public class OrderServiceImpl implements OrderService{ private final MemberRepository memberRepository; private final DiscountPolicy discountPolicy; 위와 같이 lombok 라이브러리를 사용한 코드에서는 @Autowired 필드 명과 @Qualifier 선언을 어떤식으로 해야하나요?
-
미해결스프링 핵심 원리 - 기본편
IllegalAccessError 오류, .NoSuchBeanDefinitionException오류 질문입니다.
[질문 템플릿]1. 강의 내용과 관련된 질문인가요? (예/아니오)2. 인프런의 질문 게시판과 자주 하는 질문에 없는 내용인가요? (예/아니오)3. 질문 잘하기 메뉴얼을 읽어보셨나요? (예/아니오)[질문 내용] 2가지 오류는 다음과 같습니다. 1. AutoAppConfigTest 의 basicScan() 오류 2. componentFilterAppConfigtest의 filterScan()오류 1번째 질문 basicScan() 오류 package javaSpring.Spring.scan;import javaSpring.Spring.Member.InterFace.MemberRepository;import javaSpring.Spring.Member.InterFace.MemberService;import javaSpring.Spring.Order.AutoAppConfig;import javaSpring.Spring.Order.OrderServiceImpl;import org.assertj.core.api.Assertions;import org.junit.jupiter.api.Test;import org.springframework.context.annotation.AnnotationConfigApplicationContext;public class AutoAppConfigTest { @Test void basicScan(){ AnnotationConfigApplicationContext ac = new AnnotationConfigApplicationContext(AutoAppConfig.class); MemberService memberService = ac.getBean(MemberService.class); Assertions.assertThat(memberService).isInstanceOf(MemberService.class); OrderServiceImpl bean = ac.getBean(OrderServiceImpl.class); MemberRepository memberRepository = bean.getMemberRepository(); System.out.println("memberRepository = " + memberRepository); }} 20:49:03.286 [main] DEBUG org.springframework.context.annotation.AnnotationConfigApplicationContext - Refreshing org.springframework.context.annotation.AnnotationConfigApplicationContext@15eebbff 20:49:03.286 [main] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Creating shared instance of singleton bean 'org.springframework.context.annotation.internalConfigurationAnnotationProcessor' 20:49:03.313 [main] DEBUG org.springframework.context.annotation.ClassPathBeanDefinitionScanner - Identified candidate component class: file [C:\Users\wh361\IdeaProjects\Spring\out\production\classes\javaSpring\Spring\Order\OrderServiceImpl.class] 20:49:03.327 [main] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Creating shared instance of singleton bean 'org.springframework.context.event.internalEventListenerProcessor' 20:49:03.328 [main] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Creating shared instance of singleton bean 'org.springframework.context.event.internalEventListenerFactory' 20:49:03.328 [main] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Creating shared instance of singleton bean 'org.springframework.context.annotation.internalAutowiredAnnotationProcessor' 20:49:03.328 [main] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Creating shared instance of singleton bean 'org.springframework.context.annotation.internalCommonAnnotationProcessor' 20:49:03.329 [main] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Creating shared instance of singleton bean 'autoAppConfig' 20:49:03.329 [main] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Creating shared instance of singleton bean 'orderServiceImpl' 20:49:03.340 [main] WARN org.springframework.context.annotation.AnnotationConfigApplicationContext - Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'orderServiceImpl' defined in file [C:\Users\wh361\IdeaProjects\Spring\out\production\classes\javaSpring\Spring\Order\OrderServiceImpl.class]: Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'javaSpring.Spring.Member.InterFace.MemberRepository' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {} org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'orderServiceImpl' defined in file [C:\Users\wh361\IdeaProjects\Spring\out\production\classes\javaSpring\Spring\Order\OrderServiceImpl.class]: Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'javaSpring.Spring.Member.InterFace.MemberRepository' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {} at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:800) at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:229) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1372) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1222) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:582) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:542) at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208) at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:953) at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:918) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:583) at org.springframework.context.annotation.AnnotationConfigApplicationContext.<init>(AnnotationConfigApplicationContext.java:93) at javaSpring.Spring.scan.AutoAppConfigTest.basicScan(AutoAppConfigTest.java:15) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:566) at org.junit.platform.commons.util.ReflectionUtils.invokeMethod(ReflectionUtils.java:725) at org.junit.jupiter.engine.execution.MethodInvocation.proceed(MethodInvocation.java:60) at org.junit.jupiter.engine.execution.InvocationInterceptorChain$ValidatingInvocation.proceed(InvocationInterceptorChain.java:131) at org.junit.jupiter.engine.extension.TimeoutExtension.intercept(TimeoutExtension.java:149) at org.junit.jupiter.engine.extension.TimeoutExtension.interceptTestableMethod(TimeoutExtension.java:140) at org.junit.jupiter.engine.extension.TimeoutExtension.interceptTestMethod(TimeoutExtension.java:84) at org.junit.jupiter.engine.execution.ExecutableInvoker$ReflectiveInterceptorCall.lambda$ofVoidMethod$0(ExecutableInvoker.java:115) at org.junit.jupiter.engine.execution.ExecutableInvoker.lambda$invoke$0(ExecutableInvoker.java:105) at org.junit.jupiter.engine.execution.InvocationInterceptorChain$InterceptedInvocation.proceed(InvocationInterceptorChain.java:106) at org.junit.jupiter.engine.execution.InvocationInterceptorChain.proceed(InvocationInterceptorChain.java:64) at org.junit.jupiter.engine.execution.InvocationInterceptorChain.chainAndInvoke(InvocationInterceptorChain.java:45) at org.junit.jupiter.engine.execution.InvocationInterceptorChain.invoke(InvocationInterceptorChain.java:37) at org.junit.jupiter.engine.execution.ExecutableInvoker.invoke(ExecutableInvoker.java:104) at org.junit.jupiter.engine.execution.ExecutableInvoker.invoke(ExecutableInvoker.java:98) at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.lambda$invokeTestMethod$7(TestMethodTestDescriptor.java:214) at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73) at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.invokeTestMethod(TestMethodTestDescriptor.java:210) at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.execute(TestMethodTestDescriptor.java:135) at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.execute(TestMethodTestDescriptor.java:66) at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$6(NodeTestTask.java:151) at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73) at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:141) at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:137) at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$9(NodeTestTask.java:139) at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73) at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:138) at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:95) at java.base/java.util.ArrayList.forEach(ArrayList.java:1541) at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(SameThreadHierarchicalTestExecutorService.java:41) at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$6(NodeTestTask.java:155) at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73) at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:141) at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:137) at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$9(NodeTestTask.java:139) at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73) at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:138) at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:95) at java.base/java.util.ArrayList.forEach(ArrayList.java:1541) at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(SameThreadHierarchicalTestExecutorService.java:41) at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$6(NodeTestTask.java:155) at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73) at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:141) at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:137) at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$9(NodeTestTask.java:139) at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73) at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:138) at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:95) at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.submit(SameThreadHierarchicalTestExecutorService.java:35) at org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor.execute(HierarchicalTestExecutor.java:57) at org.junit.platform.engine.support.hierarchical.HierarchicalTestEngine.execute(HierarchicalTestEngine.java:54) at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:107) at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:88) at org.junit.platform.launcher.core.EngineExecutionOrchestrator.lambda$execute$0(EngineExecutionOrchestrator.java:54) at org.junit.platform.launcher.core.EngineExecutionOrchestrator.withInterceptedStreams(EngineExecutionOrchestrator.java:67) at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:52) at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:114) at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:86) at org.junit.platform.launcher.core.DefaultLauncherSession$DelegatingLauncher.execute(DefaultLauncherSession.java:86) at org.junit.platform.launcher.core.SessionPerRequestLauncher.execute(SessionPerRequestLauncher.java:53) at com.intellij.junit5.JUnit5IdeaTestRunner.startRunnerWithArgs(JUnit5IdeaTestRunner.java:71) at com.intellij.rt.junit.IdeaTestRunner$Repeater$1.execute(IdeaTestRunner.java:38) at com.intellij.rt.execution.junit.TestsRepeater.repeat(TestsRepeater.java:11) at com.intellij.rt.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:35) at com.intellij.rt.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:235) at com.intellij.rt.junit.JUnitStarter.main(JUnitStarter.java:54) Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'javaSpring.Spring.Member.InterFace.MemberRepository' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {} at org.springframework.beans.factory.support.DefaultListableBeanFactory.raiseNoMatchingBeanFound(DefaultListableBeanFactory.java:1799) at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1355) at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1309) at org.springframework.beans.factory.support.ConstructorResolver.resolveAutowiredArgument(ConstructorResolver.java:887) at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:791) ... 83 more 으로 . orderServiceImpl의 bean을 생성할수 없는? 찾을 수없는 ? NoSuchBeanDefinitionException 오류가 나옵니다. 어디 Bena설정을 놓친걸까요 2번째 filterScan 오류입니다. package javaSpring.Spring.scan.filter;import org.assertj.core.api.Assertions;import org.junit.jupiter.api.Test;import org.springframework.beans.factory.NoSuchBeanDefinitionException;import org.springframework.context.ApplicationContext;import org.springframework.context.annotation.AnnotationConfigApplicationContext;import org.springframework.context.annotation.ComponentScan;import org.springframework.context.annotation.Configuration;import org.springframework.context.annotation.FilterType;import static org.junit.jupiter.api.Assertions.*;public class componentFilterAppConfigTest { @Test void filterScan() { ApplicationContext ac = new AnnotationConfigApplicationContext(ComponentFilterAppConfig.class); BeanA beanA = ac.getBean("beanA", BeanA.class); Assertions.assertThat(beanA).isNotNull(); org.junit.jupiter.api.Assertions.assertThrows( NoSuchBeanDefinitionException.class, () -> ac.getBean("beanB", BeanB.class)); } @Configuration @ComponentScan( includeFilters = @ComponentScan.Filter(type = FilterType.ANNOTATION, classes = MyIncludeComponent.class), excludeFilters = @ComponentScan.Filter(type = FilterType.ANNOTATION, classes = MyExcludeComponent.class) ) static class ComponentFilterAppConfig { }} 20:49:03.386 [main] DEBUG org.springframework.context.annotation.AnnotationConfigApplicationContext - Refreshing org.springframework.context.annotation.AnnotationConfigApplicationContext@5cc126dc 20:49:03.386 [main] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Creating shared instance of singleton bean 'org.springframework.context.annotation.internalConfigurationAnnotationProcessor' 20:49:03.390 [main] DEBUG org.springframework.context.annotation.ClassPathBeanDefinitionScanner - Identified candidate component class: file [C:\Users\wh361\IdeaProjects\Spring\out\test\classes\javaSpring\Spring\scan\filter\BeanA.class] org.springframework.cglib.core.CodeGenerationException: java.lang.IllegalAccessError-->class $javaSpring.Spring.scan.filter.componentFilterAppConfigTest$ComponentFilterAppConfig$$EnhancerBySpringCGLIB$$f7f7f95c cannot access its superclass javaSpring.Spring.scan.filter.componentFilterAppConfigTest$ComponentFilterAppConfig ($javaSpring.Spring.scan.filter.componentFilterAppConfigTest$ComponentFilterAppConfig$$EnhancerBySpringCGLIB$$f7f7f95c and javaSpring.Spring.scan.filter.componentFilterAppConfigTest$ComponentFilterAppConfig are in unnamed module of loader 'app') at org.springframework.cglib.core.ReflectUtils.defineClass(ReflectUtils.java:558) at org.springframework.cglib.core.AbstractClassGenerator.generate(AbstractClassGenerator.java:363) at org.springframework.cglib.proxy.Enhancer.generate(Enhancer.java:585) at org.springframework.cglib.core.AbstractClassGenerator$ClassLoaderData$3.apply(AbstractClassGenerator.java:110) at org.springframework.cglib.core.AbstractClassGenerator$ClassLoaderData$3.apply(AbstractClassGenerator.java:108) at org.springframework.cglib.core.internal.LoadingCache$2.call(LoadingCache.java:54) at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) at org.springframework.cglib.core.internal.LoadingCache.createEntry(LoadingCache.java:61) at org.springframework.cglib.core.internal.LoadingCache.get(LoadingCache.java:34) at org.springframework.cglib.core.AbstractClassGenerator$ClassLoaderData.get(AbstractClassGenerator.java:134) at org.springframework.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java:319) at org.springframework.cglib.proxy.Enhancer.createHelper(Enhancer.java:572) at org.springframework.cglib.proxy.Enhancer.createClass(Enhancer.java:419) at org.springframework.context.annotation.ConfigurationClassEnhancer.createClass(ConfigurationClassEnhancer.java:137) at org.springframework.context.annotation.ConfigurationClassEnhancer.enhance(ConfigurationClassEnhancer.java:109) at org.springframework.context.annotation.ConfigurationClassPostProcessor.enhanceConfigurationClasses(ConfigurationClassPostProcessor.java:447) at org.springframework.context.annotation.ConfigurationClassPostProcessor.postProcessBeanFactory(ConfigurationClassPostProcessor.java:268) at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:325) at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:147) at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:746) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:564) at org.springframework.context.annotation.AnnotationConfigApplicationContext.<init>(AnnotationConfigApplicationContext.java:93) at javaSpring.Spring.scan.filter.componentFilterAppConfigTest.filterScan(componentFilterAppConfigTest.java:19) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:566) at org.junit.platform.commons.util.ReflectionUtils.invokeMethod(ReflectionUtils.java:725) at org.junit.jupiter.engine.execution.MethodInvocation.proceed(MethodInvocation.java:60) at org.junit.jupiter.engine.execution.InvocationInterceptorChain$ValidatingInvocation.proceed(InvocationInterceptorChain.java:131) at org.junit.jupiter.engine.extension.TimeoutExtension.intercept(TimeoutExtension.java:149) at org.junit.jupiter.engine.extension.TimeoutExtension.interceptTestableMethod(TimeoutExtension.java:140) at org.junit.jupiter.engine.extension.TimeoutExtension.interceptTestMethod(TimeoutExtension.java:84) at org.junit.jupiter.engine.execution.ExecutableInvoker$ReflectiveInterceptorCall.lambda$ofVoidMethod$0(ExecutableInvoker.java:115) at org.junit.jupiter.engine.execution.ExecutableInvoker.lambda$invoke$0(ExecutableInvoker.java:105) at org.junit.jupiter.engine.execution.InvocationInterceptorChain$InterceptedInvocation.proceed(InvocationInterceptorChain.java:106) at org.junit.jupiter.engine.execution.InvocationInterceptorChain.proceed(InvocationInterceptorChain.java:64) at org.junit.jupiter.engine.execution.InvocationInterceptorChain.chainAndInvoke(InvocationInterceptorChain.java:45) at org.junit.jupiter.engine.execution.InvocationInterceptorChain.invoke(InvocationInterceptorChain.java:37) at org.junit.jupiter.engine.execution.ExecutableInvoker.invoke(ExecutableInvoker.java:104) at org.junit.jupiter.engine.execution.ExecutableInvoker.invoke(ExecutableInvoker.java:98) at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.lambda$invokeTestMethod$7(TestMethodTestDescriptor.java:214) at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73) at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.invokeTestMethod(TestMethodTestDescriptor.java:210) at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.execute(TestMethodTestDescriptor.java:135) at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.execute(TestMethodTestDescriptor.java:66) at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$6(NodeTestTask.java:151) at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73) at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:141) at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:137) at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$9(NodeTestTask.java:139) at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73) at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:138) at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:95) at java.base/java.util.ArrayList.forEach(ArrayList.java:1541) at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(SameThreadHierarchicalTestExecutorService.java:41) at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$6(NodeTestTask.java:155) at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73) at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:141) at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:137) at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$9(NodeTestTask.java:139) at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73) at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:138) at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:95) at java.base/java.util.ArrayList.forEach(ArrayList.java:1541) at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(SameThreadHierarchicalTestExecutorService.java:41) at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$6(NodeTestTask.java:155) at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73) at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:141) at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:137) at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$9(NodeTestTask.java:139) at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73) at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:138) at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:95) at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.submit(SameThreadHierarchicalTestExecutorService.java:35) at org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor.execute(HierarchicalTestExecutor.java:57) at org.junit.platform.engine.support.hierarchical.HierarchicalTestEngine.execute(HierarchicalTestEngine.java:54) at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:107) at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:88) at org.junit.platform.launcher.core.EngineExecutionOrchestrator.lambda$execute$0(EngineExecutionOrchestrator.java:54) at org.junit.platform.launcher.core.EngineExecutionOrchestrator.withInterceptedStreams(EngineExecutionOrchestrator.java:67) at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:52) at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:114) at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:86) at org.junit.platform.launcher.core.DefaultLauncherSession$DelegatingLauncher.execute(DefaultLauncherSession.java:86) at org.junit.platform.launcher.core.SessionPerRequestLauncher.execute(SessionPerRequestLauncher.java:53) at com.intellij.junit5.JUnit5IdeaTestRunner.startRunnerWithArgs(JUnit5IdeaTestRunner.java:71) at com.intellij.rt.junit.IdeaTestRunner$Repeater$1.execute(IdeaTestRunner.java:38) at com.intellij.rt.execution.junit.TestsRepeater.repeat(TestsRepeater.java:11) at com.intellij.rt.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:35) at com.intellij.rt.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:235) at com.intellij.rt.junit.JUnitStarter.main(JUnitStarter.java:54) Caused by: java.lang.IllegalAccessError: class $javaSpring.Spring.scan.filter.componentFilterAppConfigTest$ComponentFilterAppConfig$$EnhancerBySpringCGLIB$$f7f7f95c cannot access its superclass javaSpring.Spring.scan.filter.componentFilterAppConfigTest$ComponentFilterAppConfig ($javaSpring.Spring.scan.filter.componentFilterAppConfigTest$ComponentFilterAppConfig$$EnhancerBySpringCGLIB$$f7f7f95c and javaSpring.Spring.scan.filter.componentFilterAppConfigTest$ComponentFilterAppConfig are in unnamed module of loader 'app') at java.base/java.lang.ClassLoader.defineClass1(Native Method) at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1017) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:566) at org.springframework.cglib.core.ReflectUtils.defineClass(ReflectUtils.java:555) ... 91 more .IllegalAccessError는 구글 서칭시 클래스 정의가 호환되지 않는 경우라는데 어떤 부분이 잘못되서 에러가 나는지 모르겠습니다! https://drive.google.com/file/d/1rENJ6HVxvEtirFpFj9OdwiuGMcoVYG8x/view?usp=sharing
-
미해결[왕초보편] 앱 8개를 만들면서 배우는 안드로이드 코틀린(Android Kotlin)
버튼 background 칼라 색깔이 여전히 보라색입니다.
(사진)
-
미해결따라하며 배우는 노드, 리액트 시리즈 - 쇼핑몰 사이트 만들기[전체 리뉴얼]
sign up 회원가입 문제
-
미해결따라하며 배우는 노드, 리액트 시리즈 - 쇼핑몰 사이트 만들기[전체 리뉴얼]
sing up 회원가입이 안되요
에러코드 입니다.
-
미해결[백문이불여일타] 데이터 분석을 위한 기초 SQL
문자에 따음표 안써도 되는건가요?
문자에 따음표 안써도 되는건가요? ROUND('LONG_W', 4)로 하면 안되긴 하더라구요! 쓰는 경우와 아닌 경우를 알고싶습니다
-
미해결프로그래밍 시작하기 : 파이썬 입문 (Inflearn Original)
멀티라인 오류
안녕하세요 멀티라인 입력과정에서 동일하게 작성했는데 오류가 나옵니다. 이럴땐 어떻게 해야 하나요?