payara / Payara-Examples

Repository for Example Code to demonstrate Payara specific features
144 stars 177 forks source link

Remote EJB connection from client application #48

Closed marchenar closed 6 years ago

marchenar commented 7 years ago

Hello,

I deployed a Java EE application (ear file) on Payara version 171 on Ubuntu, the client application is written in Java + JavaFx and it works perfect on local LAN. And now my customer is asking to run the the client application remotely, so I created a virtual host using no-ip and configure the port, but when the application hangs doing the lookup, while if I check the port 3700 (netstat -atun | grep 3700) connection was established correctly. Following I put the code I use to connect:

Properties props = new Properties();
props.setProperty("java.naming.factory.initial",
                        "com.sun.enterprise.naming.SerialInitContextFactory");
props.setProperty("java.naming.factory.url.pkgs",
                        "com.sun.enterprise.naming");
props.setProperty("java.naming.factory.state",
                        "com.sun.corba.ee.impl.presentation.rmi.JNDIStateFactoryImpl");
props.setProperty("org.omg.CORBA.ORBInitialHost", appServerHost);
props.setProperty("org.omg.CORBA.ORBInitialPort", appServerPort);
props.setProperty("com.sun.corba.ee.transport.ORBWaitForResponseTimeout", 
                       "5000");
props.setProperty("com.sun.corba.ee.transport.ORBTCPConnectTimeouts", 
                       "100:500:100:500");
props.setProperty("com.sun.corba.ee.transport.ORBTCPTimeouts", 
                       "500:2000:50:1000");
InitialContext ctx = new InitialContext(props);
String ejbName = "java:global/Argos-ear/Argos-ejb/CoreServicesImpl!"
                        + "ar.com.bywind.lib.services.CoreServices";
System.out.println("Lookup the bean " + ejbName);
CoreServices remoteCoreServices = (CoreServices)ctx.lookup(ejbName);

Notes:

Has Payara the same problem? Have you any document how to solve this problem?

Thanks in advance, Roberto

fturizo commented 7 years ago

Greetings @marchenar. This issue has indeed been reported by several users and is a known issue reported on the Glassfish - CORBA modules shipped with Payara Server. Our developers have been working to fix this issue, however, since this issue was caused by many design flaws introduced in the networking code for CORBA managed communications; it will be a while for it to be patched properly. In the meantime you can apply the workaround I recommended to another user here.

smillidge commented 7 years ago

Also 171.1 just released has some related fixes. Please try that.

marchenar commented 7 years ago

Thank you very much! ... I will install version 171.1 this week to check if it solves my problem

marchenar commented 7 years ago

I installed payara version to 171.1 and the problem persist ... that is ... as shown in the attachment ... the connection established but lookups never returns the remote object reference. Any ideas? Should change any entry in the glassfish-acc.xml or any other payara configuration file in the server side? I am using no-ip DDNS to establish the remote connection and firewalls are not running either in the server or in the router. payara_remote.pdf

lprimak commented 7 years ago

@marchenar If your server is behind a NAT, CORBA architecture doesn't support this kind of communication, and I don't believe there is a workaround of any kind. 171.1 should work out-of-the-box from WANs without a NAT though

smillidge commented 6 years ago

Not related to Payara Examples