views:

70

answers:

3

Hi, I am trying to run a .exe from the server side on GWT but it is giving me a access denied error.Exact error is :-

java.security.AccessControlException: access denied (java.io.FilePermission <> execute) at java.security.AccessControlContext.checkPermission(Unknown Source) at java.security.AccessController.checkPermission(Unknown Source) at java.lang.SecurityManager.checkPermission(Unknown Source) at com.google.appengine.tools.development.DevAppServerFactory$CustomSecurityManager.checkPermission(DevAppServerFactory.java:166) at java.lang.SecurityManager.checkExec(Unknown Source) at java.lang.ProcessBuilder.start(Unknown Source) at java.lang.Runtime.exec(Unknown Source) at java.lang.Runtime.exec(Unknown Source)

and this is what is printed in error->"error===access denied (java.io.FilePermission "ALL FILES" execute)"

I even tried to change the security permissions of the file by changing the java.policy file(Here) but it still gives the same error.I added these lines -

grant { permission java.io.FilePermission "C:\Documents and Settings\User\Desktop\ABCD.exe", "execute"; };

I have also tried to place it under /war/WEB-INF but in vain.Some searching on the net led me to the fact that google app engine might be the cause for this . Can someone help me with this?
p.s. I saw a similar post (Here )which mentions that something like this should be possible on the server side.

+3  A: 

This has nothing to do with GWT. Your server is the Google App Engine dev server, and you are not allowed to run an executable on Google App Engine.

To quote the Google App Engine java overview page

The JVM runs in a secured "sandbox" environment to isolate your application for service and security. The sandbox ensures that apps can only perform actions that do not interfere with the performance and scalability of other apps. For instance, an app cannot spawn threads, write data to the local file system or make arbitrary network connections. An app also cannot use JNI or other native code. The JVM can execute any Java bytecode that operates within the sandbox restrictions.

Robert Munteanu
So is there some work around for this ?I am almost close to completing my project if this thing works out....
Manish
@Manish: Executable are not allowed by Google App engine by policy. This is not a technical shortcoming, but a conscious choice by Google. One option is to code the functionality of your executable into your Java app. Basically anything that runs server side on GAE has to be your code.
MAK
@Manish: this will _not_ work out in this format. You simply can't execute `.exe` files on Google App Engine.
Robert Munteanu
Well I created the .exe from some native code on windows platform. certainly I cant have that functionality with normal java code(or GWT for that matter).Also as mentioned in the article above JNI wouldnt be possible.Starting the whole thing again at this time would be a heartbreak!:(
Manish
That's what happens when you don't research enough in the planning stage...
Thorbjørn Ravn Andersen
+1  A: 

Your issue is not with GWT but the app engine development environment. Google App Engine Environment is designed keeping in mind scalability, hence the application is totally abstracted from everything ranging from the server hardware to the operating system.

In short what you are trying is not achievable on GAE.

If this question is anyway related to this, and if your objective is a quick and dirty GWT prototype with no intention to deploy on appspot.com then you may try a plain GWT project without GAE. Runtime.exec command should execute normally on jetty without any tweaking (provided you create the web application project with just GWT and no GAE support).

That said if your objective is to run on App Engine, then you are totally headed in the wrong direction. What you are trying to achieve is impossible.

Ashwin Prabhu
A: 

You do realize that Google runs linux everywhere? Also, what exactly can't you do in Java or Python that you need a Windows native applicaiton?

fgd