java.lang.NoClassDefFoundError

javax/servlet/http/HttpServletRequest

Samebug tips4

A few things cause this exception: 1) Check if you have all jars and if they're in the correct path when running. 2) Your classpath might be broken, you can define it in the command line with "java -cp yourClassPath" or at your IDE if you're using one.

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

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

Solutions on the web4718

  • javax/servlet/http/HttpServletRequest
  • via GitHub by enzozhong
    , 1 year ago
    javax/servlet/http/HttpServletRequest
  • via Google Groups by Jn, 1 year ago
    javax/servlet/http/HttpServletRequest
  • Stack trace

    • java.lang.NoClassDefFoundError: javax/servlet/http/HttpServletRequest at java.lang.Class.getDeclaredMethods0(Native Method)[na:1.8.0_73] at java.lang.Class.privateGetDeclaredMethods(Class.java:2701)[na:1.8.0_73] at java.lang.Class.getDeclaredMethods(Class.java:1975)[na:1.8.0_73] at org.springframework.util.ReflectionUtils.getDeclaredMethods(ReflectionUtils.java:612)[spring-core-4.2.6.RELEASE.jar:4.2.6.RELEASE] at org.springframework.util.ReflectionUtils.doWithMethods(ReflectionUtils.java:524)[spring-core-4.2.6.RELEASE.jar:4.2.6.RELEASE] at org.springframework.util.ReflectionUtils.doWithMethods(ReflectionUtils.java:510)[spring-core-4.2.6.RELEASE.jar:4.2.6.RELEASE] at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.determineCandidateConstructors(AutowiredAnnotationBeanPostProcessor.java:241)[spring-beans-4.2.6.RELEASE.jar:4.2.6.RELEASE] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.determineConstructorsFromBeanPostProcessors(AbstractAutowireCapableBeanFactory.java:1069)[spring-beans-4.2.6.RELEASE.jar:4.2.6.RELEASE] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1042)[spring-beans-4.2.6.RELEASE.jar:4.2.6.RELEASE] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:510)[spring-beans-4.2.6.RELEASE.jar:4.2.6.RELEASE] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:482)[spring-beans-4.2.6.RELEASE.jar:4.2.6.RELEASE] at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306)[spring-beans-4.2.6.RELEASE.jar:4.2.6.RELEASE] at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)[spring-beans-4.2.6.RELEASE.jar:4.2.6.RELEASE] at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)[spring-beans-4.2.6.RELEASE.jar:4.2.6.RELEASE] at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)[spring-beans-4.2.6.RELEASE.jar:4.2.6.RELEASE] at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:772)[spring-beans-4.2.6.RELEASE.jar:4.2.6.RELEASE] at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:839)[spring-context-4.2.6.RELEASE.jar:4.2.6.RELEASE] at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:538)[spring-context-4.2.6.RELEASE.jar:4.2.6.RELEASE] at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:766)[spring-boot-1.3.5.RELEASE.jar:1.3.5.RELEASE] at org.springframework.boot.SpringApplication.createAndRefreshContext(SpringApplication.java:361)[spring-boot-1.3.5.RELEASE.jar:1.3.5.RELEASE] at org.springframework.boot.SpringApplication.run(SpringApplication.java:307)[spring-boot-1.3.5.RELEASE.jar:1.3.5.RELEASE] at io.swagger.Swagger2SpringBoot.main(Swagger2SpringBoot.java:24)[classes/:na] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)[na:1.8.0_73] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)[na:1.8.0_73] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)[na:1.8.0_73] at java.lang.reflect.Method.invoke(Method.java:497)[na:1.8.0_73] at com.intellij.rt.execution.application.AppMain.main(AppMain.java:144)[idea_rt.jar:na] Caused by: java.lang.ClassNotFoundException: javax.servlet.http.HttpServletRequest at java.net.URLClassLoader.findClass(URLClassLoader.java:381)[na:1.8.0_73] at java.lang.ClassLoader.loadClass(ClassLoader.java:424)[na:1.8.0_73] at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)[na:1.8.0_73] at java.lang.ClassLoader.loadClass(ClassLoader.java:357)[na:1.8.0_73] ... 27 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

    Unknown user
    Once, 10 months ago
    9 times, 5 months ago
    Unknown user
    Once, 1 year ago
    Unknown user
    Once, 1 year ago
    364 times, 4 weeks ago
    1519 more bugmates