Another instance of "Connection to database is invalid"

Questions, answers, tips and ideas on Servoy Client

Another instance of "Connection to database is invalid"

Postby RonG » Sat Oct 20, 2012 6:20 pm

Hi all, and good day,

I am getting the same error as reported by someone else on September 26. As suggested in the other thread, I did try setting "direct connection" in the Java Control Panel on both the server and the tester's PC, with no success this time.

I ran a trace on the app server to see if that would show anything else in the server log, and it didn't, really, but here's what I did find......

2012-10-20 15:24 http-8080-1 INFO com.servoy.j2db.util.Debug tracing disabled
2012-10-20 15:24 SocketAccepter1-thread-10 INFO com.servoy.j2db.util.Debug Compressing socket closed
2012-10-20 15:24 SocketAccepter1-thread-10 ERROR com.servoy.j2db.util.Debug SocketAcceptor failure for socket: 1901985[SSL_NULL_WITH_NULL_NULL: Socket[addr=/24.15.237.68,port=49946,localport=1099]]
Exception, see log file for full details: Unrecognized SSL message, plaintext connection?

And in the log was this....

2012-10-20 15:24:39,824 ERROR [SocketAccepter1-thread-10] com.servoy.j2db.util.Debug - SocketAcceptor failure for socket: 1901985[SSL_NULL_WITH_NULL_NULL: Socket[addr=/24.15.237.68,port=49946,localport=1099]] [ ]
javax.net.ssl.SSLException: Unrecognized SSL message, plaintext connection?
at sun.security.ssl.InputRecord.handleUnknownRecord(Unknown Source)
at sun.security.ssl.InputRecord.read(Unknown Source)
at sun.security.ssl.SSLSocketImpl.readRecord(Unknown Source)
at sun.security.ssl.SSLSocketImpl.performInitialHandshake(Unknown Source)
at sun.security.ssl.SSLSocketImpl.readDataRecord(Unknown Source)
at sun.security.ssl.AppInputStream.read(Unknown Source)
at java.io.BufferedInputStream.fill(Unknown Source)
at java.io.BufferedInputStream.read(Unknown Source)
at com.servoy.j2db.rmi.compressing.CompressingInputStream.readIn(CompressingInputStream.java:99)
at com.servoy.j2db.rmi.compressing.CompressingInputStream.read(CompressingInputStream.java:85)
at java.io.DataInputStream.readInt(Unknown Source)
at com.servoy.j2db.rmi.ServerTwoWaySocketFactory$SocketAcceptor.run(ServerTwoWaySocketFactory.java:422)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
2012-10-20 15:24:39,824 INFO [SocketAccepter1-thread-10] com.servoy.j2db.util.Debug - Compressing socket closed [ ]
2012-10-20 15:24:45,666 INFO [http-8080-1] com.servoy.j2db.util.Debug - tracing disabled [ ]

I looked in the wiki and I don't see anything that is obviously wrong, but this is also the 1st time I'm trying to get an app server up and running with a smart client. The web client does seem to be working ok, at least in its ability to start up. I would imagine that the problem is related to the "unrecognized SSL message", in the log, but I'm sure what that means or is corrected in the context of this coming out of the app server.

As always, any guidance that you can provide would be greatly appreciated.

Ron
Ron Gafron
Aspen Ridge Arts/WorkingArtist software
RonG
 
Posts: 198
Joined: Tue Feb 16, 2010 11:20 pm
Location: Chicago, Illinois, USA

Re: Another instance of "Connection to database is invalid"

Postby Andrei Costescu » Mon Oct 22, 2012 8:06 am

Did you try clearing the client's java cache and deleting the ".servoy" folder in the OS's user dir?
Andrei Costescu
Servoy
Andrei Costescu
 
Posts: 1018
Joined: Tue Jun 26, 2007 3:14 pm

Re: Another instance of "Connection to database is invalid"

Postby RonG » Mon Oct 22, 2012 2:54 pm

Hi Andrei,

Thanks for taking the time to respond. Appreciate it.

Over the weekend, I finally did get this figured out. I opened the Java Control Panel and deleted the Smart Client. In the network settings, I set "direct connection", and then re-installed the client. At that point, I was able to get, well, further. :-)

That opens 2 other questions for me....
1. Is using "direct connection" appropriate and safe for my application? This application is for individual users widely spread out, not a corporate intranet (if that matters).
2. Is there a way to set "direct connection" for the user so that they do not have to do this manually? Perhaps a command line of some sort that I can run in an installer?
So, some additional research to do.

On to the next issue as well, which is that the client is asking for a userid and password, which turns out to be the postgres userid and password for the owner of the database. I have to figure out how to either pass this through with the smart client installer, or not have this asked for in the first place. I'm going to research that a bit and perhaps put up a separate forum topic.

Thanks again for your response.

Ron
Ron Gafron
Aspen Ridge Arts/WorkingArtist software
RonG
 
Posts: 198
Joined: Tue Feb 16, 2010 11:20 pm
Location: Chicago, Illinois, USA

Re: Another instance of "Connection to database is invalid"

Postby Andrei Costescu » Tue Oct 23, 2012 8:32 am

Are you sure that it was not the "deleted the Smart Client" part that did the trick? I was thinking that you (didn't have a proxy setup and) tried it without SSL and then switched the server to SSL and the client could no longer connect.

About the "direct connection" setting. By default it uses the browser settings. I guess many people do not have a proxy set in the browser settings. If you have a proxy set there you might not be able to access the outside world except through that proxy. If changing to "direct connection" makes it work for you (no firewall blocking ports, ...) then I see no reason for it not to be safe. But I don't think there are many cases where you would need to (manually) change this setting - which might also affect other Java apps, not only Servoy.

A http proxy setup on the client will probably corrupt the content of this non-http RMI connection => although client and server try to discuss SSL, they can't. That's why the problem occurrs. If you have clients that are behind firewalls that block direct connections and they can only access the outside world through a proxy, you can set up HTTP tunnel in Servoy to be able to go through the proxy (depending on how invasive the proxy/firewall are, supplemental properties might be needed for tunneling).

The smart client always needs a user/password to be accepted on the server because more things are executed client-side then for web clients. You must either create a user/[group] in developer which will be used to start the solution in smart client or set up custom security for your solution.
Andrei Costescu
Servoy
Andrei Costescu
 
Posts: 1018
Joined: Tue Jun 26, 2007 3:14 pm

Re: Another instance of "Connection to database is invalid"

Postby e.valstar » Sat Apr 23, 2016 9:28 pm

Had the same problem.
Destroyed the .servoy from OS/users
Without any result.
I neede to change the JAVA properties (local) to "direct connection" as well.
Strange because before I could run this application on this machine. Overnight I needed to do so.....
e.valstar
 
Posts: 8
Joined: Mon Nov 17, 2014 9:52 pm


Return to Servoy Client

Who is online

Users browsing this forum: No registered users and 12 guests