MySql could not create a validated object.

Post here your questions about SFS2X. Here we discuss all server-side matters. For client API questions see the dedicated forums.

Moderators: Lapo, Bax

genar
Posts: 84
Joined: 13 Jul 2017, 11:49

MySql could not create a validated object.

Postby genar » 17 Oct 2017, 16:36

Hey there !

So i installed MySql on my machine. Its running on localhost:3333 and the database is called "parallelorigin" which contains one table called "players". I also configured the Databasemanager of sfs.

Unbenannt.PNG
(18.46 KiB) Not downloaded yet


But somehow i always get this error log :

Code: Select all

Tue Oct 17 18:38:28 CEST 2017 WARN: Establishing SSL connection without server's identity verification is not recommended. According to MySQL 5.5.45+, 5.6.26+ and 5.7.6+ requirements SSL connection must be established by default if explicit option isn't set. For compliance with existing applications
 not using SSL the verifyServerCertificate property is set to 'false'. You need either to explicitly disable SSL by setting useSSL=false, or set useSSL=true and provide truststore for server certificate verification.
18:38:28,426 ERROR [main] db.SFSDBManager     - java.sql.SQLException:
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
Exception: java.sql.SQLException
Message: Cannot get a connection, pool error: Could not create a validated object, cause: ValidateObject failed
Description: The DBManager Test SQL failed: SELECT * FROM players
Please double check your SQL code and make sure that Database server is running.
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::


Its my first time that i work with sfs and mysql, so i have no clue what im doing wrong... any ideas ?
User avatar
Lapo
Site Admin
Posts: 20426
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: MySql could not create a validated object.

Postby Lapo » 18 Oct 2017, 06:57

This is new :)
Apparently some of the most recent MySQL Drivers use an SSL connection by default (even on localhost) which causes issues because of the relative SSL certificates.

My suggestion for now would be to use a slightly older version of the MySQL connector, such as 5.0.8:
https://dev.mysql.com/downloads/connector/j/5.0.html

We'll investigate this further and see how to deal with this issue in a more thorough way, maybe with an extra database setting in the admin or something similar.
Lapo
--
gotoAndPlay()
...addicted to flash games
genar
Posts: 84
Joined: 13 Jul 2017, 11:49

Re: MySql could not create a validated object.

Postby genar » 18 Oct 2017, 14:06

Lapo wrote:This is new :)
Apparently some of the most recent MySQL Drivers use an SSL connection by default (even on localhost) which causes issues because of the relative SSL certificates.

My suggestion for now would be to use a slightly older version of the MySQL connector, such as 5.0.8:
https://dev.mysql.com/downloads/connector/j/5.0.html

We'll investigate this further and see how to deal with this issue in a more thorough way, maybe with an extra database setting in the admin or something similar.


Thanks ! So i replaced the jar but now i get this error here :

Code: Select all

16:14:36,208 ERROR [main] db.SFSDBManager     - java.sql.SQLException:
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
Exception: java.sql.SQLException
Message: Cannot get a connection, pool error: Could not create a validated object, cause: ValidateObject failed
Description: The DBManager Test SQL failed: SELECT * FROM players
Please double check your SQL code and make sure that Database server is running.
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::


The MySql erver is running on localhost:3333... i guess... the workbench says that. Any ideas ? It contains the database "parallelorigin" with the table "players". :/
User avatar
Lapo
Site Admin
Posts: 20426
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: MySql could not create a validated object.

Postby Lapo » 18 Oct 2017, 14:14

This is the same error you posted before, only the first time you posted the whole thing.
Did you try using a different version of the mysql driver?
Lapo

--

gotoAndPlay()

...addicted to flash games
genar
Posts: 84
Joined: 13 Jul 2017, 11:49

Re: MySql could not create a validated object.

Postby genar » 18 Oct 2017, 14:27

Lapo wrote:This is the same error you posted before, only the first time you posted the whole thing.
Did you try using a different version of the mysql driver?


Ouh wait ... yes .... didnt noticed that. Yep, as i said i use the version you recommend me. Smartfoxserver is running and the mysql server too... So i have no damn clue why it wont work...

Its solved now ! :)
User avatar
Lapo
Site Admin
Posts: 20426
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: MySql could not create a validated object.

Postby Lapo » 19 Oct 2017, 07:39

Great :)
Lapo

--

gotoAndPlay()

...addicted to flash games
Mrm83
Posts: 22
Joined: 17 Dec 2017, 04:02

Re: MySql could not create a validated object.

Postby Mrm83 » 08 Jun 2018, 00:45

I am getting the exact same error when I use getConnection() if the table used in zone sql testing is empty.

from the zone test sql, i have this
select * from users;

from server extension, "connection = dbManager.getConnection();" will throw the error IF users table is empty
if i insert something into the users table, the same code will be perfectly fine
as soon as i truncate the table, the same error occurs.

If i update the test sql to not select from users table, the error does not occur even if the users table is empty.

So i am guessing the test sql is messing up the getConnection () call??
User avatar
Lapo
Site Admin
Posts: 20426
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: MySql could not create a validated object.

Postby Lapo » 11 Jun 2018, 09:31

Hi,
yes it is possible that if the table is empty it will return an error. Instead of selecting data from a table you can use a simpler expression for the Test SQL, such as one of these:

Code: Select all

SELECT 1

or

Code: Select all

SELECT NOW()


The reason why this happens on every getConnection() is that the "Test query" is run every time a new connection is taken from the connection pool to make sure it's still valid. The Connection pool recycles connections to avoid re-creating them every time which is an expensive task.

Hope it helps
Lapo

--

gotoAndPlay()

...addicted to flash games

Return to “SFS2X Questions”

Who is online

Users browsing this forum: No registered users and 25 guests