9

I'm trying to deploy a Spring Boot application that does not do any servlets in a Weblogic 12c server. Normally the main application class would implement WebApplicationInitializer and then Weblogic would take it from there. When I don't do this for my application, Weblogic installs the war file just fine, but then nothing happens.

Is there some other kind of interface my main application class needs to implement in order for Weblogic to start it up?

Michiel Haisma
  • 786
  • 6
  • 17
  • 1
    Have you read the [official documentation](https://docs.spring.io/spring-boot/docs/1.5.10.RELEASE/reference/htmlsingle/#howto-traditional-deployment) or [one of the official how-to's](https://spring.io/blog/2014/03/07/deploying-spring-boot-applications) and followed all the steps described there? – manish Apr 04 '18 at 03:13
  • I do not quite understand the issue. Did i get it right that your application starts fine if you implement `WebApplicationInitializer` but you just do not want to use it? If so, could you please elaborate what is wrong about using `WebApplicationInitializer` to let Weblogic initialize your application? I am not really familiar with Weblogic but `WebApplicationInitializer` is just the "Spring" way to replace the traditional `web.xml` which is quite mandatory to deploy a WAR. – Franz Fellner Apr 06 '18 at 17:26
  • You might want to look at the steps for "spring boot on weblogic" http://www.virtual7.de/blog/2016/07/spring-boot-oracle-weblogic-server-12/ – souser Apr 09 '18 at 01:51
  • @FranzFellner I did get it to work using the `WebApplicationInitializer`. I want to make sure I'm not loading or using any web server related classes. I might look into the suggestions in the accepted answer for a more cleaner solution. – Michiel Haisma Apr 10 '18 at 17:28
  • @manish I'm trying to not use the `WebApplicationInitializer` because my application is not a web server. – Michiel Haisma Apr 10 '18 at 17:29
  • @bubbly Thanks for the suggestion, but I'm looking to start my application as a _normal_ application, not as a web server. – Michiel Haisma Apr 10 '18 at 17:30

1 Answers1

7

You can't deploy an artifact which doesn't implement one of the Weblogic/Java EE deployment standards.

According to the documentation Weblogic supports the following deployment units:

  • Web Application

  • Enterprise JavaBean

  • Resource Adapter

  • Web Service

  • Java EE Library

  • Optional Package

  • JDBC, JMS, and WLDF Modules

  • Client Application Archive

Which means that you can deploy an artifact if and only if it implements one of above standards.

Spring Boot application implements neither of those. But implementing WebApplicationInitializer makes the Spring Boot application implement Web Application standard so that it can be deployed to a Servlet Container or any other server that supports Servlet standard.

If you don't want to deploy your application as Web Application you have to manually implement one of the listed standards.

Sasha Shpota
  • 9,436
  • 14
  • 75
  • 148