zoukankan      html  css  js  c++  java
  • springboot 启动报错 java.lang.IllegalStateException: Failed to introspect annotated methods on class org

     1   .   ____          _            __ _ _
     2  /\ / ___'_ __ _ _(_)_ __  __ _    
     3 ( ( )\___ | '_ | '_| | '_ / _` |    
     4  \/  ___)| |_)| | | | | || (_| |  ) ) ) )
     5   '  |____| .__|_| |_|_| |_\__, | / / / /
     6  =========|_|==============|___/=/_/_/_/
     7  :: Spring Boot ::        (v1.4.1.RELEASE)
     8 
     9 [ INFO ] [2017-11-03 14:50:17:017] com.taikang.Application [48] [main]- Starting Application on WMM with PID 4384 (started by Administrator in G:workspace-sIdeaProjectshello)
    10 [ INFO ] [2017-11-03 14:50:17:017] com.taikang.Application [665] [main]- The following profiles are active: DEV
    11 [ INFO ] [2017-11-03 14:50:17:017] org.hibernate.validator.internal.util.Version [30] [background-preinit]- HV000001: Hibernate Validator 5.2.4.Final
    12 [ INFO ] [2017-11-03 14:50:18:018] org.springframework.context.annotation.AnnotationConfigApplicationContext [581] [main]- Refreshing org.springframework.context.annotation.AnnotationConfigApplicationContext@bdd8f7: startup date [Fri Nov 03 14:50:18 CST 2017]; root of context hierarchy
    13 [ WARN ] [2017-11-03 14:50:18:018] org.springframework.context.annotation.AnnotationConfigApplicationContext [549] [main]- Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanDefinitionStoreException: Failed to parse configuration class [com.taikang.Application]; nested exception is java.lang.IllegalStateException: Failed to introspect annotated methods on class org.springframework.boot.web.support.SpringBootServletInitializer
    14 Disconnected from the target VM, address: '127.0.0.1:60450', transport: 'socket'
    15 [ ERROR] [2017-11-03 14:50:18:018] org.springframework.boot.SpringApplication [839] [main]- Application startup failed
    16 org.springframework.beans.factory.BeanDefinitionStoreException: Failed to parse configuration class [com.taikang.Application]; nested exception is java.lang.IllegalStateException: Failed to introspect annotated methods on class org.springframework.boot.web.support.SpringBootServletInitializer
    17     at org.springframework.context.annotation.ConfigurationClassParser.parse(ConfigurationClassParser.java:187)
    18     at org.springframework.context.annotation.ConfigurationClassPostProcessor.processConfigBeanDefinitions(ConfigurationClassPostProcessor.java:324)
    19     at org.springframework.context.annotation.ConfigurationClassPostProcessor.postProcessBeanDefinitionRegistry(ConfigurationClassPostProcessor.java:246)
    20     at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanDefinitionRegistryPostProcessors(PostProcessorRegistrationDelegate.java:273)
    21     at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:98)
    22     at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:681)
    23     at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:523)
    24     at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:761)
    25     at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:371)
    26     at org.springframework.boot.SpringApplication.run(SpringApplication.java:315)
    27     at org.springframework.boot.SpringApplication.run(SpringApplication.java:1186)
    28     at org.springframework.boot.SpringApplication.run(SpringApplication.java:1175)
    29     at com.taikang.Application.main(Application.java:36)
    30 Caused by: java.lang.IllegalStateException: Failed to introspect annotated methods on class org.springframework.boot.web.support.SpringBootServletInitializer
    31     at org.springframework.core.type.StandardAnnotationMetadata.getAnnotatedMethods(StandardAnnotationMetadata.java:163)
    32     at org.springframework.context.annotation.ConfigurationClassParser.doProcessConfigurationClass(ConfigurationClassParser.java:301)
    33     at org.springframework.context.annotation.ConfigurationClassParser.processConfigurationClass(ConfigurationClassParser.java:237)
    34     at org.springframework.context.annotation.ConfigurationClassParser.parse(ConfigurationClassParser.java:204)
    35     at org.springframework.context.annotation.ConfigurationClassParser.parse(ConfigurationClassParser.java:173)
    36     ... 12 common frames omitted
    37 Caused by: java.lang.NoClassDefFoundError: javax/servlet/ServletContext
    38     at java.lang.Class.getDeclaredMethods0(Native Method)
    39     at java.lang.Class.privateGetDeclaredMethods(Class.java:2615)
    40     at java.lang.Class.getDeclaredMethods(Class.java:1860)
    41     at org.springframework.core.type.StandardAnnotationMetadata.getAnnotatedMethods(StandardAnnotationMetadata.java:152)
    42     ... 16 common frames omitted
    43 Caused by: java.lang.ClassNotFoundException: javax.servlet.ServletContext
    44     at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
    45     at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
    46     at java.security.AccessController.doPrivileged(Native Method)
    47     at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
    48     at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
    49     at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
    50     at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
    51     ... 20 common frames omitted
    52 
    53 Process finished with exit code 1

    解决方法:

    pom.xml中的

    In maven, I changed the scope like this: <scope>provided</scope> to <scope>compile</scope> and it worked!!. 
  • 相关阅读:
    Mysql:Changes in MySQL 5.6.6 (2012-08-07, Milestone 9):Group-Commit等等:重大变化版本!
    Mysql:Changes in MySQL 5.6.9 (2012-12-11, Release Candidate):GTID-based variables have been 【renamed】
    Mysql:Changes in MySQL 5.6.13 (2013-07-31, General Availability):不再支持可能引起混乱的【选项缩略】写法!
    Mysql:Changes in MySQL 5.6.22 (2014-12-01, General Availability):【sql-log-bin】
    Mysql:Changes in MySQL 5.6.30 (2016-04-11, General Availability):--ssl-mode:
    Mysql:Changes in MySQL 5.6.34 (2016-10-12, General Availability):secure-file-priv
    Windows Linux子系统Windows 10安装指南
    WSL2-参考的对象类型不支持尝试的操作。
    Win10开启Hyper-V后无法运行VMware虚拟机的解决方法
    Kubernetes---高可用的 K8S 集群构建
  • 原文地址:https://www.cnblogs.com/wang-yaz/p/9105109.html
Copyright © 2011-2022 走看看