I'm new to use Tomcat and often need to update project but I know only manually update war file on server. This is takes to much time. How can i use more effectively. I want to use git or add my remote server on eclipse.
You should try to automate such steps. The manager-application from tomcat could be controlled by scripts. So using the manager application with some sort of script (bash, REST, ANT) would by my choice.
Take a look at:
https://tomcat.apache.org/tomcat-9.0-doc/index.html
https://tomcat.apache.org/tomcat-9.0-doc/manager-howto.html
Tomcat manager remote deploy script
Related
I have a spring boot application that running on embedded tomcat with java -jar app.jar on a server away from my work office, and I haven't any ssh or other access to that server.
So when I want to install and run newer version of application, I should go to the server place, physically connect to server and then install and run newer version.
Is there a way to run newer version of application without going to the server place? for example, upload newer jar file into my running application, and itself update it.
NOTE
I don't have any access to server and cannot use and run any continous delivery tools like jenkins or other, because of IP and port restrictions.
I did something like this a while back which worked out pretty well.
So you could create a super small app on the server(so small that it "never" needs to be updated) and have that monitor the versions and when a new version is available it could stop the real process and restart it with the new jar file.
I unfortunately don't have the code for that starter app, but it shouldn't take that long to write one that suits your needs
Why don't you install a Tomcat to the server and use it's management GUI to deploy the newer version of the app? It is a very old fashion but works well.
The only thing you will need to modify in your source code is to replace the packaging from jar to war in the pom.xml, so you can deploy it via Tomcat Manager.
This how the manager GUI looks like:
You can learn more about the Tomcat Manager here.
I have develop web application using spring and hibernate without maven for managing sub-version i am using SVN all those things working well.
Now my problem is that when i done a little changes in my application then create war file and deploy using tomcat manager and it is more time consuming process for me to perform all those task for a small changes.
Can i do like this when i commit using svn(or any other sub-version tools like git) then direct changes to my application which is running on tomcat remove server.
Please help me to solve this problem?
I have a regular netty application server that runs on port 44080 and is built as a .jar file. I would like to use elastic beanstalk to manage the lifecycle of the application. Is there a way I can deploy the jar or something similar using elastic beanstalk?
It seems netty is currently not supported by elastic beanstalk. If your application can also run on Tomcat, you could do that - with Tomcat, you just need to enter some basic settings in the webinterface and you´ll get a fully working environment where you can upload jar files to.
If you need netty as a platform, you could try using Amazon OpsWorks. I never worked with it myself, but I know you can create your own "environment configurations" there. You´d basically create a few scripts to setup your server and deploy your application and OpsWorks lets you execute those through the web ui and also provides capabilites for auto-scaling, failover, etc. in OpsWorks environments.
There's nothing wrong about using Netty. In fact, one of our archetypes for AWS Elastic Beanstalk contains support for Dropwizard (by using Docker as its stack), thus not being dependent on a Java Web Container.
$ mvn archetype:generate -Dfilter=elasticbeanstalk-docker-dropwizard
It might need a few tweaks, but the overall idea is to package all your dependencies into a zip file and deploy it. Also, make sure your Dockerfile EXPOSEs port 44080.
I want to check deploying procedure of my struts2 web application developed using eclipse juno on local tomcat server. I want to deploy it to a remote host like 000webhost. Can you provide me any information how to do that?
well, I run my application by typing
http://localhost:8080/Struts2starter/
on browser I want to run it by typing
http://myapp.com/Struts2starter
like something on browser. I wanted to know how to do it.
I don't believe you can deploy a Java application in 000webhost. For example, you can deploy on Google App Engine. Here is an example of how to do that: http://www.mkyong.com/google-app-engine/google-app-engine-struts-2-example/
It depends on server in question. Most servers provide some kind of remote deployment using manager applications / rmi connectors / whaever else exitic means , and eclipse can work with most of them. But of course it needs to be configured on both sides in order to work. Be more specific about your server config, and you will surely get proper answer
I have a ant file on the server-side, and from the client-side I need to execute it on the server, how can this be done?
SSH should work on any Unix system:
ssh gooner#host.example.com ant -f /home/gooner/build.xml
Do not use RSH - it's obsolete, and it's been replaced with the more secure SSH.
You could execute the ANT build script and targets from a servlet.
This article explains how: http://onjava.com/pub/a/onjava/2002/07/24/antauto.html?page=1
Perhaps overkill for your situation, but you might want to look at Hudson. It is a Java build server with a web interface. It is relatively easy to set up and configure projects, though you will need to run a servlet container on your server (such as Apache Tomcat).