How to run java applications in Google App Engine? - java

I have created a simple Java application containing buttons, text fields and so on. I have created the JAR file and also the JNLP file for it and had it signed by Jarsigner.
Now I want to be able to run the java application (Java Web-Start) from a Google App Engine project. I used:
< a href="/.../mycode.jnlp">Launch application< /a>
This would work on a normal html page but does not work on my Java App Engine project which uses JSP pages. If I click the link on App Engine, it just downloads the JNLP file and doesn't run the java program.
I have searched for solutions to this to no avail. Any help would be appreciated!

Related

Parsing text from PDF file in application hosted in Google App Engine

I am working on uploading a PDF file (available in machine locally/in Google Drive), saving it and then parsing the text from it. This text will then be used in writing to a word doc.
These functionality are working in my locally hosted application. However, after I deployed it in Google App Engine, I am no more able to parse a PDF file.
How can I read a PDF file in a Java application hosted in Google App Engine.
In Tomcat parser -
new PDFParser(new RandomAccessFile(file,"r")); //allow to read and parse pdf
In GAE-
new PDFParser(new RandomAccessFile(file,"r")); //throwing access denied..
Programs running in Google App Engine may not do everything that a program on a local work station can. E.g. there obviously is no normal GUI which can be a hindrance to code using AWT, even if only to create an image file or interpreting font information!
Thus, programs and libraries not developed with GAE in mind may fail when deployed to GAE.
Some libraries have special versions for use with GAE, e.g. for iText there is iTextG.
As there are similar restrictions on Android, switching to an Android version of one's library may also help.
As a bottom line, when developing for GAE you have to check whether your libraries are compatible with GAE. If they aren't, you have to switch, either to GAE (or Android) versions of them or other libraries altogether.

Migration of Java Applets to Java WebStart and GWT

I have an application that uses a "signed" applet which is packaged inside a jar that does the following things:
Checks whether the file exists in the directory while uploading a file and opens a form for details.
An applet is included in JSP and checks the file exists in local system by getting storage path while uploading.
Checks whether the applet is active and downloads the file to local system.
Add files to application that will be stored as local copy in file system.
As the support for applets is getting removed, I would want to migrate from applets. I would like to know is Java Web Start the best option for replacing applets in terms of "security, trusted code" and signature. Are there any other technologies that comes useful for my application in the above areas?
Also found that
Migrate Java Applet to what/where?
Replace Applet in downloading and executing a file
Any suggestions on this?

Run applet java in html

I have an applet java displaying images from folder ,i cant run this applet using html i have this error :
The error you are getting is because your applet is trying to read a file from a directory in the local system where it is getting downloaded. This is a standard security feature. This of this way, you go to a website which downloads an applet and read a file or executes an .exe in your local system. Naturally this should not be allowed for an applet / javascript or code served from a server.
You need to create a signed applet. Please go through the following link to accomplish your need :
http://www.developer.com/java/other/article.php/3303561/Creating-a-Trusted-Applet-with-Local-File-System-Access-Rights.htm

Packaging a Java app. w/DB to run on client machine

I made a simple java desktop application using embedded database. I wanted to package all files into a single file like exe so that client can click just on one file and use the application. I made the jar file and its working fine on my system when double clicking. I wanted to package the DB file along with jar because the data is shown only when the DB file is in the same folder of jar file.
I came across several tools like launch4j, install4j etc. but I didn't find where to include the DB file along with the package.
It sounds like you want an installer of some description, such as IzPack. This would allow you to package both jar and database together, and install them on a client system.
A good way to deploy rich client (e.g. Swing/AWT) apps. that require some set-up (as in, installing a DB) is by using Java Web Start.
JWS offers the ExtensionInstallerService which..
..is used by an extension installer to communicate with the JNLP Client. It provides the following type of functionality:
Access to prefered installation location, and other information about the JNLP Client
Manipulation of the JNLP Client's download screen
Methods for updating the JNLP Client with the installed code
Here is a demo. of the EIS (with code, build file etc.).

Is it possible to embed a jar file inside a flex application?

I have a great idea and I want to build a flex application around a .jar file. Is there a way I can go by embedding a jar file into the flex application?
There are ways to embed assets into a Flex application, however most people use this for images or other visual assets. I do not believe that jar is supported. Java and ActionScript are very different and you wouldn't be able to load a jar inside the flash player and execute it as a program or run commands against it.
If this is an AIR application, you may be able to do something using NativeProcess. But, such an approach is not the same as embedding a jar file in a Flex Application. It is taking your file and wrapping it up in an AIR installer and then communicating with that file as it runs natively on the machine.

Categories