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.
Related
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.
I have java code (that generates jasper reports) and I couldn't convert it to .net and I want to run it on a "Cloud Services" how can I run java code into cloud service ?
any help will be appreciated
#Dhana provided a link to a tutorial for pushing a Java app to Azure in Cloud Services (worker role). You could also push to a Web role but it makes less sense since IIS runs in a Web role, and you'll probably want Jetty, Tomcat, or JBoss for your web server.
If you're running a console app, that's fine too - just launch it from a startup script or the OnStart() in your workerrole.cs.
You'll need to install the tooling into Eclipse. At this point, you'll be able to build Azure deployment packages, in a similar way to Visual Studio (The Azure plugin for Eclipse only works on Windows though). Part of the packaging sets up links to the appropriate JVM and web server package, as well as your own jar files.
If, say, you have a console app that listens on a port, you'll just need to make sure you have an input endpoint set up for the port you want to expose.
I have a stand alone Java application that needs to get information (string data) from a Java EE application, running on a Glassfish 3.1 Application server. I have created a web service for my Java app, but I'm wondering how I could achieve communication with the Java EE glass fish app (using servlet?).
I hope to have a method on my app that can be called from, for example, a client running on glassfish (and vice-versa). This method would have something like a String array as parameter, so that I would be able to pass the data between the apps.
Note: I am unable to deploy my app on Glassfish, since we are trying to achieve separation till we are sure the application I am developing will not cause Glassfish to crash ( we currently have other critical apps running on Glassfish). Also note that this is all taking place on the same machine.
You should develop a web service and deploy it on Glassfish within your existing application. You can do this via a Servlet based web service, or a Session Bean web service, whichever is more appropriate for you.
You will then create a web service client against that web service for your Java app, and integrate it appropriately with calls to the servers via the web service.
Of course, this should all be done against development servers, not your production servers. Glassfish can be deployed pretty much anywhere: your machine, another machine, a VM, in "the cloud". Not having a development server available for, well, development is unacceptable. There is no way you can determine if your app will "crash Glassfish" unless you can test it.
To quote the esteemed Donald Knuth: "I have only proved it correct, not tried it."
Get a test server, develop against it. Move forward.
Have you looked at the URL class.
try this url Java URL example
This may help
I have created webservice using following link
http://www.ibm.com/developerworks/webservices/tutorials/ws-eclipse-javase1/section2.html
When i am running a endpoint publish class as java application in eclipse (in my case it is a runservice.java), web service is running fine.
i have created a client for the same webservice client is communicating with webservice properly.
I want to run this endpoint class with jboss or with tomcat without eclipse, it is possible to do this.
Please help.
Notice that the tutorial states that it is a tutorial on how to run a "stand alone webservice application". Since what you are creating is not a java web application but is instead a JavaSE application you will not be able to deploy it to an application server. You will have to create a java web application in order to do that.
Eclipse WS Tutorial
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?