spring-boot banner.text not working when deployed as a WAR File - spring-boot

Deployment Server : Liberty
java -jar spring-boot-application.jar -> Banner is printed as expected
My banner.text
Application Name : ${application.title}
Application Version : ${application.version}
Application Formatted Version : ${application.formatted-version}
Spring Boot Version : ${spring-boot-version}
Spring Boot Formatted Version : ${spring-boot.formatted-version}
--------------------------------------------------------------------------
${AnsiColor.BRIGHT_RED} Spring boot banner customization example
-------------------------------------------------------------------------
However when I build this jar as webapp
mvn install -Pwebapp ( maven-war-plugin)
and deploy the WAR on Liberty Server - only ${spring-boot.formatted-version} is printed. rest are blank.
Any clues ?

Related

Start spring boot jar file as part of tomcat start

There is a way I can start the spring boot jar file as part of tomcat start(catalina.bat start).
I have a spring cloud api gateway which does not support war file deployment.
In a bare metal box, I have installed the tomcat, and as part of deployment I have converted all microservice into war file and able to deploy it into tomcat/webapp folder and up and running.
As spring cloud api gateway does not support war file, I kept this application with embed tomcat.
Now I need this jar file as well get started along with the tomcat [catalina.bat start].
In tomcat I have seen there is something shared.loader option in catalina.properties file.
I have kept the jar file in below path as shown below and when I try to start it, jar file is not getting picked up.
Need to know if there is a way to start the spring boot application [jar file] as part of tomcat [catalina.bat start] start.

Spring Boot Jersey Starter (2.7.x) App fails when running java -jar but works with mvn spring-boot:run

I have a Spring Boot Jersey Starter based App which was working fine until 2.6.11 of SpringBoot.
From 2.7.0 I have noticed that mvn spring-boot:run works fine but java -jar target/my_jar fails with this exception
***************************
APPLICATION FAILED TO START
***************************
Description:
Web application could not be started as there was no org.springframework.boot.web.servlet.server.ServletWebServerFactory bean defined in the context.
Action:
Check your application's dependencies for a supported servlet web server.
Check the configured web application type.
I read the release notes and wasn't helpful. Any pointers?

Control order of WAR file deployment in JBoss EAP 7.2.0

I have developed two Spring Boot applications, one is Cloud Config Server and the other is a Spring Boot application that fetches property from Config Server. I have deployed the two applications as WAR files in JBoss EAP. I am deploying the WAR files in sequence, deploying the Config Server before the other application. Problem is happening after I restart the server, the second war file is getting deployed before the war file for Config Server.
I Jboss EAP 7.2.0, how will I ensure that the WAR file for Config Server is always deployed before the WAR file of the other application?
You can control the startup order of deployment by using jboss-all.xml deployment descriptor to declare dependencies between the deployments.
Example:
If you want foo.ear is deployed before bar.ear then you can create an bar.ear/META-INF/jboss-all.xml file like this:
<jboss xmlns="urn:jboss:1.0">
<jboss-deployment-dependencies xmlns="urn:jboss:deployment-dependencies:1.0">
<dependency name="foo.ear" />
</jboss-deployment-dependencies>
</jboss>
[1] https://access.redhat.com/documentation/en-us/red_hat_jboss_enterprise_application_platform/7.1/html/configuration_guide/deploying_applications#control_order_deployments
[2] https://access.redhat.com/solutions/88763

deploying jsf jpa web application in weblogic 12.1.1

i am developping a web application using Maven , JSF 2.2 ,JSTL 1.2.1 , JPA 2.1 , Spring 4.2.9, Hibernate-jpa-api-2.1
i can deploy my application in Tomcat and run it without problems , but i want deploy in weblogic 12.1.1 as well but i got some problems starting my app server :
nested exception is java.lang.NoSuchMethodError : javax.persistance.Table.indexes()[Ljavax/persistence/Index;
....
org.springframework.beans.factory.BeanCreationException : Error creatin bean with name 'myEmf' defined in class path resource [jpaConfig.xml]
....
Error javax.entreprise.resource.webcontainer.jsf.application
i have created a weblogic.xml in my deployed war like this :
<prefer-application-packages>
<package-name>javax.faces.*</package-name>
<package-name>com.sun.faces.*</package-name>
<package-name>com.bea.faces.*</package-name>
</prefer-application-packages>
<prefer-application-resources>
<resource-name>javax.faces.*</resource-name>
<resource-name>com.sun.faces.*</resource-name>
<resource-name>com.bea.faces.*</resource-name>
<resource-name>META-INF/services/javax.servlet.ServletContainerInitializer</resource-name>
</prefer-application-resources>
The error message "java.lang.NoSuchMethodError" indicates a library collision with the JPA 2.0 Library of Weblogic. Since you are packing your own library for that, try adding "javax.persistence.*" to the weblogic.xml
Option 2: Add the JPA 2.1 Support to weblogic classpath
In your domain/bin/setDomainEnv (.cmd for windows, .sh for unix) add a PRE_CLASSPATH Variable. On a windows System this would look like this:
set PRE_CLASSPATH=C:/weblogic_12130/oracle_common/modules/javax.‌​persistence_2.1.jar;‌​C:/weblogic_12130/wl‌​server/modules/com.o‌​racle.weblogic.jpa21‌​support_1.0.0.0_2-1.‌​jar

How to use Websphere liberty in spring boot application

I want to use Websphere liberty in spring boot application instead of tomcat server. If I am correct it is not supported out of the box. How can I configure spring boot/websphere liberty to achieve this?
Using the Liberty app accelerator you can download a zip containing a Maven buildable 'Spring Boot with Spring MVC' app as your starting point. Just run mvn install and you'll get the app running at http://localhost:9080/myLibertyApp/
Actually, you can now create runnable jar files with WebSphere Liberty. You need v8.5.5.9 or higher. Create a runnable jar this way:
server package {server name} --archive={jar name}.jar --include=minify,runnable
Resultant jar can be run as you'd expect:
java -jar {jar name}.jar
Since very recently (May 2018) you can deploy a Spring Boot jar with Liberty, as it seems. See https://developer.ibm.com/wasdev/blog/2018/05/11/spring-boot-applications-on-liberty/. Haven't tried it out yet, though.

Resources