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.
Related
I have a Spring-Boot Application with REST API (Maven build and MongoDB Database). I will also make a UI with Angular 2 on top of that (npm build).
What i would like to do is, to host this site, with its backend & database on a server. Can i do that on my Synology NAS (DS216j)? Or should i better buy a small computer like Raspberry Pi 3?
I have heard somewhere that we can deploy our apps in Docker, and Synology has a docker app or sth? Will this help me reaching my goal? I would like to have a step by step guide from your similar setups.
As far as I understand, you only want to get your app running on your NAS, so using Docker would be an option, but no requirement.
According to the model-specific download page, your DS216j supports Java8.
So what you have to do:
Install Java on your NAS
Package your application as standalone jar-file: If not yet done, you can do that in your pom.xml (see Spring Boot documentation for details; btw, this standalone mode is one of the best features of Spring Boot)
Now you can upload the jar-file
Run it via the command line with java -jar <jar-file-name>.jar
Just make sure that the port of your app does not conflict with the ports used by your NAS.
You could also create a Docker image from your app and run it on your NAS, it seems like your model supports Docker: https://www.synology.com/en-us/dsm/packages/Docker. But that would create some extra effort, but no added value, from my point of view.
I am using WebSphere 8.5 for an Java/J2EE application development. Every time when I update java classes, I need to go through the process of building the EAR project, then updating the EAR filing through WebSphere console to deploy the changes. Is there an simple and quick process to patch/copy the java classes to WebSphere?
I have done it when I was developing application in Tomcat, I will just set build automatically in my IDE(eclipse) and it does the work.
You can deploy individual class files if you want to. Either officially, through the web console, or unofficially on the filesystem.
See what's the difference between folders 'installedApps' and 'applications' in websphere application server?
But I don't think this is what you're really seeking.
I don't know of any way to automatically update classes from an IDE to a remote WebSphere instance. I've only done so to a local WebSphere instance I run from within Rational Application Developer (IBM's branded Eclipse).
The project based on the jetty at startup must display the application version in console. Is desired to show version data just after jetty says he started. However, the app architecture does not allow to do so directly from my code.
Perhaps this can be done using configuration files?
Editing1:
Project starts as jetty server from compiled with maven war file and on momet of start I have no access to pom.xml. Also, after start no java methods are calling. Jetty server waits while somebody connect to it via browser or rest api (not sure how it works). Only after a user request my code will be called.
So, I need to show version of my project just after jetty server run with my compiled war file. How can I do it?
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.