views:

203

answers:

3

Hi all,

Is it possible to use ProcessBuilder with GWT? When I declare an instance of a new ProcessBuilder, I get:

java.lang.ProcessBuilder is not supported by Google App Engine's Java runtime environment
A: 

The error message is pretty clear that Google App Engine doesn't support this.

Trying to find a workaround for using ProcessBuilder is a bad idea, why do you want to actively circumvent your host's policies? Sounds like a way for the host to not want to host you anymore.

It's possible that there are better or other ideas on how to accomplish whatever you need ProcessBuilder for, you could probably post about them here to get some suggestions.

matt b
+4  A: 

Your question is about GWT supporting ProcessBuilder, but the error you get is from Google App Engine and not GWT related.

If you are using ProcessBuilder from a GWT RPC method you shouldn't have any problems. However, you are using Google App Engine as your application server. Google App Engine doesn't support ProcessBuilder, and a bunch of other things are not supported by GAE.

Check out the Will it play in Google App Engine? as a reference to know if your particular feature is supported in GAE.

It's important to note that ProcessBuilder is not supported by Google App Engine. GWT uses regular Java in its RPCs so ProcessBuilder can be used there.

Cesar
Can you explain a bit more about the RPC? How do I integrate the RPC with the rest of my GWT application?
Michael
Remote Procedure Calls (RPCs) are the main mechanism GWT uses to communicate with the server. A RPC is regular Java bytecode running on the server thus you can use basically any Java class as part of your RPC code. Read more on the official documentation: http://code.google.com/webtoolkit/doc/latest/DevGuideServerCommunication.html
Cesar
Right; but where am I inserting the code that calls ProcessBuilder?
Michael
Inside your class that extends RemoteServiceServlet:public class MyServiceImpl extends RemoteServiceServlet implements MyService { public void myMethod(String s) { //Use ProcessBuilder here, or whatever you need. }}
Cesar
+1  A: 

If you are not building your project for deployment on Google App Engine, turn off GAE in the Google plugin for eclipse.

The google eclipse plugin is for GWT and GAE. At project properties -> Google, you could click on/off to enable/disable use of GAE or GWT.

If you are building only for GWT only and not for deployment on Google's web hosting service, turn off the GAE feature.

Blessed Geek
Interesting -- I think this is the way I'm going to go
Michael
Nvm ... the project I'm integrating with needs AppEngine for Datastore
Michael