Getting "Gateway Timeout" and "Internal server error" for java callout with RMI Code

Not applicable

Hello,

I am using a java callout with "No-Target" API proxy which calls the RMI code from the java class,and gets the response from RMI server.That response is then returned to the client.

Code snippet ::

System.setProperty("java.security.policy",
                   "file://192.168.xx.xx/C:/Apigee-RMI-Client/security.policy");
System.setProperty("java.rmi.server.codebase",
                   "file://192.168.xx.xx/C:/Apigee-RMI-Server/target/classes/");
System.setSecurityManager(new SecurityManager());
Directory directory = (Directory) Naming
    .lookup("rmi://192.168.xx.xx/ABC");
String[] information = directory.getAdress();           
String response = information[0] + "\n" + information[1];
return response;

when i run this code locally it works. But when i deployed the proxy and tried to invoke the class i get

"Gateway Timeout" then after few hits i was getting "Internal server error" and recently i am getting SERVICE_UNAVAILABLE.

so if java code hit my ip from the apigee environment will it work or not ?

Can anyone suggest some pointers.

Solved Solved
0 3 557
1 ACCEPTED SOLUTION

The code will not work when run in an Edge cloud instance, because the RMI Server is local to your system, and is reachable via a private IP address.

Your Java code on Edge cloud cannot reach your RMI Server.

View solution in original post

3 REPLIES 3

@Anand Jayant Kadhi , It won't work. What you have given is local ip not a public ip. So it will time out.

Not applicable

Hi @Anil Sagar

I have also tried with PublicIp still getting the same error.

The code will not work when run in an Edge cloud instance, because the RMI Server is local to your system, and is reachable via a private IP address.

Your Java code on Edge cloud cannot reach your RMI Server.