title: Run spring-boot application on Liberty Server
body: <p>I developed a <strong>stand-alone spring boot application</strong> that serves a rest service, I've packaged it as a <code>jar</code> and it runs correctly.
  In order to release it on production server (Websphere), I have to convert it into a <code>war</code>.</p>
  
  <p>I've updated my <code>pom.xml</code> adding these lines:</p>
  
  <pre><code>&lt;properties&gt;
      &lt;maven.compiler.target&gt;1.7&lt;/maven.compiler.target&gt;
      &lt;maven.compiler.source&gt;1.7&lt;/maven.compiler.source&gt;
  &lt;/properties&gt;
  &lt;packaging&gt;war&lt;/packaging&gt;
  &lt;build&gt;
      &lt;finalName&gt;${artifactId}&lt;/finalName&gt;
  &lt;/build&gt;
  </code></pre>
  
  <p>Then, I launched <code>maven clean package</code> and I get the <code>war</code>.
  So, publishing it on a Tomcat Server works fine, but on Liberty I get the error:</p>
  
  <pre><code>Error 404: SRVE0190E: File not found /
  </code></pre>
  
  <p>I've also modified my entry point like the following:</p>
  
  <pre><code>@SpringBootApplication
  @PropertySource("classpath:alerts.properties")
  public class WebApplication extends SpringBootServletInitializer 
  {
  
  //  public static void main(String[] args) {
  //      SpringApplication.run(WebApplication.class, args);
  //  }
  
      @Override
      protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
          return application.sources(WebApplication.class);
      }
  }
  </code></pre>
  
  <p>With no success, so... how can I run a spring boot war on a Liberty Server?</p>
  
  <p><strong>UPDATE</strong></p>
  
  <p>As <strong>@Anjum Fatima</strong> suggested, I've also added the features in <code>server.xml</code></p>
  
  <pre><code>&lt;feature&gt;jsp-2.3&lt;/feature&gt;
  &lt;feature&gt;springBoot-2.0&lt;/feature&gt;
  &lt;feature&gt;servlet-3.1&lt;/feature&gt;
  </code></pre>
  
  <p>Before, in that file I've also added:</p>
  
  <pre><code>&lt;library&gt;
      &lt;file id="alerts.properties" name="${shared.resource.dir}/alerts.properties"/&gt;
  &lt;/library&gt;
  &lt;webApplication id="alerts" location="alerts.war" name="alerts"&gt;
  </code></pre>
  
  <p>And in <code>wlp18\usr\shared\resources</code> I've copied the properties file.</p>
  
  <p>But I still have the same error.</p>
  
  <p>The <code>alert.properties</code> file:</p>
  
  <pre><code>spring.datasource.url=jdbc:h2:file:~/alertsdb;DB_CLOSE_ON_EXIT=FALSE;AUTO_RECONNECT=TRUE
  spring.datasource.username=admin
  spring.datasource.password=mypassword
  spring.datasource.driver-class-name=org.h2.Driver
  
  spring.jpa.show-sql=true
  spring.jpa.hibernate.ddl-auto=update
  
  spring.h2.console.enabled=true
  spring.h2.console.settings.web-allow-others=true
  
  spring.mvc.view.prefix: /
  spring.mvc.view.suffix: .jsp
  spring.messages.basename=validation
  </code></pre>
  
  <p><strong>UPDATE 2</strong></p>
  
  <p>The server it's almost started, but it can't find some files like <code>com.ibm.ws.kernel.boot.nls_1.0.22.jar</code>, in the Liberty's lib folder there's the file <code>com.ibm.ws.kernel.boot_1.0.22.jar</code> (without <code>.nls</code>) here's the console output, what am I missing?</p>
  
  <pre><code>2020-03-18 13:44:38.950  INFO 34004 --- [ecutor-thread-4] it.mycompany.alerts.WebApplication       : Started WebApplication in 10.915 seconds (JVM running for 24.544)
  [WARNING ] The XML schema [web-jsptaglibrary_2_1.xsd] could not be found. This is very likely to break XML validation if XML validation is enabled.
  [WARNING ] The XML schema [javaee_5.xsd] could not be found. This is very likely to break XML validation if XML validation is enabled.
  [WARNING ] The XML schema [jsp_2_1.xsd] could not be found. This is very likely to break XML validation if XML validation is enabled.
  [WARNING ] The XML schema [javaee_web_services_1_2.xsd] could not be found. This is very likely to break XML validation if XML validation is enabled.
  [WARNING ] The XML schema [javaee_web_services_client_1_2.xsd] could not be found. This is very likely to break XML validation if XML validation is enabled.
  [WARNING ] The XML schema [web-app_3_0.xsd] could not be found. This is very likely to break XML validation if XML validation is enabled.
  [WARNING ] The XML schema [web-fragment_3_0.xsd] could not be found. This is very likely to break XML validation if XML validation is enabled.
  [WARNING ] The XML schema [web-common_3_0.xsd] could not be found. This is very likely to break XML validation if XML validation is enabled.
  [WARNING ] The XML schema [javaee_6.xsd] could not be found. This is very likely to break XML validation if XML validation is enabled.
  [WARNING ] The XML schema [jsp_2_2.xsd] could not be found. This is very likely to break XML validation if XML validation is enabled.
  [WARNING ] The XML schema [javaee_web_services_1_3.xsd] could not be found. This is very likely to break XML validation if XML validation is enabled.
  [WARNING ] The XML schema [javaee_web_services_client_1_3.xsd] could not be found. This is very likely to break XML validation if XML validation is enabled.
  [WARNING ] The XML schema [web-app_3_1.xsd] could not be found. This is very likely to break XML validation if XML validation is enabled.
  [WARNING ] The XML schema [web-fragment_3_1.xsd] could not be found. This is very likely to break XML validation if XML validation is enabled.
  [WARNING ] The XML schema [web-common_3_1.xsd] could not be found. This is very likely to break XML validation if XML validation is enabled.
  [WARNING ] The XML schema [javaee_7.xsd] could not be found. This is very likely to break XML validation if XML validation is enabled.
  [WARNING ] The XML schema [javaee_web_services_1_4.xsd] could not be found. This is very likely to break XML validation if XML validation is enabled.
  [WARNING ] The XML schema [javaee_web_services_client_1_4.xsd] could not be found. This is very likely to break XML validation if XML validation is enabled.
  [WARNING ] The XML schema [web-app_4_0.xsd] could not be found. This is very likely to break XML validation if XML validation is enabled.
  [WARNING ] The XML schema [web-fragment_4_0.xsd] could not be found. This is very likely to break XML validation if XML validation is enabled.
  [WARNING ] The XML schema [web-common_4_0.xsd] could not be found. This is very likely to break XML validation if XML validation is enabled.
  [WARNING ] The XML schema [javaee_8.xsd] could not be found. This is very likely to break XML validation if XML validation is enabled.
  [WARNING ] Failed to scan [file:/C:/lang/appserver/wlp/wlp18/lib/com.ibm.ws.kernel.boot.nls_1.0.22.jar] from classloader hierarchy
  C:\lang\appserver\wlp\wlp18\lib\com.ibm.ws.kernel.boot.nls_1.0.22.jar (File not found)
  </code></pre>
  
  <p>Thank you</p>