Hi Bart,
After reading that web page more carefully, I realized that the simple java program on your home page (that I was following) uses a constructor for GatewayServer that assumes localhost as the server host:
GatewayServer server = new GatewayServer(app);
In order to run the server on another host, I also need to change my GatewayServer constructor call in my java code. I should have sent you my java code before. You would have realized my problem right away. Here is the new java code I used to start a server on a host other than localhost, using the default port, and not enabling any python callback functionality:
package demo;
import java.net.InetAddress;
import java.net.UnknownHostException;
import py4j.GatewayServer;
public class SimpleServer {
public int addition( int first, int second ) {
return first+second;
}
public static void main( String[] args) {
SimpleServer app = new SimpleServer();
GatewayServer server = null;
try {
InetAddress host = InetAddress.getLocalHost();
server = new GatewayServer(app, 25333, 0, host, null, 0, 0, null );
System.out.println( "GatewayServer for " + app.getClass().getName() + " started on " + host.toString() );
}
catch (UnknownHostException e) {
System.out.println( "exception occurred while constructing GatewayServer()." );
e.printStackTrace();
}
server.start();
}
}
It all works beautifully now. Thank you so much!
Jim