묻고 답해요
164만명의 커뮤니티!! 함께 토론해봐요.
인프런 TOP Writers
-
미해결스프링 핵심 원리 - 기본편
@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)
멀티라인 오류
안녕하세요 멀티라인 입력과정에서 동일하게 작성했는데 오류가 나옵니다. 이럴땐 어떻게 해야 하나요?
-
미해결스프링 MVC 1편 - 백엔드 웹 개발 핵심 기술
@PathVariable 사용 질문
[질문 템플릿]1. 강의 내용과 관련된 질문인가요? (예/)2. 인프런의 질문 게시판과 자주 하는 질문에 없는 내용인가요? (예/)3. 질문 잘하기 메뉴얼을 읽어보셨나요? (예/)[질문 내용]안녕하세요! PathVariable을 사용하다 궁금한 점이 생겨 질문 남깁니다. 변수명과 원하는 name 설정이 같으면 생략할 수 있다고 하셨는데 이를 테스트 코드로 작성 시 오류가 발생합니다. (포스트맨으로 실행 시 성공..) Controller @ResponseBody @GetMapping("/test/{id}") public void test(@PathVariable Long id) { ... } Test Code @Test public void 테스트_코드() throws Exception { Long id = 1L; mvc.perform(get("/test/" + id)) .andExpect(status().isOk()); } Error org.springframework.web.util.NestedServletException: Request processing failed; java.lang.IllegalArgumentException: Name for argument type [java.lang.Long] not available, and parameter name information not found in class file either. 제가 조사한 바로는 아래와 같은데 (Spring 공식 문서 일부) The matching of method parameter names to URI Template variable names can only be done if your code is compiled with debugging enabled. If you do have not debugging enabled, you must specify the name of the URI Template variable name to bind to in the @PathVariable annotation. debugging enabled한 compile이라는걸 이해할 수 없어 질문 납겨봅니다ㅠ.ㅠ 답변 남겨주시면 감사합니다.
-
미해결자바(Java) 알고리즘 문제풀이 입문: 코딩테스트 대비
뒤집은 소수 문제 런타임 오류 문의드립니다.
선생님 안녕하세요. 런타임 관련하여 오류가 발생해서 문의드립니다. 코드는 아래와 같이 작성하였는데(수업 듣기 전 먼저 풀어봤습니다.) 런타임에러가 자꾸나서요.. 테스트 케이스 1번은 통과하는데 다른 테스트 케이스를 확인할 수 없어, 어디서 오류가 났는지 확인하기가 어렵습니다.. 테스트 케이스를 알려주시면 스스로 고쳐보겠습니다. 좋은 강의 감사합니다. import java.util.*;public class Main { public ArrayList<Integer> solution(int n, int[] arr) { ArrayList<Integer> primeNumbers = new ArrayList<>(); int max = findMax(arr); int[] sieve = createSieve(max, arr); // 판별시작 for (int i = 0; i < n; i++) { int reversedNumber = reverseThis(arr[i]); if (sieve[reversedNumber] == 0) { // 뒤집은 수가 소수라면 배열에 추가 primeNumbers.add(reversedNumber); } } return primeNumbers; } private Integer reverseThis(int number) { int reversedNumber = 0; // 숫자 -> 문자열 valueOf -> 다시 숫자 parseInt String strNumber = String.valueOf(number); for (int i = strNumber.length() - 1; i >= 0; i--) { char x = strNumber.charAt(i); reversedNumber = reversedNumber * 10 + Integer.parseInt(String.valueOf(x)); } return reversedNumber; } private int[] createSieve(int max, int[] arr) { int[] sieve = new int[max + 1]; sieve[0] = sieve[1] = 1; // 0과 1은 소수가 아님 for (int i = 2; i <= max; i++) { if (sieve[i] == 0) { for (int j = i * 2; j <= max; j = j + i) { // sieve[i]는 그대로 0으로 남겨둠 sieve[j] = 1; } } } return sieve; } private int findMax(int[] arr) { int max = Integer.MIN_VALUE; for (int x : arr) { if (x > max) { max = x; } } return max; } // max 찾기 // 체 생성 // 뒤집기 함수 public static void main(String[] args) { Main T = new Main(); Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int[] arr = new int[n]; for (int i = 0; i < n; i++) { arr[i] = sc.nextInt(); } for (int x : T.solution(n, arr)) { System.out.print(x + " "); } }}
-
미해결스프링 MVC 2편 - 백엔드 웹 개발 활용 기술
field-error가 안뜨네요..
redirect랑 log가 되는 걸로 봐서는 controller는 작동하는 듯한데 field-error가 안뜨네요ㅜ 계속 pdf랑 영상 다시 보면서 차이점 찾고있는데 못찾겠어서 질문남깁니다..
-
해결됨스프링 MVC 1편 - 백엔드 웹 개발 핵심 기술
@ResponseBody인 경우의 실행흐름이 궁금합니다.
안녕하세요. 항상 좋은 강의 감사합니다. 다름이 아니라 제가 정확히 이해가 안 가는 부분이 있어서 질문드립니다. @responseBody 애노테이션이 붙은 컨트롤러의 메서드는 다음과 같이 실행된다고 이해했습니다. Controller가 Http 메시지 바디에 쓸 내용 return -> ReturnValueHandler 의 구현체 중 RequestResponseBodyMethodProcessor 호출되어 HttpMessageConverter을 이용함. 위 과정과 관련해 강사님께서 @ResponseBody와 같이 view rendering이 필요 없는 작업들은 view가 생성되는 뒷 단의 작업들은(ViewResolver 와 View) 이루어지지 않는다고 설명해 주셨습니다. 그런데 여기서 의문점이 스프링 mvc의 DispatcherServlet 코드를 보면 mv = ha.handler(processedRequest, response, mappedHandler.getHandler()); 부분이 있습니다. 즉 어댑터를 통해 핸들러를 호출하면 항상 반환값으로 ModelAndView를 받습니다. 그럼 여기서 제가 궁금한 점이 생겼습니다. 클라이언트의 요청이 컨트롤러에서 @ResponseBody가 적힌 메서드가 호출되는 요청이라면 HttpMessageConverter에서 메시지 변환 과정을 진행 한 후 실제 Http 응답 메시지가 만들어서 클라이언트한테 전송되는 건가요?(이 경우는 실행흐름이 DispatcherServlet으로 가지 않고 종료) 아니면 HttpMessageConverter가 response 객체에 해당 값을 넣어두고, 흐름이 다시 DispatcherServlet으로 가서(그럼 여거서 mv는 null이 들어가나요?) 내부 로직에 의해 view를 만드는 과정이 생략되고 http 응답 메시지가 만들어지는 건가요?
-
미해결스파크 머신러닝 완벽 가이드 - Part 1
이전 강의와 동일한 동영상인 것 같습니다!
안녕하세요! 다름이 아니라 현재 제가 올리는 질문에 해당하는 영상 즉, 영상 이름이 "Spark DataFrame의 Null인 레코드 삭제하기"인 9분 32초 짜리 영상이 이전 강의와 중복되는 동일한 영상인 것 같습니다! 즉, "Spark DataFrame의 Null인 레코드 삭제하기"라는 이름의 강의 영상과 "Spark DataFrame의 컬럼과 레코드 삭제하기" 라는 이름의 강의 영상이 9분 32초로 내용도 동일한 것으로 보입니다! 혹시 선생님께서 실수로 1개의 영상을 2개로 잘못 올리신건지, 아니면 원래 2개의 영상이 있는데, 1개의 영상만 중복해서 올리신건지 문의드려요!
-
해결됨수학으로부터 인류를 자유롭게 하라(기초대수학편)
7:06 A_4 홀수 집합 수식
- 학습 관련 질문을 남겨주세요. 상세히 작성하면 더 좋아요! - 먼저 유사한 질문이 있었는지 검색해보세요. - 서로 예의를 지키며 존중하는 문화를 만들어가요. - 잠깐! 인프런 서비스 운영 관련 문의는 1:1 문의하기를 이용해주세요. x= 2n + 1 되어있습니다n이 뒤에 짝수 케이스 보니까 1부터 시작으로 보입니다. x= 2n - 1이 맞지 않을까 하는데 맞을까요?
-
미해결
소셜 로그인 쉽게 붙이는법
카카오나 네이버같이 소셜 로그인 연동 관련해서 도움 받을 수 있을 만한 곳 있을까요?? SNS 로그인 API 관련 강의는 없네요ㅠㅠ
-
미해결팀 개발을 위한 Git, GitHub 입문
안녕하세요! 수업 잘 듣고 있습니다!
안녕하세요! 수업 잘 듣고 있습니다! 강의자료에 필기를 하면서 공부를 하고 싶은데 강의자료 부탁드려도 될까요?? rlawnstn01023@naver.com 입니다!
-
미해결[C#과 유니티로 만드는 MMORPG 게임 개발 시리즈] Part3: 유니티 엔진
transform 속도 질문입니다
다른 책같은 곳에서는 GetaxisRaw한다음 normalized한다음 이동시키는데 강의에서 구현한 if문으로 각각 따로 이동로직을 뒀을때 키를 동시에 눌러서 대각선 이동하면 직선이동 속도랑 같은지 다른지 궁급합니다
-
미해결Vue.js 완벽 가이드 - 실습과 리팩토링으로 배우는 실전 개념
깃헙 권한요청 드려요
인프런 아이디 : ghkdsigm3@gmail.com 인프런 이메일 : ghkdsigm3@gmail.com 깃헙 아이디 : ghkdsigm3 깃헙 Username : ghkdsigm3
-
미해결스프링 입문 - 코드로 배우는 스프링 부트, 웹 MVC, DB 접근 기술
HelloSpringApplication 실행 중 오류
java: illegal character: '\ufeff' java: class, interface, or enum expected 이런식으로 오류가 나는데 어떻게 해야할지 모르겠습니다. package hello.hellospring.controller;import hello.hellospring.service.MemberService;import org.springframework.beans.factory.annotation.Autowired;import org.springframework.stereotype.Controller;@Controllerpublic class MemberController { private MemberService memberService; // 필드주입 - 별로 안좋음 바꿀 수 없기 때문// @Autowired// public void setMemberService(MemberService memberService) {// this.memberService = memberService;// } @Autowired // controller와 service 연결 시켜줌 / 생성자 주입- 가장 좋음음 public MemberController(MemberService memberService) { this.memberService = memberService; }} MemberController.java package hello.hellospring.service;package hello.hellospring.service;import hello.hellospring.domain.Member;import hello.hellospring.repository.MemberRepository;import hello.hellospring.repository.MemoryMemberRepository;import org.springframework.beans.factory.annotation.Autowired;import org.springframework.stereotype.Service;import java.util.List;import java.util.Optional;@Service //Service에 MemberService를 등록 /스프링 빈 등록 / Component로 해도됨public class MemberService { private MemberRepository memberRepository; // @Autowired// public void setMemberRepository(MemberRepository memberRepository) {// this.memberRepository = memberRepository; //setter 주입// } public MemberService(MemberRepository memberRepository) { //외부에서 넣어지게 (직접 new로 생성하는게 x) this.memberRepository = memberRepository; //dependance ijection } /** * 회원가입 */ public Long join(Member member) { validateDuplicateMember(member); //중복회원 검증 memberRepository.save(member); return member.getId(); } private void validateDuplicateMember(Member member) { memberRepository.findByName(member.getName()) // optional로 한 이유는 null 이 아니면을 생략하기 위해 .ifPresent(m -> { throw new IllegalStateException("이미 존재하는 회원입니다."); }); } /** * 전체 회원조회 */ public List<Member> findMembers() { return memberRepository.findAll(); } public Optional<Member> findOne(Long memberId){ return memberRepository.findByID((memberId)); }} MemberService.java
-
미해결[리뉴얼] 처음하는 SQL과 데이터베이스(MySQL) 부트캠프 [입문부터 활용까지]
팁 공유
설치가 제대로 안되서 검색을 해봤는데 좋은 방법이 있었습니다. mysql 설치하는 사이트가 달라져서 오류가 난 것 같네요. community downloads 에서 window mysql installer에 들어가서 다운로드하면 잘 됩니다. 저도 커뮤니티 서버에서 다운로드하면 실행이 안됬는데 윈도우 installer로 하니까 실행이 됬어요. 여기있는 설명대로 하시면 됩니다. https://m.blog.naver.com/PostView.naver?isHttpsRedirect=true&blogId=jaeyoon_95&logNo=221102425074
-
미해결일주일 완성! 3dsmax 입문 (자동차 및 캐릭터 만들기)
휠이 작동안합니다
alt를 누르고 휠을 눌러도 화면이 안돌아가고 천천히 움직이기만 합니다 그리고 오브젝트를 누르고 쉬프트 + 마우스로 이동하면 영상에서는 클론이 만들어지는데 저는 그냥 길게 늘어지기만하네요