spring-bootweblogic

Invalid web-app-versionType after Spring Upgrade


To support JUnit 5, I recently upgraded a Spring Boot application to version 2.4.7.

Local development uses an embedded Tomcat server, while all other environments run on a Weblogic server 12.1.3.

Everything runs locally, but using the Weblogic Server results in the following exception:

Caused By: weblogic.descriptor.DescriptorException: VALIDATION PROBLEMS WERE FOUND
  /weblogic.utils.classloaders.GenericClassLoader@700d06bb finder: weblogic.utils.classloaders.CodeGenClassFinder@40ce7cdd annotation: APP@/WEB-INF/lib/tomcat-embed-websocket-9.0.46.jar!/META-INF/web-fragment.xml:18:3:18:3: problem: cvc-enumeration-valid: string value '4.0' is not a valid enumeration value for web-app-versionType in namespace http://xmlns.jcp.org/xml/ns/javaee
    at weblogic.descriptor.internal.MarshallerFactory$1.evaluateResults(MarshallerFactory.java:249)

Other questions on the topic led me to check web.xml, but it contains version="3.0". I don't know how to proceed because I don't understand where this comes from.


Solution

  • Do you have this in your pom.xml to exclude packaging of the tomcat jar files when creating the war file?

    <dependency>
      <groupId>org.springframework.boot</groupId>
      <artifactId>spring-boot-starter-tomcat</artifactId>
      <scope>provided</scope>
    </dependency>
    

    The spring-boot-starter-tomcat dependencies must have provided scope.