Database Error

Need help with SmartFoxServer? You didn't find an answer in our documentation? Please, post your questions here!

Moderators: Lapo, Bax

Denisoiu1232
Posts: 11
Joined: 24 Jul 2020, 14:31

Database Error

Postby Denisoiu1232 » 20 Aug 2020, 21:18

Hi! I have a problem with connecting the Database to SmartFoxServer PRO. So, i was following an ebook called Flash Multiplayer Virtual Worlds and when i run the start.bat it gives me this error:

Code: Select all

|::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::|
|                                                            |
|              ...:::  SmartFoxServer :::...                 |
|                Multiplayer Socket Server                   |
|                      version 1.6.6                         |
|                           ---                              |
|              (c) 2004 - 2009 gotoAndPlay()                 |
|                  www.smartfoxserver.com                    |
|                    www.gotoandplay.it                      |
|                                                            |
|::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::|

::::::::::: { BlueBox INITED } ::::::::::::
:                                         :
: Version 1.0.5 -- (c) 2008 gotoAndPlay() :
:                                         :
:::::::::::::::::::::::::::::::::::::::::::
22:54:24.664 - [ INFO ] > Starting h2 engine...


--- [ System Info ] ------------------------------------------

System CPU(s): 2
VM Max memory: 66 MB

os.name: Windows Vista
os.arch: x86
os.version: 6.2
java.version: 1.6.0_13
java.vendor: Sun Microsystems Inc.
java.vendor.url: http://java.sun.com/
java.vm.specification.version: 1.0
java.vm.version: 11.3-b02
java.vm.vendor: Sun Microsystems Inc.
java.vm.name: Java HotSpot(TM) Server VM


--- [ Network Cards ] -----------------------------------------

Card:Software Loopback Interface 1
 -> 0:0:0:0:0:0:0:1
 -> 127.0.0.1
Card:Microsoft Kernel Debug Network Adapter
Card:Microsoft 6to4 Adapter
Card:WAN Miniport (L2TP)
Card:Microsoft IP-HTTPS Platform Adapter
Card:NVIDIA nForce Networking Controller
 -> fe80:0:0:0:b4ce:8d03:d869:c4b7%6
 -> 192.168.0.108
Card:VirtualBox Host-Only Ethernet Adapter
 -> fe80:0:0:0:680b:5717:a6b2:27d4%7
 -> 192.168.56.1
Card:WAN Miniport (IP)
Card:WAN Miniport (IPv6)
Card:WAN Miniport (Network Monitor)
Card:Qualcomm Wireless HS-USB Ethernet Adapter 9091
Card:WAN Miniport (PPTP)
Card:RAS Async Adapter
Card:Microsoft Teredo Tunneling Adapter
Card:Qualcomm Wireless HS-USB Ethernet Adapter 9092
Card:WAN Miniport (SSTP)
Card:WAN Miniport (PPPOE)
Card:TunnelBear Adapter V9
 -> fe80:0:0:0:6011:46b3:7635:b020%18
Card:WAN Miniport (IKEv2)
Card:VirtualBox Host-Only Ethernet Adapter-WFP Native MAC Layer LightWeight Filter-0000
Card:VirtualBox Host-Only Ethernet Adapter-QoS Packet Scheduler-0000
Card:VirtualBox Host-Only Ethernet Adapter-WFP 802.3 MAC Layer LightWeight Filter-0000
Card:TunnelBear Adapter V9-WFP Native MAC Layer LightWeight Filter-0000
Card:TunnelBear Adapter V9-VirtualBox NDIS Light-Weight Filter-0000
Card:TunnelBear Adapter V9-QoS Packet Scheduler-0000
Card:TunnelBear Adapter V9-WFP 802.3 MAC Layer LightWeight Filter-0000
Card:NVIDIA nForce Networking Controller-WFP Native MAC Layer LightWeight Filter-0000
Card:NVIDIA nForce Networking Controller-VirtualBox NDIS Light-Weight Filter-0000
Card:NVIDIA nForce Networking Controller-QoS Packet Scheduler-0000
Card:NVIDIA nForce Networking Controller-WFP 802.3 MAC Layer LightWeight Filter-0000
Card:WAN Miniport (IP)-WFP Native MAC Layer LightWeight Filter-0000
Card:WAN Miniport (IP)-QoS Packet Scheduler-0000
Card:WAN Miniport (IPv6)-WFP Native MAC Layer LightWeight Filter-0000
Card:WAN Miniport (IPv6)-QoS Packet Scheduler-0000
Card:WAN Miniport (Network Monitor)-WFP Native MAC Layer LightWeight Filter-0000
Card:WAN Miniport (Network Monitor)-QoS Packet Scheduler-0000


