[Bug found, fix inside]Can't load db driver: ...

Post here your questions about Actionscript and Java server side extensions development.

Moderators: Lapo, Bax

Post Reply
KaiKai
Posts: 4
Joined: 13 Jun 2010, 08:09

[Bug found, fix inside]Can't load db driver: ...

Post by KaiKai »

Of course I installed it like described in the documentation.

Code: Select all

cd /home/kai/Downloads/SmartFoxServer_PRO_1.6.6/jre/lib
kai@Laptop~/Downloads/SmartFoxServer_PRO_1.6.6/jre/lib$ dir
amd64				      fontconfig.Turbo.bfc
applet				      fontconfig.Turbo.properties.src
audio				      fonts
calendars.properties		      im
charsets.jar			      images
classlist			      jce.jar
cmm				      jexec
content-types.properties	      jsse.jar
ext				      jvm.hprof.txt
flavormap.properties		      logging.properties
fontconfig.bfc			      management
fontconfig.properties.src	      management-agent.jar
fontconfig.RedHat.2.1.bfc	      meta-index
fontconfig.RedHat.2.1.properties.src  [u]mysql-connector-java-5.1.12-bin.jar[/u]
fontconfig.RedHat.3.bfc		      net.properties
fontconfig.RedHat.3.properties.src    oblique-fonts
fontconfig.RedHat.4.bfc		      psfontj2d.properties
fontconfig.RedHat.4.properties.src    psfont.properties.ja
fontconfig.RedHat.bfc		      resources.jar
fontconfig.RedHat.properties.src      rt.jar
fontconfig.Sun.bfc		      security
fontconfig.Sun.properties.src	      servicetag
fontconfig.SuSE.bfc		      sound.properties
fontconfig.SuSE.properties.src	      zi
wrapper.conf(i could post my full conf if necessary, but i didn't change anything else):

Code: Select all

...
wrapper.java.classpath.40=lib/commons-io-1.4.jar
wrapper.java.classpath.41=/home/kai/Downloads/SmartFoxServer_PRO_1.6.6/jre/lib/mysql-connector-java-5.1.12-bin.jar



# Java Library Path (location of Wrapper.DLL or libwrapper.so)

wrapper.java.library.path.1=lib/

...
and finally, start.sh output:

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() :
:                                         :
:::::::::::::::::::::::::::::::::::::::::::


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

System CPU(s): 1
VM Max memory: 500 MB

os.name: Linux
os.arch: amd64
os.version: 2.6.31-20-generic
java.version: 1.6.0_20
java.vendor: Sun Microsystems Inc.
java.vendor.url: http://java.sun.com/
java.vm.specification.version: 1.0
java.vm.version: 16.3-b01
java.vm.vendor: Sun Microsystems Inc.
java.vm.name: Java HotSpot(TM) 64-Bit Server VM


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

Card:eth2
 -> fe80:0:0:0:224:2cff:fea9:bdc5%3
 -> 192.168.2.12
Card:lo
 -> 0:0:0:0:0:0:0:1%1
 -> 127.0.0.1


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

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

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

Zone: simpleChat

	The Hall           (id: 1, max: 50, pass:N)
	The Kitchen        (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)
[jsonSample.as]: JSON Example initialized

	DB Manager Activated ( org.gjt.mm.mysql.Driver )
Can't load db driver: org.gjt.mm.mysql.Driver
Problems in config file: The Test SQL statement failed! Please check your configuration.

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


Shutting down server...

Code: Select all

			<DatabaseManager active="true">
				<!--
				<Driver>sun.jdbc.odbc.JdbcOdbcDriver</Driver>
				<ConnectionString>jdbc:odbc:sfsTest</ConnectionString>
				-->
				
				
				<Driver>org.gjt.mm.mysql.Driver</Driver>
				<ConnectionString>jdbc:mysql://192.168.2.13:3306/sfsTest</ConnectionString>
				
				
				<UserName>smartfox</UserName>
				<Password>pass33</Password>
				
				<TestSQL><![CDATA[SELECT COUNT(*) FROM contacts]]></TestSQL>
				
				<MaxActive>10</MaxActive>
				<MaxIdle>10</MaxIdle>
				
				<OnExhaustedPool>fail</OnExhaustedPool>
				<BlockTime>5000</BlockTime>
					
			</DatabaseManager>
Last edited by KaiKai on 14 Jun 2010, 20:25, edited 1 time in total.
christophe.feerik
Posts: 19
Joined: 26 May 2009, 13:39
Location: Montpellier, France

Post by christophe.feerik »

Try this package name : com.mysql.jdbc.Driver
Christophe
Producer - Feerik
KaiKai
Posts: 4
Joined: 13 Jun 2010, 08:09

Post by KaiKai »

Thank you for your response, but im still getting the error, just with the new driver name. :(

Is there maybe something i forgot to install/modify?

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() :
:                                         :
:::::::::::::::::::::::::::::::::::::::::::


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

System CPU(s): 1
VM Max memory: 500 MB

os.name: Linux
os.arch: amd64
os.version: 2.6.31-20-generic
java.version: 1.6.0_20
java.vendor: Sun Microsystems Inc.
java.vendor.url: http://java.sun.com/
java.vm.specification.version: 1.0
java.vm.version: 16.3-b01
java.vm.vendor: Sun Microsystems Inc.
java.vm.name: Java HotSpot(TM) 64-Bit Server VM


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

Card:eth2
 -> fe80:0:0:0:224:2cff:fea9:bdc5%3
 -> 192.168.2.12
Card:lo
 -> 0:0:0:0:0:0:0:1%1
 -> 127.0.0.1


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

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

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

Zone: simpleChat

	The Hall           (id: 1, max: 50, pass:N)
	The Kitchen        (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)
[jsonSample.as]: JSON Example initialized

	DB Manager Activated ( com.mysql.jdbc.Driver )
Can't load db driver: com.mysql.jdbc.Driver
Problems in config file: The Test SQL statement failed! Please check your configuration.

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


Shutting down server...
christophe.feerik
Posts: 19
Joined: 26 May 2009, 13:39
Location: Montpellier, France

Post by christophe.feerik »

Maybe i'm wrong, but under Windows at least, you do not need to edit your wrapper.conf for the MySQL driver to be loaded by Java.

Furthermore, you have to put the mysql-connector Jar into the jre/lib/ext folder.
Christophe
Producer - Feerik
KaiKai
Posts: 4
Joined: 13 Jun 2010, 08:09

Post by KaiKai »

Unfortunately the Linux version brings its own jre, otherwise it would have already been working. :(

Since i also installed it by the package management just in case i find a way to use the normal jre. If you know how to do this, please tell me. Thank you in advance.

But i could try using the server of the Windows version, that could work if i am lucky.
Last edited by KaiKai on 14 Jun 2010, 13:10, edited 1 time in total.
christophe.feerik
Posts: 19
Joined: 26 May 2009, 13:39
Location: Montpellier, France

Post by christophe.feerik »

No, sorry. I have to pass my turn.
Lapo will surely have your answer.
Christophe
Producer - Feerik
KaiKai
Posts: 4
Joined: 13 Jun 2010, 08:09

Post by KaiKai »

Now i found something weird in the /logs directory:
2010/06/13 00:16:38.328 - [ SEVERE ] [id: 10] (DbManager.executeQuery): DbManager could not retrive a connection. java.sql.SQLException: Configuration file not found

But this can't be since im running it as the owner of all smartfox files. :?

This is getting more and more odd, now i am really confused.

edit: I put it in the lib/ext/ path, but this error still exists.

edit2: found the simple bug...

Your starting script points to the normal jre not the one in the smartfox folder after changing this everything worked fine. So you can either: rewrite your documetation or: modifiy the start.sh to point to the sfs jre. But i guess mofifiying the start.sh would be more likely it since otherwise delivering the non-used jre is pointless and everything has to changed system for the whole system.
Post Reply