GWT + ProcessBuilder
Asked Answered
C

3

0

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
Caundra answered 10/3, 2010 at 0:39 Comment(0)
A
5

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.

Achene answered 10/3, 2010 at 0:50 Comment(4)
Can you explain a bit more about the RPC? How do I integrate the RPC with the rest of my GWT application?Caundra
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: code.google.com/webtoolkit/doc/latest/…Achene
Right; but where am I inserting the code that calls ProcessBuilder?Caundra
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. } }Achene
C
1

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.

Cherimoya answered 10/3, 2010 at 1:2 Comment(2)
Interesting -- I think this is the way I'm going to goCaundra
Nvm ... the project I'm integrating with needs AppEngine for DatastoreCaundra
N
0

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.

Nicko answered 10/3, 2010 at 0:44 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.