How to deploy the Web service in to tomcat 7 from out side of eclipse juno? - web-services

i am very new to web services and i have one problem please suggest me .. i.e i have a WSDL(SOAP) file and with that i created the Web Service-server and web service-Client using Top-Down approach with JAX-WS in eclipse Juno Java EE. i integrated the Tomcat 7 with that Eclipse and from eclipse its working fine.
But my problem is i need to run the Tomcat from out side of the eclipse and i need to deploy the web service in to the tomcat. i don't want to run the Tomcat using eclipse? i just need to run the client from eclipse but i dont want to run the tomcat from eclipse. Please Help me.

File -> Export -> Web -> War (configure where to create it)

Deploying a tomcat application consist of building a war file then deploying it. We call this servlet.
Building the WAR
As you already have your server code, you should now complet the WEB-INF/web.xml file. This file describe the path of your servlet(your server code), on the tomcat server. Depending of your framework you can have some configuration to add in your META-INF/context.xml file.
In an eclipse project, thoses file are generaly under a directory name 'webapp' in your project. (src/main/webapp for a maven project).
First you must use the javaee & javaweb tools of eclipse to build a war file that contains all yours libs, files, class and web.xml
Alternativly you can use a maven build process to get a war, if you use maven.
Deploying the war
After installing tomcat, the deployement is as simple as drop the .war file is deploy directory of the home-directory of tomcat. Then your application is usable on default port 8080.
If you have install also the manager webapp of tomcat, you can see all yours currently deployed application in the manager http://myurl:8080/manager/html.
When you install tomcat, let be sure that your eclipse pseudo server is shutdown, or your tomcat server will have problem to get it's port and startup.

Related

How to deploy KinesisAutoscaling.war on Java Application Server or Tomcat?

I want to manage kinesis shards automatically so I want to deploy KinesisAutoscaling.war on Tomcat. I found steps(https://github.com/awslabs/amazon-kinesis-scaling-utils) to deploy at Elastic Beanstalk.
Similar way I want step by step solution to deploy on Tomcat.
I was able to slow this problem using below steps.
Downlaod the code from here.
Open the project as Maven project in eclipse
Change the stream configuration in the configuration.json and provide the path of configuration in AutoscalingController.java like below
String configPath = "C:\
amazon-kinesis-scaling-utils-master\conf\configuration.json";
Build the project and place .jar file to the webapps folder of tomcat and start tomcat.

How to add a second web app with jetty alongside with geoserver?

I deployed the Platform Independent Binary of GeoServer on ubuntu. To launch geoserver, I would just run this script /usr/share/geoserver/bin/startup.sh
So no jetty is actually installed. Geoserver web app can be accessbile via http://localhost:8080/geoserver/web
I wonder how I can configure a second web app which takes this path http://localhost:8080/upload/index.html
Ideally, I would like python and perhaps PHP are supported.
Any tips is appreciated. Thanks.
You can add any other war files to geoserver_dir/webaps/ and Jetty will unpack and run them like any other servlet.
I have no idea how you would add python and PHP to that set up. Maybe you would be better off looking at running tomcat and apache and using the GeoServer war file there.

spring boot application deploy to dedicated jetty instance

How to deploy "war" file built with spring boot to jetty? I am unable to access restful services of my spring boot application when I deploy the war file to jetty.
Steps I followed:
Referring to Spring boot war documentation I created a war file. I could see the files are available in the war file.
Copied the war to ${jetty home}/webapps. (/usr/share/jetty/webapps)
Added a contexts.xml file with my war name (excluding .war suffix)
Restarted Jetty service
When I browse localhost:8080 I see folder structure of my web app. (i.e WEB-INF resources)
None of spring resource paths are available from localhost. My spring application has JAX-RS resource. Below is my ApplicationInitializer class (Groovy).
class ApplicationInitializer extends SpringBootServletInitializer {
#Override
protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
Properties props = getPropertiesFromArgs()
return new SpringApplicationBuilder([Application, "classpath:/META-INF/com/foo/testapp/bootstrap.xml"] as Object[])
.properties(props)
}
Its as-if jetty start did not start spring context. What am I missing? Application works fine if I run the spring boot built uber jar. I can access all restful resources of the app.
Figured out. I was not using Servlet 3.0 compliant jetty version. sudo apt-get install jetty pulled 2.5 compliant version. Once I updated to Jetty 9.x, it worked fine.

where to place clientaccesspolicy.xml file into the apache tomcat server deployed in eclipse IDE

I have a silverlight application and i want to call a apache cxf web service written in java in my eclipse and published on apache tomcat 7.0 through eclipse.
so now when i call this web service from my silverlight application from visual studio 2010 i get follwing error:
An error occurred while trying to make a request to URI 'http://localhost:8080/complesxtypeWebService/services/CompanyServicePort'. This could be due to attempting to access a service in a cross-domain way without a proper cross-domain policy in place, or a policy that is unsuitable for SOAP services
when i search for this on web i found that i need to place clientaccesspolicy.xml file in the root directory of domain service.
so my problem is where to place this xml file . can it be placed somewhere in eclipse project folder or somewhere in apache tomcat folder. please let me know where to actually place this file.
my all development are done locally and everything is being tested locally.
thanks
vicky
I placed the clientaccesspolicy.xml file in C:\Program Files\Apache Software Foundation\Tomcat 6.0\webapps\ROOT and it works for me.
Please note that this is Windows 7 PC and if I remove the file, I get the dreaded cross domain error.

how to run metro webservice on jetty in Maven project?

how to run metro webservice on jetty in Maven project??
As per this source.
If you place your web service in a WAR file, like here, it should run fine
on Jetty, just as it would on any servlet container. There might be some
subsequent Jetty-specific configuration needed, but I would try to deploy
the WAR first on Jetty and see where it gets you.
If you want to embed Jetty, instead of running on Jetty standalone, this
might give you some pointers.