Search code examples
spring-bootjbosswebsphereear

Error deploying Spring boot application in Websphere 8.5.5


I am getting following error message in stdout while starting my application in Websphere 8.5.5:


 1/9/20 11:56:48:437 UTC] 000000c0 SystemOut     O 11:56:48.435 [WebContainer : 3] ERROR 
 org.springframework.boot.SpringApplication - Application run failed
java.lang.IllegalStateException: Failed to load property source from location 'classpath:/application.xml'
    at org.springframework.boot.context.config.ConfigFileApplicationListener$Loader.load(ConfigFileApplicationListener.java:545)
    at org.springframework.boot.context.config.ConfigFileApplicationListener$Loader.loadForFileExtension(ConfigFileApplicationListener.java:494)
    at org.springframework.boot.context.config.ConfigFileApplicationListener$Loader.load(ConfigFileApplicationListener.java:464)
    at org.springframework.boot.context.config.ConfigFileApplicationListener$Loader.lambda$null$7(ConfigFileApplicationListener.java:443)
    at org.springframework.boot.context.config.ConfigFileApplicationListener$Loader$$Lambda$290.0000000000368730.accept(Unknown Source)
    at java.lang.Iterable.forEach(Iterable.java:86)
    at org.springframework.boot.context.config.ConfigFileApplicationListener$Loader.lambda$load$8(ConfigFileApplicationListener.java:443)

The version of spring boot that I am using is 2.2.2.

Why is Spring Boot trying to load the ear deployment descriptor, which is in the META-INF folder?


Solution

  • As M. Deinum says, the problem it is giving is because Spring Boot is trying to load the ear artifact's application.xml file to get properties and gives a parsing error as it does not have the expected format.

    I have had this same error when displaying in application servers and it is solved by taking from the MANIFEST.MF file the path /META-INF

    In my case, I was including the war plugin with this:

    <manifestEntries>
       <Class-Path>./ META-INF/</Class-Path>
    </manifestEntries>
    

    Try deleting that entry and redeploying.