How do I deploy a runnable jar in Amazon AWS? - java

I have an android client who sends a sentence to the server. Now this server does some processing and sends the string back to the Android client. I'm using basic client server communication for this, and it is working fine on the local machine. Now I want my server code to be deployed on a server so that I can provide that server address to my client code. The server is not a web app, it's a simple core Java project. As far as I understand, I'll have to deploy it as a runnable jar. But how do I do that using AWS?

Set up apache tomcat and use the deployment endpoint, namely /manager/text/deploy?path=/footoo&war=file:/path/to/foo.war to deploy the war.
If you'd rather deploy a runnable jar, set up an instance, install java on it, and put the jar onto said instance, before going in and using java -jar runnable-foo.jar in a screen session.

Related

eclipse run web service whereas runnable jar doesn't

I have developed a Java application that communicates with a distant web service while also starting a web service to subscribe to notification from the distant host.
It is a blackbox that I do not develop that does all the work therefore I cannot show any meaningful code.
My problem is that when I run my dummy application that wrap this blackbox from eclipse and simply connect to the remote host, it connects perfectly and start the notification webservice, whereas when I export this application into a runnable jar, it does not start the web service listening to the notification port.
Being new to the client/server application, I simply installed Tomcat to be my web server on which the web service should start but unfortunately, this does not work.
Is there something special about eclipse embedded web server that shall allow the web service to start compared to my tomcat?
Any help would be appreciated.
The problem came from a misunderstanding of the external jar I was using. It was it that embedded the soft to start the web service.
It was a depedency issue, now resolved.

Can Java Web Start be used to run server-side programs?

I have a Java application that needs to run the proprietary software PowerWorld on the server and then return output to the client side Web Start window. Is this possible? How do I go about doing this?
I am using Apache Tomcat to run the server. My Java code uses Runtime.exec() to run a Python script that runs PowerWorld. I made sure that the python script, powerworld file and java app are all in the same directory and reference each other using relative file paths
Java WebStart will install a desktop application into the cache of the client. That will run on the client not on the server, however you can easily create a webapplication as a service, i.e. on Tomcat. The webapp will be able to receive client requests, i.e. via RMI, RESTfull service or webservice, call the proprietary programm and return the results.

How to create a build of webservice cilent for linux server?

I have created web service client on my local machine by referring wsdl file placed in C drive. (JAX-WS) The code is running well on my machine. But the production server is linux machine. Hence i want to create web service client by giving relative path. Can anyone help in this case?
Put your WSDL in the project (hint: src/main/resources/wsdl/).
Use a tool such as Apache CXF to generate the client.
Build the project.
Distribute the built artifacts to various runtime environments - Windows/Linux/Solaris/Whatever.
Have a look at this example: http://qwerky-qwerky.blogspot.co.uk/2011/12/programming-without-programming-1.html

deploy java jax ws web service as stand alone server

i am new to webservice. i need your help to understand deployment process.
I have created a new webservice by using following tutorial
http://www.ibm.com/developerworks/webservices/tutorials/ws-eclipse-javase1/section2.html
web service is running fine in eclipse,
right now i am running this service by right clicking on endpoint class and run it as java application. i want to run this service manually because on our server we not going to install eclipse.
You need to bundle your web service implementation classes as jar and you need to deploy to any Java EE complaint servers like JBoss or GlassFish.
You need some web site to host your application. Eclipse is hosting it for you on your local machine but to use manually I assume you mean you want it on a real site?

How to deploy web service on two different system within a LAN?

I have created a web service using Netbeans in Fedora which is working fine in local host. But I want to deploy client on different computer and server on different computer.
I could also connect two Fedora systems using a LAN cable(SSH), but could not access the web service.
What is the procedure to deploy it? Does a webDav-http service connection be established? If so how to do that?
To deploy your project in a different machine, compile it, and the copy the war file to the application server you desire. I use Tomcat, just need to copy the war to the webapp folder, you should have something like in glassfish.
About the clients:
What are you using to generate the client? I assume metro, since is the default in netbeans.
Create a new java project;
Add new, Web Service Client;
Create it from the url: something like http://example.com.someService?wsdl.
Changing the ip you change the machine that this client will communicate to.

Categories