Deployment time of ~150MB war file from jenkins to tomcat 9 - performance

Our jenkins checks every 5 minutes if the SCM has changed and if yes, it starts a build with sonarqube, jacoco and finally a deployment on a tomcat over the internal network.
This works most of the times very good, sometimes I have to remove the old versions and restart tomcat.
What drives me almost mad is that it takes sooooooo long. I already observed that the ~140MB are completely uploaded but jenkins still waits for something. I adapted the values in the manager web.xml multipart config to 200MB each.
Any help or idea or question is very appreciated!
Thanks a lot!
Aurel

Using webhook (from Github, gitlab) instead of check git repo every 5 minutes. It will help you get changes from Git repo faster.
War file have been deploy many times, maybe you need to un-deloy app before copy new version of war file to re-deploy.
Tomcat does need a lot of permgen. Try to modify it. [Refer]

Related

spring-mvc-404 page not found error in maven project

I have been trying to understand and clone the spring mvc login and registration process. As far as I know I am following the same code and process. Only thing I have changed is database details.0 Which works fine I am able to insert the data into the MySQL (8.0.27) database using test file. I am getting the same error even when I am trying his code I am getting error.
here is my code: https://drive.google.com/drive/folders/1JNkZp_O1Lh0y_1NdZ-A85KI1gfgy0_Em?usp=sharing
here is GitHub code: https://github.com/javabyranjith/spring-framework-mvc/tree/master/springmvc-userlogin
Errors I am getting:
action keyword in form was giving error "element loginProcess is not found"-> so I changed it to the form action then it worked
The origin server did not find a current representation for the target resource or is not willing to disclose that one exists.
my questions are
can a different version of Apache Tomcat(10.0.13) server can cause the issue?
since I am using new Eclipse so I have updated the new libraries can this cause the issues?
Please suggest the changes so that I can run this project. Suggest the changes here or directly change it in the google drive folder.
Tomcat 10 does not work with Spring 5. Downgrade to Tomcat 9.
10th has jakarta packages renamed from javax, which spring 5 does not support.
Friendly advice, if you are using code from git, they left versions of stuff like java and tomcat for a reason, and the newest versions like Tomcat 10 and JDK17 went through a lot of changes, so always try with suggested versions and try to migrate them to higher ones. Except for Tomcat 10, you will have to wait for Spring 6 for that.
As for the new eclipse, it does not make any difference, the maven project is still the maven project, src, and pom.xml, the structure remained the same.
First try with suggested versions then you can ramp them up once you are sure that it is working.

Critical Caching issue in Laravel Application (AWS Server)

I am facing a critical issue in my application, it is developed in Laravel and Angular. The issue is I am getting the old email templates on live site and on local server I am getting the latest updated one. The process to deloy the code is automatic, I just to commit the code in BitBucket and after that Bitbucket Pipleline push the code to AWS server directly.
I have already run the cache cammands for Laravel and restarted the jobs but still i am getting the same issue. If anyone have expirienced the same issue or have knowledge of the same to resolve, Please guide!
I think you can try one of the following ways to overcome the issue, I faced a similar issue and resolved it by following ways -
Try deleting the cache files manually from Laravel from storage/framework/views
Upload the code directly into AWS for particular module without using the pipeline way
restart your server
This will surely resolve your issue!
Since you are using Laravel and angular application deployed on AWS,
I assume that bit bucket is pushing code and build commands are fired on every push
there are few things which can help you.
Try to build the angular side on every push, since angular builds hashes all the files in the dist folder
Try to delete the Laravel cached files which are stored in storage/framework/views
Check that on that your server is pointing to the right project folder
If any of the points from 1 or 2 works you can automate the process by passing CLI command after every push,
Point 1 and 2 are achievable by passing CLI commands.

How to configure Tomcat 9 Spring REST app WAR on Jelastic?

I'm migrating a Spring REST app WAR, that's running fine on a cPanel Tomcat 9 installation, to a Jelastic Tomcat 9 environment. All my content is returning 404's.
My first question is, what to put into the Jelastic Context field, during deployment? I have tried two different names: (1) ROOT- (e.g. ROOT-067) that Jelastic provides, and (2) my preferred webapp name. Both yield same 404 errors. When I study the webapps Directories, in both cases my WAR is correctly unpacked.
My second question is, do I need to modify the Tomcat conf/server.xml or conf/web.xml, that Jelastic generates? I have tried leaving them as originally generated, and making similar changes that I made to both files in the cPanel deployment. With the changed files, the Jelastic deployment fails due to Timeout error after 15 minutes.
Thanks for any and all help!
Bob
Usually you don't have to do any changes in your server.xml / web.xml unless you need to have something very specific in it, did you try to set your context name just as ROOT (without index and a dash)? Could you please provide your environment name and a hosting service provider name? I will contact providers tech guys and we will investigate why that problem occurs. Will be glad to help.

How I get IntelliJ UE and Tomcat 9 to run my web application? (Mac OS)

I have searched everywhere for this. I'm sure I have read the information correctly but can't seem to get a full understanding of it.
I used this tutorial to get things going (https://www.jetbrains.com/help/idea/2016.3/creating-and-running-your-first-web-application.html). I do everything step by step but when it comes to running my web app, The localhost shows the official page of Tomcat and not my index.jsp that I have created. I've tried every path combination to try to get my index to show but I have had no luck.
I have done a lot of googling on this and it seems to be that when I run tomcat it reads the files from the webapps/ROOT folder instead of my project folder. How can I get my intellij or tomcat to read the files from my project? I keep reading that its my run configurations but everything looks good to me, and no one really shows what to actually do.
I wouldn't be asking unless I have tried doing this my self for hours. I'm sorry if it is really simple I just can't see it and would really appreciate your help. Thanks in advance
Structure (Ignore error messages)
Configuration
Artifacts
Deployment tab
I always get routed to this web
Artifact deployed successfully
It looks like you already have Tomcat service started on port 8080, therefore IntelliJ IDEA cannot start another instance and perform the deployment.
You need to shut down the service running on port 8080 so that IDE can start its own copy of the server and perform the configuration/deployment on start.
brew services stop tomcat should help in your case.

Jenkins stop serving static files after a couple of days

I run Jenkins for my continuous integration and I have the following problem. After a couple of days Jenkins is running totally fine, the URL for static files stop being served and the CSS, JavaScript and global look of Jenkins looks broken when it actually runs the jobs as expected.
Any idea why?
Example of an URL:
http://myserver:8181/static/70f4ebef/css/style.css
Response:
HTTP ERROR 404
Problem accessing /static/70f4ebef/css/style.css. Reason:
Not Found
Powered by Jetty://
Calling http://myserver:8181/safeRestart fixes the problem so I'm wondering if it's a Jenkins issue or a Jetty/Jenkins cache conflict.
I run Jenkins 1.537.
It's happening because the static resources are unpacked in your /tmp directory and something else is cleaning up files older than x number of days old in there.
Refer to Jenkins issue 17526 for more info.

Resources