SmartFox Server on LocalHost
Recently I needed to do some development for a communication tool running on a SmartFox Server instance. Since it is easier to develop with a localhost-based server instance I decided to install SmartFox Server.
Successful installation wasn’t as simple as download and click “Install.” I didn’t find a complete set of instructions addressing what I encountered – so here is my experience…
As of November 2010 there are two versions of the server – 1.6 professional and the new 2.0 version. I needed to install 1.6, so there is no information on 2.0 in this post. And I installed on a Windows Vista PC.
SmartFox provides pretty good documentation. I use it – this is not a substitute.
I started with downloading and install 1.6.
After installing, I tried to run it. It opens a terminal window to display startup progress.
Read Only Problem: The first attempt failed because it was unable to save a log file. If this happens select the parent directory (“C:Program FilesSmartFoxServerPRO_1.6.6” on my system) and change permissions to allow anyone write access to the whole thing.
Java Problem: After fixing the read-only problem SmartFoxServer hung while starting up a little further in the process. The error displayed had something to do with a problem with java.qt and an inability to communicate with the database. I downloaded a newer version of Java Virtual Machine and switched over to it in the Java Control Panel and rebooted. Thank Apple Quicktime for that one.
DbManagerException: A message like this: “DbManagerException: The Test SQL statement failed! Please check your configuration.”
Follow the steps in this post on setting up SmartFoxServer to hook up to MySQL: http://www.packtpub.com/article/flash-virtual-world-smartfoxserver-thirdparty-database-web-server [Note: works with XAMPP too] I tried changing the setting to not use a DB but it still failed to run with the same error message as before.
RedBox Bat problem: Follow steps listed on SmartFoxServer Forum. As I mention there, replacingÂ
Launch AdminTool (in Admin folder in Start Menu) to verify that examples will run on local.
- Open the config.xml in your favorite text editor.
- Go to line 203 of the config.xml. This line should be within the structure of a Zone tag with name as dbZone.
- Change the lines 203-218 from the config.xml:
Original code:<DatabaseManager active="false"> <Driver>sun.jdbc.odbc.JdbcOdbcDriver</Driver> <ConnectionString>jdbc:odbc:sfsTest</ConnectionString> <!-- Example connecting to MySQL <Driver>org.gjt.mm.mysql.Driver</Driver> <ConnectionString>jdbc:mysql://192.168.0.1:3306/sfsTest </ConnectionString> --> <UserName>yourname</UserName> <Password>yourpassword</Password> <TestSQL><![CDATA[SELECT COUNT(*) FROM contacts]]></TestSQL>
- Replace the code in lines 203-218 with the following code:
<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>