I am adding some things in an existing Android app, which connects to a Apache Tomcat server to get information from a database, but some of the changes required that I also make minor changes on the webapp (changing some database fields).
I had never used tomcat, but managed to do the simple changes here and there.
But when I deployed it, I noticed some errors(see the photo).
How can I fix them ?
The app works regardless of them, but the server takes a few more seconds to start up.
P.S.I read somewhere that this means that the server already has these libs, and doesnt need to use the ones from the lib folder of the app ?
Related
I built the project to binary file and deployed it to server before. and start it with nohup. But if I updated my code and rebuild my program. I must to kill the process first, then updated the file and start again.
My problem is:
The app must be down with at least few seconds.
I must update file manually (login the server, kill process, replace file, and then start it)
Is there anyway to hot update the program, something like PHP? I just need update my code to server by git (or svn or others way). then the server will rebuild app and graceful restart it.
Usually you run more than one instance of your web application behind a reversed proxy, eg nginx, or any other load balancer. If the few second downtime is an issue for you then you need to have a HA setup anyway. And in such setup you can do a rolling update, where you are replacing instances one by one.
Quick googling will let you find instructions how to do the deployment eg: https://www.digitalocean.com/community/tutorials/how-to-deploy-a-go-web-application-using-nginx-on-ubuntu-18-04
I have a tomcat application which I deploy by placing the new my-project.war file into the /var/lib/tomcat8/webapps/ directory on my server (via scp).
Every time I do this, the new copy is live a few seconds later. The only problem is that it drops all the sessions.
All the documentation I can find tells me that Tomcat should restore the sessions by default. This does seem to be the case when I restart the Tomcat service, but not when I redeploy...
Can anyone tell me whats going on here? I don't fully understand why it works to deploy this way in the first place.
The default session manager - StandardManager saves the sessions in <tomcat-home>/work/<app-name>/SESSIONS.ser. When you stop tomcat, the sessions are serialized into that file. When you start it - they are loaded from it.
But when you re-deploy your applications two things happen:
Tomcat un-deploys the old app and deletes the <tomcat-home>/work/<app-name>/ folder, thus removes the saved sessions
Tomcat deploys the new app and creates a new folder
Or in two words - tomcat deletes the saved sessions on un-deploy. I guess this is because:
the re-deploy is implemented as undeploy -> deploy. I.e. the 'undeploy' step does not know if a new version of the app will be deployed, so it makes sure to properly clean up after itself.
it's better from security perspective
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.
I have deployed web applications using web deploy on to iis7.5 without issues, the preview works and It updates only the necessary files when publishing again. We have designers who like to change the css files with FTP and I thought the Replace fileName from server commands in Visual Studio would be great to pull their changes into TFS.
Every time I run it it comes up with the error :
The synchronization is being stopped because the maximum number of sync passes '5' has been exceeded even though all the changes could not be applied. This could occur if there are external changes being made to the destination.
If anyone could shine some light on the error or some documentation regarding this feature, that would be great.
Web Deploy does at least 2 passes to do a remote sync (when either the client or server is remote which is in your case too). At the end of these passes, web deploy does a metadata check to see if all the files are in sync.
If by then other changes have happened (such as someone else started a web deploy sync to the same destination, or a few files were edited via the web or via ftp or any other means) then web deploy will attempt a 3rd pass to get them in sync with the source. If the changes keep happening the passes will keep happening.
But since we dont want to sync the content for ever we placed a max retry limit of 5. You can actually override to something higher but its not recommended.
Update:
You can set this in two ways:
pass in a flag -retryAttempts=7 (or any number) to msdeploy from command line
Set RetryAttemptsForDeployment in VS targets or use it as an MSBuild property. Its described here
So, I've deployed a Java web application (myapp.war) to a Tomcat 7 server that happens to be running on Amazon EC2. I noticed that, when I do this, it overwrites a similarly-named directory called myapp when I deploy. I further realized that the app is actually being served from that myapp directory and, when I directly make a change to a file in that directory, the changes are served to the client as expected.
My question is does Tomcat do anything to this directory between redeployments? If I make a small change in a file in that directory, will it ever be overwritten before I redeploy again?
It depends.
Changes to class files will probably be ignored.
Changes to JSPs may take effect depending on if the JSP has already been accessed and if the JSP Servlet is configured to check for changes.
Changes to static files will probably take effect but may be delayed by the effects of the static file cache. Normally that delay is only a few seconds but it can be configured to be longer.
Editing web.xml will probably trigger a reload (again this can be disabled with config)
Editing contex.xml will probably trigger a redeploy.
A reload pauses the app, re-reads web.xml and unpauses the app so the user might see a short pause but no 404s. A redploy completely removes the old app and creates a new one. A user may see a 404 in they try accessing it at the wrong time.
As soon as a new WAR file is deployed, all local changes will be lost.