Custom login

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

Moderators: Lapo, Bax

theroot
Posts: 3
Joined: 18 Mar 2017, 16:14

Custom login

Postby theroot » 18 Mar 2017, 16:31

Hi!

I have some problems with custom login.
I used this guide (docs2x.smartfoxserver.com/DevelopmentBasics/database-recipes) to do custom login with mySQL database.
I set up Zone (BasicExamples), deployed the Extension by copying it in a subfolder of /root/SmartFoxServer_2X/SFS2X/extensions , installed MySQL JDBC Driver by this guide (marksman.wordpress.com/2009/03/01/setting-up-mysqljdbc-driver-on-ubuntu) and of course I set up mysql-server and imported the 'muppets' table into the database.

But I have error: Login Failure: SQL Error: The DBManager is NOT active in this Zone. SQL Query failed. Please activate it the DBManager from the AdminTool.
I tried to do this 3 times.

Could you help me? I think, there are some mistakes in Zone Database manager because I don't know which port I have to enter (I entered "jdbc:mysql://[i]ip/i]" without port)
User avatar
Lapo
Site Admin
Posts: 23025
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Custom login

Postby Lapo » 20 Mar 2017, 08:33

Hi,
can you show me the full stack trace of the error?

Can you also double check that the DBManager is active in the config of the Zone you're working with?

Could you help me? I think, there are some mistakes in Zone Database manager because I don't know which port I have to enter (I entered "jdbc:mysql://[i]ip/i]" without port)

If you don't specify a port number, the JDBC driver will use the default MySQL port, 3306.
Unless you have configured MySQL to run on a different port, there's no problem with not specifying the value.

Cheers
Lapo
--
gotoAndPlay()
...addicted to flash games
theroot
Posts: 3
Joined: 18 Mar 2017, 16:14

Re: Custom login

Postby theroot » 20 Mar 2017, 12:32

Lapo wrote:Hi,
can you show me the full stack trace of the error?

Can you also double check that the DBManager is active in the config of the Zone you're working with?

Could you help me? I think, there are some mistakes in Zone Database manager because I don't know which port I have to enter (I entered "jdbc:mysql://[i]ip/i]" without port)

If you don't specify a port number, the JDBC driver will use the default MySQL port, 3306.
Unless you have configured MySQL to run on a different port, there's no problem with not specifying the value.

Cheers


Image
Image
User avatar
Lapo
Site Admin
Posts: 23025
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Custom login

Postby Lapo » 20 Mar 2017, 19:51

The complete error should be found in the log files under SFS2X/logs/smartfox.log

I see that you're connecting to an external IP address to talk to the database. Is MySQL configure to allow it? By default MySQL denies any connection other than "localhost".

Thanks
Lapo

--

gotoAndPlay()

...addicted to flash games
theroot
Posts: 3
Joined: 18 Mar 2017, 16:14

Re: Custom login

Postby theroot » 22 Mar 2017, 11:13

Lapo wrote:The complete error should be found in the log files under SFS2X/logs/smartfox.log

I see that you're connecting to an external IP address to talk to the database. Is MySQL configure to allow it? By default MySQL denies any connection other than "localhost".

Thanks



22 Mar 2017 | 14:16:59,464 | ERROR | main | v2.db.SFSDBManager | | java.lang.ClassNotFoundException:
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
Exception: java.lang.ClassNotFoundException
Message: org.gjt.mm.mysql.Driver
Description: The initialization of the DBManager has failed.
Possible Causes: if the database driver is not 'seen' int the server classpath the setup fails.
Make sure to deploy the driver .jar file in the extensions/__lib__/ folder and restart the Server.
+--- --- ---+
Stack Trace:
+--- --- ---+
java.net.URLClassLoader.findClass(URLClassLoader.java:381)
java.lang.ClassLoader.loadClass(ClassLoader.java:424)
sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
java.lang.ClassLoader.loadClass(ClassLoader.java:357)
java.lang.Class.forName0(Native Method)
java.lang.Class.forName(Class.java:264)
com.smartfoxserver.v2.db.SFSDBManager.setupDriver(SFSDBManager.java:345)
com.smartfoxserver.v2.db.SFSDBManager.init(SFSDBManager.java:62)
com.smartfoxserver.v2.entities.managers.SFSZoneManager.configureDBManager(SFSZoneManager.java:637)
com.smartfoxserver.v2.entities.managers.SFSZoneManager.createZone(SFSZoneManager.java:398)
com.smartfoxserver.v2.entities.managers.SFSZoneManager.initializeZones(SFSZoneManager.java:239)
com.smartfoxserver.v2.SmartFoxServer.start(SmartFoxServer.java:292)
com.smartfoxserver.v2.Main.main(Main.java:27)
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

I think there are some problems with JDBC Driver. I don't know how to install it correctly
I didn't configure mySQL. Could you help me with it? What should I do?

I tried to deploy JDBC Driver for mySQL to /root/SmartFoxServer_2X/SFS2X/extensions/__lib__ and restart server, but I see the same error.
Image ( /root/SmartFoxServer_2X/SFS2X/extensions/__lib__ )

I'm sorry for a lot of questions.
User avatar
Lapo
Site Admin
Posts: 23025
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Custom login

Postby Lapo » 22 Mar 2017, 11:29

Thanks, this is helpful.
According to MySQL documentation the driver class name to be used is --> com.mysql.jdbc.Driver

Replace that and you should be fine.

Cheers
Lapo

--

gotoAndPlay()

...addicted to flash games

Return to “SFS2X Questions”

Who is online

Users browsing this forum: Stevenor and 60 guests