org.springframework.beans.factory.BeanDefinitionStoreException

Failed to parse configuration class [sample.jetty.jsp.SampleJettyJspApplication]; nested exception is java.lang.IllegalStateException: Failed to introspect annotated methods on class org.springframework.boot.web.support.SpringBootServletInitializer

Samebug tips4

Needs to add netty-transport-native-epoll with a OS classifier to the classpath, it's not included in netty-all

I had to build one fat jar that will include all dependencies from the other jars that i wanted to use.


ThZoisThZois

Don't give up yet. Our experts can help. Paste your full stack trace to get a solution.

Solutions on the web5129

  • via Stack Overflow by Programmer 400
    ,
  • Stack trace

    • org.springframework.beans.factory.BeanDefinitionStoreException: Failed to parse configuration class [sample.jetty.jsp.SampleJettyJspApplication]; nested exception is java.lang.IllegalStateException: Failed to introspect annotated methods on class org.springframework.boot.web.support.SpringBootServletInitializer at org.springframework.context.annotation.ConfigurationClassParser.parse(ConfigurationClassParser.java:187)[spring-context-4.3.1.RELEASE.jar:4.3.1.RELEASE] at org.springframework.context.annotation.ConfigurationClassPostProcessor.processConfigBeanDefinitions(ConfigurationClassPostProcessor.java:321)[spring-context-4.3.1.RELEASE.jar:4.3.1.RELEASE] at org.springframework.context.annotation.ConfigurationClassPostProcessor.postProcessBeanDefinitionRegistry(ConfigurationClassPostProcessor.java:243)[spring-context-4.3.1.RELEASE.jar:4.3.1.RELEASE] at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanDefinitionRegistryPostProcessors(PostProcessorRegistrationDelegate.java:273)[spring-context-4.3.1.RELEASE.jar:4.3.1.RELEASE] at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:98)[spring-context-4.3.1.RELEASE.jar:4.3.1.RELEASE] at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:681)[spring-context-4.3.1.RELEASE.jar:4.3.1.RELEASE] at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:523)[spring-context-4.3.1.RELEASE.jar:4.3.1.RELEASE] at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:759)[spring-boot-1.4.0.RC1.jar:1.4.0.RC1] at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:369)[spring-boot-1.4.0.RC1.jar:1.4.0.RC1] at org.springframework.boot.SpringApplication.run(SpringApplication.java:313)[spring-boot-1.4.0.RC1.jar:1.4.0.RC1] at org.springframework.boot.SpringApplication.run(SpringApplication.java:1185)[spring-boot-1.4.0.RC1.jar:1.4.0.RC1] at org.springframework.boot.SpringApplication.run(SpringApplication.java:1174)[spring-boot-1.4.0.RC1.jar:1.4.0.RC1] at sample.jetty.jsp.SampleJettyJspApplication.main(SampleJettyJspApplication.java:33)[classes/:na] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)[na:1.8.0_65] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)[na:1.8.0_65] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)[na:1.8.0_65] at java.lang.reflect.Method.invoke(Method.java:497)[na:1.8.0_65] at com.intellij.rt.execution.application.AppMain.main(AppMain.java:144)[idea_rt.jar:na] Caused by: java.lang.IllegalStateException: Failed to introspect annotated methods on class org.springframework.boot.web.support.SpringBootServletInitializer at org.springframework.core.type.StandardAnnotationMetadata.getAnnotatedMethods(StandardAnnotationMetadata.java:163)[spring-core-4.3.1.RELEASE.jar:4.3.1.RELEASE] at org.springframework.context.annotation.ConfigurationClassParser.doProcessConfigurationClass(ConfigurationClassParser.java:300)[spring-context-4.3.1.RELEASE.jar:4.3.1.RELEASE] at org.springframework.context.annotation.ConfigurationClassParser.processConfigurationClass(ConfigurationClassParser.java:237)[spring-context-4.3.1.RELEASE.jar:4.3.1.RELEASE] at org.springframework.context.annotation.ConfigurationClassParser.parse(ConfigurationClassParser.java:204)[spring-context-4.3.1.RELEASE.jar:4.3.1.RELEASE] at org.springframework.context.annotation.ConfigurationClassParser.parse(ConfigurationClassParser.java:173)[spring-context-4.3.1.RELEASE.jar:4.3.1.RELEASE] ... 17 more Caused by: java.lang.NoClassDefFoundError: javax/servlet/ServletContext at java.lang.Class.getDeclaredMethods0(Native Method)[na:1.8.0_65] at java.lang.Class.privateGetDeclaredMethods(Class.java:2701)[na:1.8.0_65] at java.lang.Class.getDeclaredMethods(Class.java:1975)[na:1.8.0_65] at org.springframework.core.type.StandardAnnotationMetadata.getAnnotatedMethods(StandardAnnotationMetadata.java:152)[spring-core-4.3.1.RELEASE.jar:4.3.1.RELEASE] ... 21 more Caused by: java.lang.ClassNotFoundException: javax.servlet.ServletContext at java.net.URLClassLoader.findClass(URLClassLoader.java:381)[na:1.8.0_65] at java.lang.ClassLoader.loadClass(ClassLoader.java:424)[na:1.8.0_65] at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)[na:1.8.0_65] at java.lang.ClassLoader.loadClass(ClassLoader.java:357)[na:1.8.0_65] ... 25 more

    Write tip

    You have a different solution? A short tip here would help you and many other users who saw this issue last week.

    Users with the same issue

    jpveejpvee
    4 times, last one
    SteVio1989SteVio1989
    6 times, last one
    treefolktreefolk
    6 times, last one
    Unknown visitor
    Unknown visitorOnce,
    Unknown visitor
    Unknown visitorOnce,
    1519 more bugmates