--- [ Licence Loaded ] ------------------------------------

License Type    -> PRO
License Owner   -> --== Free Demo Licence ==--
Max. Clients    -> 20
BlueBox Type    -> Demo Version

--- [ Zones & Rooms ] -------------------------------------

22:54:29.395 - [ INFO ] > Default Buddy List Persister <INITED>
Zone: simpleChat

        Town               (id: 1, max: 50, pass:N)
        Arcade             (id: 2, max: 50, pass:N)
        The Garden         (id: 3, max: 50, pass:N)
        The Bathroom       (id: 4, max: 50, pass:N)
        The Garage         (id: 5, max: 50, pass:N)
        The Living Room    (id: 6, max: 50, pass:Y)
22:54:30.650 - [ INFO ] > Zone Extension [ json ] created, for zone:simpleChat
[jsonSample.as]: JSON Example initialized

22:54:30.662 - [ INFO ] > Default Buddy List Persister <INITED>
        DB Manager Activated ( org.gjt.mm.mysql.Driver )
22:54:33.881 - [ SEVERE ] > DbManager could not retrive a connection. com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure

The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.
it.gotoandplay.smartfoxserver.exceptions.DbManagerException: The Test SQL statement failed! Please check your configuration.
        at it.gotoandplay.smartfoxserver.SmartFoxServer.setupZone(SmartFoxServer.java:1843)
        at it.gotoandplay.smartfoxserver.lib.ConfigReader.parse_Zones(ConfigReader.java:806)
        at it.gotoandplay.smartfoxserver.lib.ConfigReader.readZoneConfig(ConfigReader.java:174)
        at it.gotoandplay.smartfoxserver.SmartFoxServer.initServerSocket(SmartFoxServer.java:339)
        at it.gotoandplay.smartfoxserver.SmartFoxServer.run(SmartFoxServer.java:607)
Problems in config file: The Test SQL statement failed! Please check your configuration.
it.gotoandplay.smartfoxserver.exceptions.ConfigurationException: The Test SQL statement failed! Please check your configuration.
        at it.gotoandplay.smartfoxserver.lib.ConfigReader.readZoneConfig(ConfigReader.java:199)
        at it.gotoandplay.smartfoxserver.SmartFoxServer.initServerSocket(SmartFoxServer.java:339)
        at it.gotoandplay.smartfoxserver.SmartFoxServer.run(SmartFoxServer.java:607)

Errors found in configuration files.
Unable to start the server.


Shutting down server...

Press any key to continue . . .


And also the code in config.xml:

Code: Select all

<DatabaseManager active="true">
          <Driver>org.gjt.mm.mysql.Driver</Driver>
          <ConnectionString>jdbc:mysql://127.0.0.1:3306/mysql</ConnectionString>
            
            
         <UserName>root</UserName>
         <Password></Password>
         
         <TestSQL><![CDATA[SELECT NOW()]]></TestSQL>
            
            <MaxActive>10</MaxActive>
            <MaxIdle>10</MaxIdle>
            
            <OnExhaustedPool>fail</OnExhaustedPool>
            <BlockTime>5000</BlockTime>
               
         </DatabaseManager>


I added the mysql-connector-java-5.1.49-bin in SmartFoxServerPRO_1.6.6\jre\lib\ext and i also added the org in the ext file. What is going wrong here? Is there any fix? :D
User avatar
Lapo
Site Admin
Posts: 23008
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Database Error

Postby Lapo » 24 Aug 2020, 08:53

I noticed that you're using this driver name --> org.gjt.mm.mysql.Driver
I think this is no longer valid, with more recent versions of the JDBC connector. You should use --> com.mysql.cj.jdbc.Driver

Hope it helps
Lapo
--
gotoAndPlay()
...addicted to flash games
Denisoiu1232
Posts: 11
Joined: 24 Jul 2020, 14:31

Re: Database Error

Postby Denisoiu1232 » 24 Aug 2020, 11:23

Yesterday, the org.gjt.mm.mysql.Driver was working, but everytime i tried to add a password it would say an error, without a password it was working. Now idk but everytime i try with org.gjt.mm.mysql.Driver or com.mysql.cj.jdbc.Driver, it gives me this error:

Code: Select all

 DB Manager Activated ( com.mysql.cj.jdbc.Driver )
