I have been asked to develop a web based application which would be locally deployed at multiple (>100) geographical locations. Till now, I have been designing web applications which are deployed at a cloud and accessed by clients across the globe. In this particular project, the client wants to maintain there own local servers since they cannot ensure continous Internet connectivity. These local deployments may periodically synchronize data with the central datacenter.
Now, I am pondering if it is possible to provide a packaged solution for deploying the complete stack of our web application, so that a technical person at the client end can just download it on the linux box and the packaged solution configures everything (including application server, database, schemas). Additionally, I should also be able to push periodic updates for code etc.
I had a look at Docker, but I am not sure if it is able to fulfill all these requirements or if there is a standard protocol/solution for this which I can build upon.
My web application stack includes
Postgres
JBoss
Class files etc.
JDK
Other dependencies for these softwares.
Related
I have been developing java desktop application for SMEs.
I developed a java application for a business that needs to access SQL databases on a server. The GUI is Swing based. Now it turns out we need to deploy the java jar on the server too, so that the desktops PCs can access to it remotely and we won't be installing the jar locally as usual.
What I would like to know is if there need to be significant modification to source code I need to apply (I checked out Client/Server dev with sockets, for example), or would a simple drag n drop on the server work?
Ps. Right now I have no clue on what the server is and if it is owned by the business or hosted in a datacenter.
Also, What would the alternative be in terms of connection protocol, depending on the server location?
So, i have some experience developing Java WebServices.
The problem is, all i do is deploy them to localhost.
My question is:
How can we deploy a WebService to a server other than localhost?
How can i search the web and find the WSDL description for my WebService so that i, or anybody else around the world, can call its services?
If i have it in localhost, nobody else but me on my computer can acess it right?...
Thank you for your time
I don't think you'd want to make an application running in your development environment accessible to anybody else around the world for a variety of reasons. Others on your local network could access your local host via its network hostname, but this isn't users around the world.
Let's discuss your two questions individually:
How can we deploy a WebService to a server other than localhost?
You'll want to establish a server environment that is available (on) as much as possible. If you want to keep using Apache Tomcat, you could sign up with a variety of service providers that host Apache Tomcat applications - there are many who offer tiered pricing based on number and size of pre-configured virtual servers (CPU, memory, disk space, and/or monthly data transfer of the application). You could even sign up with a cloud service provider such as Google Cloud, Amazon Web Services, or Microsoft Azure. All provide the tools to build, provision, and manage virtual server(s) which you would then deploy Tomcat and web service application into. Here's a detailed tutorial on setting up a Tomcat virtual server on Azure. You'd then need to manage those server(s), watch them to see how much they're utilized (which will impact how much they cost you per month, by the way).
If server management isn't what you're looking for - you could also explore "serverless" options such as Google AppEngine or AWS Elastic Beanstalk. In this model, you just upload your WAR file and the hosting service manages things like how many servers are needed to handle all the application SOAP requests your users around the world are making. You'll need to read the specifications for each, as you technically aren't providing Tomcat itself - in Google's example, you're actually running in their own proprietary container, so your app may need some changes depending on what it does.
Depending on what hosting or cloud service provider you select, your "how to deploy" steps vary wildly. On the bright side, all offer tutorials on how to specifically deploy applications into them "their way."
How can i search the web and find the WSDL description for my WebService so that i, or anybody else around the world, can call its services?
Once you've settled on a hosting or cloud services provider and have deployed your application, you'll have a URL to reach it, but you'll need to work on getting the word out. There are some open specifications on (SOAP) web service discovery, but more than likely that's not what you're really looking for. You could also submit your WSDL URL to an online API directory such as ProgrammableWeb or Public APIs.
The simplest way to do-it-yourself would be to run a web site that links to the WSDL, then use search engine optimization techniques to list the site on search engines and make it (and the WSDL it links to) relevant to web searches.
Getting fancier, you can treat your web service as a product via an API Management system. At a high level, this works by hiding the real URL to your web service on its server(s) and instead direct clients to a small website for developers where you document, market, facilitate discovery of your service as well as offer a sign up to use it (so you can track and manage who around the world is using your web service). Clients then consume the web service via separate URL behind what's called an API Gateway. You could charge for access or offer it for free but limit the amount of concurrent requests a client can make - after all, you're likely paying your hosting provider for utilization. Some of the cloud service providers Amazon, Azure, standalone API management vendors such as Apigee, Mashery, and many others.
Can we deploy a java project on windows azure without uploading JDK and Tomcat on storage in windows azure? If yes, please provide me steps how to do it.
I made a project as provided in windows azure create a sample application in Java.
But at time i have to create a cloud service, I am supposed to deploy JDK and tomcat which totals around 100-130 MB. Isn't there any solution so that we should deploy cloud service and not JDK and tomcat.
Azure VM images do not include the JDK or any of the Java web servers (Tomcat, Jetty, etc.). You need to get them, from somewhere.
So... when building a Java app via Eclipse and related Cloud Service template, there's a startup script that bootstraps your worker role instances. This involves grabbing the SDK and web server (Tomcat, Jetty, etc.) from somewhere and placing it on your instance's disk. Since you're using Cloud Services (worker role in this case), the OS disks are stateless: Each time a new VM instance spins up, it starts fresh, and you're responsible for setting things up (via startup script).
So: You need to set up your SDK and web server. You can either bundle these with your deployment package or download them from somewhere. The former increases the deployment package size by quite a bit (maybe 100MB?). The latter requires you to download the bits from somewhere. You can either download from somewhere like Oracle (which requires you to go through a license agreement each time), or from your own storage account (which is very fast, as long as it's in the same region as your code deployment). Further: being in the same data center, there are no bandwidth charges when downloading stuff to your worker role instances.
The current Eclipse plugin has a setting for your worker role, where you specify blob storage for your JDK and web server. By doing this, it's basically a one-time setup (except when it's time to upgrade the JDK or Tomcat/Jetty version, and then you'll need to re-upload to blob storage). Once these bits are in blob storage, you only need to include your Java classes in your deployment package.
Hey guys I am trying to display a maintenance message on my web page while I wanna deploy an updated war, so the original war must go offline first and at the same time, client will get 404 not found error page...My question is, what is the most common way for website maintenance? Thanks!
PS: I am not specifying which server is being used, so it could be tomcat, jboss, websphere and etc.
Ideally, you'll want some kind of hot-deployment support so that your users won't ever notice a service interruption. Common methods of achieving this are:
Having multiple instances of the web application behind some kind of load balancer which directs incoming requests to a running instance. If you'd perform a deployment, you wouldn't take all instances offline at once, but sequentially take one instance offline, redeploy, restart, and repeat this sequentially for all other instances.
Code-based hot-swapping while the software is running. The Oracle's JVM has limited support for this (HowSwap). A popular commercial tool which enables redeployments (using more sophisticated mechanisms than HotSwap) of Java web apps is LiveRebel.
I have an existing Java application running on a linux box that monitors the state of relays and network information. This is a stand-alone device currently.
What I would like to further develop is a web server for the device to remotely monitor, configure, and control the device via an Ethernet connection. To achieve this, I need some way to interface between the web server, which could be configured as enabled/disabled, and the master device, which is always running.
Is there a good way to do this? I have looked at apache w/ tomcat and similar web servers but not sure if this is what I need. The key here is that the web server needs to be able to access the existing java application without interfering with its always running services.
You either develop a webapp, use your Java application's API inside the webapp, and deploy this webapp inside a web container. Or you can do the reverse and embed a web server inside your application (see here for documentation to embed Jetty).
If you want to keep the webapp and the original application in two separate JVMs, you'll need some wey to communicate between both, like sockets, RMI, or even files, but it will be more complex.
You might want to take a look at JMX http://docs.oracle.com/javase/tutorial/jmx/overview/index.html