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.
Related
I want to create a simple strict service that tells the client if a PDF file is searchable or scanned images (not OCRed). Then I thought that the code is very simple and could run very fast, but the heavy lifting is in uploading the file especially if the file is large. Is there a way in Java and Spring to execute the code on the client's machine (if the client has JVM) by sending the code to the client to be executed and get the result?
Are you looking for Java Web Start?
https://www.java.com/en/download/faq/java_webstart.xml
The Java Web Start software allows you to download and run Java
applications from the web. The Java Web Start software:
Provides an easy, one-click activation of applications
Guarantees that you are always running the latest version of the application
Eliminates complicated installation or upgrade procedures
A signed Web Start application can request permissions to access local resources, native libraries and hardware.
To send the result back to server, you can simply have the Web Start application send it via HTTP[S]. The JNLP used to launch the Web Start application can be dynamically generated, so you can set parameters for the Web Start application, to have it send the parameter back to server, so you can identify which user session it is.
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'm planning to design a web interface to control my FFserver remotely. The question is, is it possible to start/stop the FFserver running on my Linux server using a Servlet running on the same machine?
I'm using Glassfish server and Java EE 7 for my web application. Currently I managed to get my web app to obtain http streams (which are started manually in terminal with predefined config file) and play them on the web. However, now I want to find a way to stop the streams and start the streams on demand.
Is it possible for me to run a Bash script via the servlet? Or are there any better solutions which allows Servlets to run linux commands in the servlet?
I have a bunch of shell scripts on every client machine. I need a web interface to provide settings for these scripts and it should invoke these scripts.
If i run a web application from a server to run scripts, it will overload the server due to multiple client requests, so client side web app is preferred.
Applets can solve this. But, it is outdated and I dont like it.
Is there any other new/good technologies to do such client side computing ?
Are you talking about web application or desktop application?
If this is a web application, so as far as I know - no. You must use applet embedded at your web page to run the script.
If desktop application - it can use the API for execution processes at Java.
Another option is maybe to download some small server code that will be used to invoke scripts, and have you web application communicate with it, in order to invoke a process.
The downside of this is that this is not a "straightforward" usage of your web application.
I have a rails app that talks to an api running on the same domain via ajax calls. I want to test this app using cucumber. The api is written in java and packaged as a jar. How can I mount the jar when using cucumber?
There is no way to do it automatically but you can add Before hook into env.rb or put it into separate file and in this method you can load your java extension by issuing shell command, you can store process pid in variable and kill this process in After callbalk. You can configure Capybara to start server on specific port and I think you can tune your application to use specific port too.