Can't load db driver: com.mysql.cj.jdbc.Driver
14:23:12.932 - [ SEVERE ] > DbManager could not retrive a connection. java.sql.SQLException: Configuration file not found
it.gotoandplay.smartfoxserver.exceptions.DbManagerException: The Test SQL statement failed! Please check your configuration.
        at it.gotoandplay.smartfoxserver.SmartFoxServer.setupZone(SmartFoxServer.java:1843)
        at it.gotoandplay.smartfoxserver.lib.ConfigReader.parse_Zones(ConfigReader.java:806)
        at it.gotoandplay.smartfoxserver.lib.ConfigReader.readZoneConfig(ConfigReader.java:174)
        at it.gotoandplay.smartfoxserver.SmartFoxServer.initServerSocket(SmartFoxServer.java:339)
        at it.gotoandplay.smartfoxserver.SmartFoxServer.run(SmartFoxServer.java:607)
Problems in config file: The Test SQL statement failed! Please check your configuration.
it.gotoandplay.smartfoxserver.exceptions.ConfigurationException: The Test SQL statement failed! Please check your configuration.
        at it.gotoandplay.smartfoxserver.lib.ConfigReader.readZoneConfig(ConfigReader.java:199)
        at it.gotoandplay.smartfoxserver.SmartFoxServer.initServerSocket(SmartFoxServer.java:339)
        at it.gotoandplay.smartfoxserver.SmartFoxServer.run(SmartFoxServer.java:607)

Errors found in configuration files.
Unable to start the server.


Shutting down server...

Press any key to continue . . .


Any clue on fixing it? :D
User avatar
Lapo
Site Admin
Posts: 23008
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Database Error

Postby Lapo » 24 Aug 2020, 14:30

If it was working you must have changed something.
In particular you should check in the MySQL admin whether or not you need a password for the connection. If you were able to connect without password I am not sure why you are expecting that it would work with a password.

Am I missing something else?
Lapo

--

gotoAndPlay()

...addicted to flash games
Denisoiu1232
Posts: 11
Joined: 24 Jul 2020, 14:31

Re: Database Error

Postby Denisoiu1232 » 24 Aug 2020, 18:08

I did not change anything , i tried to change it to org.gjt.mm.mysql.Driver and without a password, and also restarted my computer, but still the same problem:


Code: Select all

21:05:35.126 - [ INFO ] > Default Buddy List Persister <INITED>
        DB Manager Activated ( org.gjt.mm.mysql.Driver )
21:05:38.145 - [ SEVERE ] > DbManager could not retrive a connection. com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure

The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.
it.gotoandplay.smartfoxserver.exceptions.DbManagerException: The Test SQL statement failed! Please check your configuration.
        at it.gotoandplay.smartfoxserver.SmartFoxServer.setupZone(SmartFoxServer.java:1843)
        at it.gotoandplay.smartfoxserver.lib.ConfigReader.parse_Zones(ConfigReader.java:806)
        at it.gotoandplay.smartfoxserver.lib.ConfigReader.readZoneConfig(ConfigReader.java:174)
        at it.gotoandplay.smartfoxserver.SmartFoxServer.initServerSocket(SmartFoxServer.java:339)
        at it.gotoandplay.smartfoxserver.SmartFoxServer.run(SmartFoxServer.java:607)
Problems in config file: The Test SQL statement failed! Please check your configuration.
it.gotoandplay.smartfoxserver.exceptions.ConfigurationException: The Test SQL statement failed! Please check your configuration.
        at it.gotoandplay.smartfoxserver.lib.ConfigReader.readZoneConfig(ConfigReader.java:199)
        at it.gotoandplay.smartfoxserver.SmartFoxServer.initServerSocket(SmartFoxServer.java:339)
        at it.gotoandplay.smartfoxserver.SmartFoxServer.run(SmartFoxServer.java:607)

Errors found in configuration files.
Unable to start the server.


Shutting down server...

Press any key to continue . . .
User avatar
Lapo
Site Admin
Posts: 23008
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Database Error

Postby Lapo » 25 Aug 2020, 08:10

This error:

Code: Select all

com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure

indicates that your database is not reachable.

There can be multiple reasons for that. Check this article from stackoverflow. The first answer lists a number of common causes:
https://stackoverflow.com/questions/298 ... s-link-fai

Cheers
Lapo

--

gotoAndPlay()

...addicted to flash games
Denisoiu1232
Posts: 11
Joined: 24 Jul 2020, 14:31

Re: Database Error

Postby Denisoiu1232 » 27 Aug 2020, 13:44

Thanks Lapo! :)

Return to “SmartFoxServer 1.x Discussions and Help”

Who is online

Users browsing this forum: No registered users and 37 guests