Uploaded image for project: 'Apache Tomcat Maven Plugin'
  1. Apache Tomcat Maven Plugin
  2. MTOMCAT-135

tomcat7:run does not load HandlesTypes in application classes

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.0
    • 2.0
    • tomcat7
    • None
    • Mac OS X, Apple JDK 1.6

    Description

      Spring 3.1 brings a SpringServletContainerInitializer, that has annotation @HandlesTypes(WebApplicationInitializer.class).

      In my application, I have a WebApplicationInitializer directly in my war. This one is compiled and put in WEB-INF/classes.

      When launching with tomcat7:run-war, my WebApplicationInitializer is correctly found by tomcat and provided to SpringServletContainerInitializer.
      But with tomcat7:run, I've this line in logs :

      INFO: No Spring WebApplicationInitializer types detected on classpath

      It seems that the problems come from the ContextConfig classe (from tomcat source), in method webConfig that specificly search a "WEB-INF/classes" :

      // Step 4. Process /WEB-INF/classes for annotations
      // This will add any matching classes to the typeInitializerMap
      if (ok) {
      // Hack required by Eclipse's "serve modules without
      // publishing" feature since this backs WEB-INF/classes by
      // multiple locations rather than one.
      NamingEnumeration<Binding> listBindings = null;
      try {
      try

      { listBindings = context.getResources().listBindings( "/WEB-INF/classes"); }

      catch (NameNotFoundException ignore)

      { // Safe to ignore }

      Attachments

        Activity

          People

            olamy Olivier Lamy
            gcuisinier Gildas Cuisinier
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: