How to upload multiple WAR files to Tomcat - web-services

We been using Tomcat to host our Java Web Services that our PHP website will call.
We have have few environments, meaning we have a few Tomcat Servers. Each time we change a Web Service we have to upload the WAR file to all the Servers. And it becomes a lot of work, for each server uploading one war file at a time.
Is there a way to upload multiple WAR files to Tomcat? And maybe later on I can write a program to do the uploading for us.
Any advice or links that can help, point me in the right direction will be appreciated.
Update
So I did a little more googling and found out that Tomcat allows you to send single request URI. A given example is:
http://localhost:8080/manager/text/deploy?path=/foo
For some reason its not working with me, keeps telling me access denied. Will keep trying

Search the net for this I came across Tcat that has this functionality:
Deploy multiple applications across servers. Rollback bad deployments
1.View complete deployment history
2.Rollback to earlier versions
3.Deploy, undeploy and redeploy multiple applications
Of course this is a paid software...

I found the solution, just copy the WAR files to the \webapps directory in Tomcat.
Windows: C:\Program Files\Apache Software Foundation\Tomcat 7.0\webapps
Linux: /var/lib/tomcat7/webapps
Tomcat will deploy the WAR files automatically. If it does not deploy automatically, then try restarting Tomcat.

Related

Cant Find my Axis2 Web Service deployed on OpenShift

I deployed a web service developed using Apache Axis2 on Openshift.
When I try accessing the axis2 index.jsp, I can see the index page which only contains the default Version.
Q:
How do I get to display the web service other web services I created as I can view them on my localhost through the browser in Eclipse?
I have done a few searches online and seen some suggestions as to making adjustments to axis2.xml. In that regard, I have tried changing the contextRoot parameter and the servicePath without no success though I am not too sure if I am making the right changes.
My project structure in Eclipse is shown below:
SieveService
+...
+Java Resources
++src
+++Model
++++some model classes
+++Services
++++SieveServiceService.java
++Libraries
+...
+WebContent
++axis2-web
+++...
I had the same problem and that's occurs because openshift's tomcat server only deploys services in aar format, meanwhile in localhost deploys aar and exploded files too.
You need to create a aar file with your services and put it into your WebContent/WEB-INF/services/ directory. You need to update the services.list file too with the name of your services.
After that you must see your services in your openshift server.

Auto-reloading WAR in Jetty standalone

I have a WAR deployed to Jetty 9.0.0.M3. I am trying to figure out what I need to set in my context in order to be able to have it reloaded every time I upload an updated war file (without having to restart Jetty).
I had a look at the docs, but I'm afraid I couldn't find what I was looking for. I only know how to do this with the embedded Jetty Maven plugin, but not with the standalone.
Any help would be appreciated! Thanks.
The key is in the deployer. You need to wire up the deployment manager functionality and have it manage the starting of the webapp.
http://git.eclipse.org/c/jetty/org.eclipse.jetty.project.git/tree/jetty-deploy/src/main/java/org/eclipse/jetty/deploy/providers/WebAppProvider.java
The jetty xml files are effectively a thin skin over java so look the following xml file which is what jetty uses for the traditional webapp startup of our distribution.
http://git.eclipse.org/c/jetty/org.eclipse.jetty.project.git/tree/jetty-deploy/src/main/config/etc/jetty-deploy.xml
This ought to get you fixed up.

Apache ODE BPEL Deployment with a webservice (file transfer)

I'd like to write a axis2 webservice for deploying BPEL Processes on a Apache ODE.
At the moment I have two main issues/questions.
I wrote a simple WS that creates a file.
It works fine in eclipse with a integrated apache tomcat with axis2.
But if I run the service on the exact same server without ecplise it won't work and I get 'Unhandled IOException' Errors, although I have the handling implemented (otherwise ecplise would cry about it all the time).
EDIT: I solved it by not uploading the service.aar with axis2 but putting it in the /webapps folder.
How do I get access to the folder were I need to put the BPEL files?
Is it obligatory that the service runs on the same server as the ODE?
EDIT: Getting access to the folder on the same server is an easy one with 1.
How do I transfer files with a webservice?
Better: How do I implement it?
Regarding 2) you can use the deployment API exposed by ODE. This allows for transfering deployment units (zip files containing BPELs, WSDLs, DDs) via SOAP to ODE and starting the deployment.
The WSDL is available at http://.../processes/DeploymentService?wsdl, on the default installation that would be http://localhost:8080/ode/processes/DeploymentService?wsdl

How do I enable multiple contexts in cloud foundry?

We'd like to set up a development environment using cloud foundry. Unfortunately, our architecture packages a few different wars into one webapp, each war running under its own context. Furthermore, we have a bunch of absolute URIs with the context in it, too many to rename all of them to relative URIs.
CF apparently deploys a war to the root context. Is there any way to get around this? I tried faking it by editing the web.xml in tomcat/conf/ but when I did a whole other application folder was created on my machine.
Thank you
When you push a Java web app to CloudFoundry, the platform installs and configures the Tomcat instance(s) for you, and you have limited control over the configuration. It is possible to configure your own Tomcat (or other application container) and push it along with your application instead of letting the platform do it for you.
There is a good blog post about using this bring-your-own-container approach with Tomcat 7: https://www.cloudfoundry.org/blog/deploying-tomcat-7-using-the-standalone-framework-2/.
I suggest using this approach to configure a Tomcat 6 or 7 distribution in a way that works for your application, zip up the customized Tomcat distribution along with your war files, and push that bundle as a stand-alone app on CloudFoundry.

webservice deployment issue

I deployed webservice written in .net language through IIS from my local machine,Is there any possible way to access remote HTTP server which contain different OS and different technologies
Sorry for being confused, but can you define:
different OS and different
technologies
Do you mean deploy your webservice to another host or
Do you mean consume a webservice from another host?
Option 1
If the host is not running IIS/ASP.NET I think you are going to have some issues as Mono may not run what your code base requires.
But you could try the following:
publish your site to a folder
zip up that folder
scp/ftp/upload this zip to the remote server
unzip the files (or upload individual files/folder) to directory configured by IIS Management
try to run
Option 2
You need to use either the svcutil tool to create the proxy clients to consume that webservice or you use the Add Web Reference in Visual Studio to automate this for you.
Hope this answers your requirements. Update your question with more information for the community to offer more support.
I think that is one of the main things that web services are for.