Deployment of war file on redhat openshift - spring

I created a spring mvc application (java based configuration no web.xml, no any xml anywhere) in eclipse as a dymamic web application project.I uploaded the war file to my tomcat 7 cartridge using git as documented here https://help.openshift.com/hc/en-us/articles/202399740-How-to-deploy-pre-compiled-java-applications-WAR-and-EAR-files-onto-your-OpenShift-gear-using-the-java-cartridges
git finishes with a "deployment completed with status: success" message but when i try to access the deployed app under http://ashken-f00fc7c8.rhcloud.com/webservice/ it returns a http status code 404 yet on my local machine everything runs fine.

The problem was a result of java versioning hell. I had compiled my project with java 8 which is not yet supported by the tomcat 7 catridge. so downgrading to java 7 solved the issue. java 8 is supported by the openshift DIY catridges though.

Related

Problem running BIRTViewer in Oracle Weblogic 14.1.1

I have created a war file of birt-runtime-4.12.0-20221128 as in the instructions for POJO deploymnet. I am running weblogic 14.1.1 and I can successfully deploy it. Weblogic is running Java Version: 1.8.0_331. Is this sufficient?
When I browse to the following path: http://localhost:7001/birt/index.jsp
I get the following error: Error 404--Not Found
Any suggestions on how to make it work?
I tried building it many times and many ways and this is the only way that it successfully deployed but doesnt work.
Sorry, but BIRT 4.12 needs Java >= 11.

Jhipster project - error with ConfigurationMetadataAnnotationProcessor class in spring-boot app

I just start a new Jhipster project on my computer.
I have install the Open JDK 11.0.6, the last version on node and npm (node 16.15.0).
I have created the project with jhipster to test it but I have some issues to launch the backend part with spring-boot in Intellij.
When I open my project in IntelliJ and launch the Spring boot app, I got this error:
java: Supported source version 'RELEASE_6' from annotation processor 'org.springframework.boot.configurationprocessor.ConfigurationMetadataAnnotationProcessor' less than -source '11'
This error comes during the compilation of the application
I put below some screen of my configuration
My java version in cmd
My java in PATH variable
Java set in project INTELLIJ as SDK
Java for the module
And to finish, before all this, a java 1.6 was install on the computer but I have cut all the way to call it (PATH & JAVA_HOME). I can't delete it totally because I'm not an administrator of my computer.
Thanks for the idea in advance,
Have a good day,

Spring boot - Unsupported config data location 'optional:file:./config/*/'

We are migrating a spring boot application from 2.2.4 to 2.4.3
The application can be run with inbuilt tomcat / Tomcat war deployment.
Environment: Windows Azul Java 11 (Zulu 11) and Tomcat 9.0.33
If I run the code with my Netbeans linked tomcat, it works fine.
If I deploy the generated war directly in the same standalone tomcat, it throws the following error.
SEVERE [main] org.apache.catalina.startup.HostConfig.deployWAR Error deploying web application archive [D:\apache-tomcat-9.0.33-without port - rest.war]
java.lang.IllegalStateException: Error starting child
................................................................
................................................................
Caused by: org.springframework.boot.context.config.UnsupportedConfigDataLocationException: Unsupported config data location 'optional:file:./config/*/'
at org.springframework.boot.context.config.ConfigDataLocationResolvers.resolve(ConfigDataLocationResolvers.java:110)
On reading through the Spring document, it was mentioned that By default, Spring Boot includes config/*/ in the default search locations. Ref: https://docs.spring.io/spring-boot/docs/2.4.0-SNAPSHOT/reference/htmlsingle/#boot-features-external-config-files-wildcards
I further debugged with spring boot source and spring core source and identified that there is a mismatch in the classloader that happens that was the cause of this exception.
SpringFactoriesLoader is the class that gets loaded by ParallelWebAppClassLoader in NB linked tomcat and by URLClassLoader in standalone tomcat.
Ref: Line No 129 at https://github.com/spring-projects/spring-framework/blob/master/spring-core/src/main/java/org/springframework/core/io/support/SpringFactoriesLoader.java#L129
The cache at Line 136 has the config classes loaded by ParallelWebAppClassLoader, but not by the URLlassLoader. So the 2 resolvers - ConfigTreeConfigDataLocationResolver, StandardConfigDataLocationResolver in boot v2.4.3 are not getting identified when it tries to retrieve with the key URLlassLoader (Line 136).
Not sure whether this is an issue with Springboot / SpringCore / Tomcat / any new configuration to be added as a part of our upgrade.
Note: Our application.properties has spring.servlet.multipart related properties only.
"./" is not getting resolved in standalone tomcat.
Try using classpath:application.properties , or classpath:config/* -- this would require props inside war.
or absolute path of file:/var/myapp/config/*. Since tomcat is in D:, you may create a folder d:/var/myapp/config/.
Note that within spring you can ignore "d:" and just mention "/var/myapp/config/*", so, in-case tomcat is in "x:" your code need not change.
This was an issue in Spring boot.
Updating to version 2.4.6 will solve this issue.

404 when deploying Grails 3.1.10 war to tomcat7 or tomcat8

The closest stackoverflow question that explains my symptoms is here - How can I deploy a Grails 3.0.1 war file in Tomcat7?
I am in the process of upgrading a Grails 2.3.4 application to Grails 3.1.10 and everything is working with 'grails run-app'.
When i deploy to a war i get nothing but 404's for any url.
The war deploys without any error messages in catalina.out.
The tomcat access logs show my access attempts. (not linux problem?)
I can get to the tomcat manager, and the tomcat manager shows my app as "running" as true. (no errors)
Manager shows myapp-0.1 because the war file was myapp-0.1.war .. this is fine for now.
I am running Grails 3.1.10.
I have tried against Tomcat 7.0.55 as well as 8.0.92.
I have tried changing grails.serverUrl in application.groovy to various values. It is now:
//fix war name after get working
grails.serverUrl = "/myapp-0.1"
System.setProperty("server.contextPath","/myapp-0.1")
I have tried the above without "-0.1". (i was suprised to learn this was necessary - https://stackoverflow.com/a/23664531/104993)
I have tried changing "org.springframework.boo:spring-boot-starter-tomcat" from "compile" to "provided" in the build.gradle file.
Please let me know what I need to elaborate on. It's difficult to paste log outputs and config files. (i'm behind a firewall)
You add the following task to your build.gradle it will name the war what ever you want:
task wrapper(type:Wrapper){
war.archiveName='myWar.war'
}
Then when you deploy it should have the correct name and you can go to https://localhost:8080/myWar

Remote Deployment with Mule CE

What is the recommended/available approaches to remote deploying a Mule application to a remote Mule server? I'm using Maven for build btw.
I saw that the appkit can remote deploy to Cloudhub: http://blogs.mulesoft.org/using-continuous-deployment-with-cloudhub/
and theres a rest maven plugin for the management console but I'm using the standalone community edition and can not use either one. I also saw a cargo implementation on Github, but this only handle local deployments
I would write a script that:
scp the application to /tmp
remote mv the application to $MULE/apps
Moving a file being an atomic operation prevents potential issues of uploading directly in the /apps directory and have Mule pick-up a partially uploaded application.
"scp the application to /tmp" reminds me this! ...

Resources