작성
·
438
0
swagger 의존성 추가하고 똑같이 코드 작성했는데 오류가 납니다
java.lang.IllegalStateException: Failed to introspect Class [kr.co.songjava.configuration.SwaggerConfiguration] from ClassLoader [org.springframework.boot.devtools.restart.classloader.RestartClassLoader@36fd7761]
at org.springframework.util.ReflectionUtils.getDeclaredMethods(ReflectionUtils.java:485) ~[spring-core-5.3.22.jar:5.3.22]
at org.springframework.util.ReflectionUtils.doWithMethods(ReflectionUtils.java:361) ~[spring-core-5.3.22.jar:5.3.22]
at org.springframework.util.ReflectionUtils.getUniqueDeclaredMethods(ReflectionUtils.java:418) ~[spring-core-5.3.22.jar:5.3.22]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.lambda$getTypeForFactoryMethod$2(AbstractAutowireCapableBeanFactory.java:765) ~[spring-beans-5.3.22.jar:5.3.22]
at java.util.concurrent.ConcurrentHashMap.computeIfAbsent(ConcurrentHashMap.java:1688) ~[na:1.8.0_291]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.getTypeForFactoryMethod(AbstractAutowireCapableBeanFactory.java:764) ~[spring-beans-5.3.22.jar:5.3.22]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.determineTargetType(AbstractAutowireCapableBeanFactory.java:703) ~[spring-beans-5.3.22.jar:5.3.22]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.predictBeanType(AbstractAutowireCapableBeanFactory.java:674) ~[spring-beans-5.3.22.jar:5.3.22]
at org.springframework.beans.factory.support.AbstractBeanFactory.isFactoryBean(AbstractBeanFactory.java:1670) ~[spring-beans-5.3.22.jar:5.3.22]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.doGetBeanNamesForType(DefaultListableBeanFactory.java:570) ~[spring-beans-5.3.22.jar:5.3.22]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanNamesForType(DefaultListableBeanFactory.java:542) ~[spring-beans-5.3.22.jar:5.3.22]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeansOfType(DefaultListableBeanFactory.java:669) ~[spring-beans-5.3.22.jar:5.3.22]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeansOfType(DefaultListableBeanFactory.java:661) ~[spring-beans-5.3.22.jar:5.3.22]
at org.springframework.context.support.AbstractApplicationContext.getBeansOfType(AbstractApplicationContext.java:1300) ~[spring-context-5.3.22.jar:5.3.22]
at org.springframework.boot.SpringApplication.getExitCodeFromMappedException(SpringApplication.java:867) [spring-boot-2.7.3.jar:2.7.3]
at org.springframework.boot.SpringApplication.getExitCodeFromException(SpringApplication.java:855) [spring-boot-2.7.3.jar:2.7.3]
at org.springframework.boot.SpringApplication.handleExitCode(SpringApplication.java:842) [spring-boot-2.7.3.jar:2.7.3]
at org.springframework.boot.SpringApplication.handleRunFailure(SpringApplication.java:782) [spring-boot-2.7.3.jar:2.7.3]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:318) [spring-boot-2.7.3.jar:2.7.3]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1306) [spring-boot-2.7.3.jar:2.7.3]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1295) [spring-boot-2.7.3.jar:2.7.3]
at kr.co.songjava.ExampleSpringApplication.main(ExampleSpringApplication.java:10) [classes/:na]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_291]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_291]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_291]
at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_291]
at org.springframework.boot.devtools.restart.RestartLauncher.run(RestartLauncher.java:49) [spring-boot-devtools-2.7.3.jar:2.7.3]
Caused by: java.lang.NoClassDefFoundError: springfox/documentation/spring/web/plugins/Docket
at java.lang.Class.getDeclaredMethods0(Native Method) ~[na:1.8.0_291]
at java.lang.Class.privateGetDeclaredMethods(Class.java:2701) ~[na:1.8.0_291]
at java.lang.Class.getDeclaredMethods(Class.java:1975) ~[na:1.8.0_291]
at org.springframework.util.ReflectionUtils.getDeclaredMethods(ReflectionUtils.java:467) ~[spring-core-5.3.22.jar:5.3.22]
... 26 common frames omitted
Caused by: java.lang.ClassNotFoundException: springfox.documentation.spring.web.plugins.Docket
at java.net.URLClassLoader.findClass(URLClassLoader.java:382) ~[na:1.8.0_291]
at java.lang.ClassLoader.loadClass(ClassLoader.java:418) ~[na:1.8.0_291]
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:355) ~[na:1.8.0_291]
at java.lang.ClassLoader.loadClass(ClassLoader.java:351) ~[na:1.8.0_291]
at java.lang.Class.forName0(Native Method) ~[na:1.8.0_291]
at java.lang.Class.forName(Class.java:348) ~[na:1.8.0_291]
at org.springframework.boot.devtools.restart.classloader.RestartClassLoader.loadClass(RestartClassLoader.java:145) ~[spring-boot-devtools-2.7.3.jar:2.7.3]
at java.lang.ClassLoader.loadClass(ClassLoader.java:351) ~[na:1.8.0_291]
... 30 common frames omitted
오류 코드가 이렇게 나오는데 어느부분이 문제일까요?? 부트는 2.4.0버전이고 swagger 2.9.2입니다
답변