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

Classpath Resource URL handling still wrong with Tomcat 8.5.12

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Investigating
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 4.3.9
    • Fix Version/s: None
    • Component/s: Core
    • Labels:
    • Last commented by a User:
      true

      Description

      When building WAR files with resources residing in /WEB-INF/classes the following exception is raised when starting the webapp in tomcat 8.5.12:

      org.springframework.beans.factory.BeanDefinitionStoreException: I/O failure during classpath scanning; nested exception is java.io.FileNotFoundException: file:/opt/apache-tomcat-8.5.12/webapps/test.war$/WEB-INF/classes/com/acme/test (No such file or directory)
              at org.springframework.context.annotation.ClassPathScanningCandidateComponentProvider.findCandidateComponents(ClassPathScanningCandidateComponentProvider.java:323) ~[sp
      ring-context-4.3.9.RELEASE.jar:4.3.9.RELEASE]
              at org.springframework.context.annotation.ClassPathBeanDefinitionScanner.doScan(ClassPathBeanDefinitionScanner.java:272) ~[spring-context-4.3.9.RELEASE.jar:4.3.9.RELEAS
      E]
      ...
      

      The very same setup used to work fine before https://bz.apache.org/bugzilla/show_bug.cgi?id=60728 and https://github.com/spring-projects/spring-boot/issues/7949. At least we're using this packaging successfully with tomcat 7.0.x, <= 8.0.36 and websphere.

      Known workarounds: Unpack webapp. Move resources to separate jar so that they are read from /WEB-INF/lib/test.jar instead of /WEB-INF/classes.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              snicoll St├ęphane Nicoll
              Reporter:
              mor7tz Moritz Kleine
              Last updater:
              Spring Issuemaster
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Days since last comment:
                1 year, 36 weeks, 5 days ago