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  %CLASSPATH%  with C:Progra~1 was necessary before any other suggested changes worked. If you aren’t planning to use live voice and video chat this probably won’t matter.

Launch AdminTool (in Admin folder in Start Menu) to verify that examples will run on local.

  1. Open the config.xml in your favorite text editor.
  2. Go to line 203 of the config.xml. This line should be within the structure of a Zone tag with name as dbZone.
  3. 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>
  4. 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>

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *

Captcha loading...

This site uses Akismet to reduce spam. Learn how your comment data is processed.