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

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?

Related

Why my spring-boot application is giving "ClassNotFoundException: javax.servlet.Filter" in Intellij but not in STS 3?

While running my spring-boot application I'm getting this exception:
ClassNotFoundException: javax.servlet.Filter
I am getting this in case of IntelliJ only while it is running successfully in STS 3.
Is there any generic reason?

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

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 ?

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.

grails 2.3 java.lang.NoClassDefFoundError: org/apache/batik/dom/svg/SVGOMDocument

When i run my grails application in tomcat i get the following error
java.lang.NoClassDefFoundError: org/apache/batik/dom/svg/SVGOMDocument. But the batik-svg-dom.1.7.jar is packaged in the war and in the classpath.
I don't however get this error when i am running the application in debug mode in STS.
I am using Grails 2.3 and building my war using maven. I am using FOP and have excluded the "xml-apis".
I have tried to place the batik-svg-dom.jar in the lib folder of tomcat, that did not work.
Thanks in advance.

Resources