0
votes

I have started to use SmartFoxServer 2x. I used to use SmartFoxServer Pro, but I decided that I should use HTML5, so I did it. Anyway, there is a problem with Database Manager. First, I will tell you what have I done so far:

  1. I downloaded "mysql-connector-java-5.1.38-bin.jar" file from MySQL's website.

  2. And I copied it into "SmartFoxServer 2X\SFS2X\extensions__lib__" folder.

  3. After that, I entered the admin tool > Zone Configurator > Database Manager.

  4. Activate = yes

  5. Database driver class = com.mysql.jdbc.Driver

  6. Connection string = jdbc:mysql://localhost:3306/login

  7. Username = root

  8. Password = my_mysql_password

  9. Test SQL = SELECT * FROM users

  10. And I restarted the server.

It gave me this error:

Exception: java.lang.ClassNotFoundException
Message: com.mysql.jdbc.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$1.run(Unknown Source)
java.net.URLClassLoader$1.run(Unknown Source)
java.security.AccessController.doPrivileged(Native Method)
java.net.URLClassLoader.findClass(Unknown Source)
java.lang.ClassLoader.loadClass(Unknown Source)
sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
java.lang.ClassLoader.loadClass(Unknown Source)
java.lang.Class.forName0(Native Method)
java.lang.Class.forName(Unknown Source)
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:638)
com.smartfoxserver.v2.entities.managers.SFSZoneManager.createZone(SFSZoneManager.java:406)
com.smartfoxserver.v2.entities.managers.SFSZoneManager.initializeZones(SFSZoneManager.java:249)
com.smartfoxserver.v2.SmartFoxServer.start(SmartFoxServer.java:266)
com.smartfoxserver.v2.Main.main(Main.java:27)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
java.lang.reflect.Method.invoke(Unknown Source)
com.exe4j.runtime.LauncherEngine.launch(Unknown Source)
com.exe4j.runtime.WinLauncher.main(Unknown Source)
com.install4j.runtime.launcher.WinLauncher.main(Unknown Source)

What should I do?

1
Hint: Exception: java.lang.ClassNotFoundExceptionSatyaTNV
extensions__lib__ is not the same as extensions/__lib__/ make sure you deployed it in the right location.Mark Rotteveel
I got what you mean. But it still doesn't work.Farejder

1 Answers

1
votes

You need to place "mysql-connector-java-5.1.38-bin.jar properly inside
SmartfoxServer2X/SFS2X/lib folder

For further configurations check this link: [https://www.youtube.com/watch?v=PFSMBRJ4gdU&list=PLAD3A1B608ACA09C0&index=10][1]