Problem connecting to smart client on EC2 instance

Trying to do some evaluation on using EC2, and followed Devlin’s video instructions on setting up, but I’m still having some problems connecting to my smart client with the following error in my java console

java.net.ConnectException: Connection timed out: connect
	at java.net.PlainSocketImpl.socketConnect(Native Method)
	at java.net.PlainSocketImpl.doConnect(Unknown Source)
	at java.net.PlainSocketImpl.connectToAddress(Unknown Source)
	at java.net.PlainSocketImpl.connect(Unknown Source)
	at java.net.SocksSocketImpl.connect(Unknown Source)
	at java.net.Socket.connect(Unknown Source)
	at com.sun.net.ssl.internal.ssl.SSLSocketImpl.connect(Unknown Source)
	at com.sun.net.ssl.internal.ssl.SSLSocketImpl.<init>(Unknown Source)
	at com.sun.net.ssl.internal.ssl.SSLSocketFactoryImpl.createSocket(Unknown Source)
	at com.servoy.j2db.rmi.SignallingChannel.connect(SignallingChannel.java:141)
	at com.servoy.j2db.rmi.SignallingChannel.<init>(SignallingChannel.java:49)
	at com.servoy.j2db.rmi.ClientTwoWaySocketFactory.establishSignallingChannel(ClientTwoWaySocketFactory.java:138)
	at com.servoy.j2db.rmi.DefaultClientSocketFactoryFactory.initRMISocketFactory(DefaultClientSocketFactoryFactory.java:50)
	at com.servoy.j2db.rmi.DefaultClientSocketFactoryFactory.<init>(DefaultClientSocketFactoryFactory.java:36)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
	at java.lang.reflect.Constructor.newInstance(Unknown Source)
	at com.servoy.j2db.smart.J2DBClient.initRMISocketFactory(J2DBClient.java:807)
	at com.servoy.j2db.smart.J2DBClient.startupApplication(J2DBClient.java:744)
	at com.servoy.j2db.smart.J2DBClient$5.run(J2DBClient.java:669)
	at com.servoy.j2db.smart.J2DBClient.mainImpl(J2DBClient.java:693)
	at com.servoy.j2db.smart.J2DBClient.main(J2DBClient.java:657)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at com.sun.javaws.Launcher.executeApplication(Unknown Source)
	at com.sun.javaws.Launcher.executeMainClass(Unknown Source)
	at com.sun.javaws.Launcher.doLaunchApp(Unknown Source)
	at com.sun.javaws.Launcher.run(Unknown Source)
	at java.lang.Thread.run(Unknown Source)
ERROR - Debug                      - Already factory registered com.servoy.j2db.rmi.ClientTwoWaySocketFactory
java.net.ConnectException: Connection timed out: connect
	at java.net.PlainSocketImpl.socketConnect(Native Method)
	at java.net.PlainSocketImpl.doConnect(Unknown Source)
	at java.net.PlainSocketImpl.connectToAddress(Unknown Source)
	at java.net.PlainSocketImpl.connect(Unknown Source)
	at java.net.SocksSocketImpl.connect(Unknown Source)
	at java.net.Socket.connect(Unknown Source)
	at com.sun.net.ssl.internal.ssl.SSLSocketImpl.connect(Unknown Source)
	at com.sun.net.ssl.internal.ssl.SSLSocketImpl.<init>(Unknown Source)
	at com.sun.net.ssl.internal.ssl.SSLSocketFactoryImpl.createSocket(Unknown Source)
	at com.servoy.j2db.rmi.ClientTwoWaySocketFactory.createSocket(ClientTwoWaySocketFactory.java:198)
	at sun.rmi.transport.tcp.TCPEndpoint.newSocket(Unknown Source)
	at sun.rmi.transport.tcp.TCPChannel.createConnection(Unknown Source)
	at sun.rmi.transport.tcp.TCPChannel.newConnection(Unknown Source)
	at sun.rmi.server.UnicastRef.newCall(Unknown Source)
	at sun.rmi.registry.RegistryImpl_Stub.lookup(Unknown Source)
	at com.servoy.j2db.smart.J2DBClient.connectApplicationServer(J2DBClient.java:1739)
	at com.servoy.j2db.smart.J2DBClient.startApplicationServer(J2DBClient.java:1718)
	at com.servoy.j2db.ClientState.applicationServerInit(ClientState.java:290)
	at com.servoy.j2db.smart.J2DBClient.applicationServerInit(J2DBClient.java:1075)
	at com.servoy.j2db.smart.J2DBClient.startupApplication(J2DBClient.java:750)
	at com.servoy.j2db.smart.J2DBClient$5.run(J2DBClient.java:669)
	at com.servoy.j2db.smart.J2DBClient.mainImpl(J2DBClient.java:693)
	at com.servoy.j2db.smart.J2DBClient.main(J2DBClient.java:657)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at com.sun.javaws.Launcher.executeApplication(Unknown Source)
	at com.sun.javaws.Launcher.executeMainClass(Unknown Source)
	at com.sun.javaws.Launcher.doLaunchApp(Unknown Source)
	at com.sun.javaws.Launcher.run(Unknown Source)
	at java.lang.Thread.run(Unknown Source)
ERROR - Debug                      - Connection failed to: ec2-174-129-127-127.compute-1.amazonaws.com:4888 with endpoint: Endpoint:ec2-174-129-127-127.compute-1.amazonaws.com:4888, waiting a bit (4s)

I’ve got 8080, 1099 and 4888 all open for TCP, but this still feels like some sort of port error that I’m missing.

Anyone have any insight for me?

Hi

What are your Network settings in they Servoy admin page?

Regards

Just your basic out of the box settings

hostname: 127.0.0.1
rmiStartPort: 4888
timeout: 20
pingDelay: 100
useTwoWaySocket: 1
compress: 1
useSSL: 1
tunnelConnectionMode: http

I use the following to check if my ports are actually open.

http://canyouseeme.org/

Visit this from the Amazon box, it will tell you if it can see your ports listening from the internet, to rule out firewall issues.

Hm.

It does appear that when I use that site I get timeouts on both 1099 and 4888 (but not 8080).

I’m at a loss for why this would be since all of the ports are open for TCP traffic according to my Security Group settings…

Pm me if u like and we can talk on skype this afternoon. We had similar probs a while back

you could just enable the tunnel itself (in http mode) then it will only talk over 8080
If you set up the tunnel in http&socket then you can test it easy by making 1 or 2 profiles so that you can say in the url which port (http:8080 or socket:1099) it should use.

I may be late on this, but do you have the ports also open on your EC2 Management Console under your security group for the EC2 instance?

This has been resolved after much tweaking, but I believe int he end it was a problem with how RMI was setup.