Uploaded image for project: 'Spring Framework'
  1. Spring Framework
  2. SPR-9500

Cannot create application context with web components when Servlet 3.0 is not present on classpath

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Complete
    • Affects Version/s: 3.2 M1
    • Fix Version/s: 3.2 M2
    • Component/s: Web
    • Labels:
      None
    • Last commented by a User:
      false

      Description

      Create a new web template project from the spring-framework-issues repo, and try and launch it in Tomcat 6. Or alternatively try and create an application context in a test case:

      new GenericXmlApplicationContext("file:./src/main/webapp/WEB-INF/spring/servlet-context.xml");
      

      Stacktrace:

      java.lang.NoClassDefFoundError: javax/servlet/AsyncListener
              at java.lang.ClassLoader.defineClass1(Native Method)
              at java.lang.ClassLoader.defineClassCond(ClassLoader.java:631)
              at java.lang.ClassLoader.defineClass(ClassLoader.java:615)
              at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
              at java.net.URLClassLoader.defineClass(URLClassLoader.java:283)
              at java.net.URLClassLoader.access$000(URLClassLoader.java:58)
              at java.net.URLClassLoader$1.run(URLClassLoader.java:197)
              at java.security.AccessController.doPrivileged(Native Method)
              at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
              at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
              at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
              at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
              at java.lang.Class.getDeclaredMethods0(Native Method)
              at java.lang.Class.privateGetDeclaredMethods(Class.java:2427)
              at java.lang.Class.getDeclaredMethods(Class.java:1791)
              at org.springframework.core.type.StandardAnnotationMetadata.hasAnnotatedMethods(StandardAnnotationMetadata.java:159)
              at org.springframework.context.annotation.ConfigurationClassUtils.isLiteConfigurationCandidate(ConfigurationClassUtils.java:104)
              at org.springfram
      ...
      

        Attachments

          Activity

            People

            • Assignee:
              rstoya05-aop Rossen Stoyanchev
              Reporter:
              david_syer Dave Syer
              Last updater:
              Rossen Stoyanchev
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Days since last comment:
                6 years, 6 weeks, 2 days ago