Stendhal server trouble shooting
Out of memory error / Lagging / Turn overflows
If while executing the server you get an out of memory error like:
Exception in thread "marauroad" java.lang.OutOfMemoryError: Java heap space
Or you have a lot of lagging and turn overflows after only a little time of running the server, edit your start up script (e.g. marauroa.dat) to replace
java -cp $LOCALCLASSPATH marauroa.server.marauroad -c blah blah blah
java -Xmx256m -cp $LOCALCLASSPATH marauroa.server.marauroad -c blah blah blah
Java programs are allocated 64Mb memory heap space by default and this is not enough for the stendhal server. The Xmx switch overrides the default.
You try logging in with the account you made when you first got Stendhal. It doesn't work in your server! You see, the MySQL database we created is the user and some other info database, meaning that we have a list of users, while the main server has it's own list. As granting public access to the MySQL database over there would be a security issue for the users on it, we must click on Create An Account and choose localhost as the server to join.
If your server error or server log contains something like:
Caused by: java.lang.<something>Error: <name>
And doesn't say InvocationTargetError, then you have a version mismatch between what stendhal version you're using and what marauroa version you're [[using. As a rule marauroa and stendhal are released together, so released versions should match. But if you get very latest CVS marauroa and not very latest CVS stendhal (say) then you may get this problem.
log4j:ERROR setFile(null,true) call failed
Did you get this?
log4j:ERROR setFile(null,true) call failed. java.io.FileNotFoundException: log/server.log (No such file or directory) at java.io.FileOutputStream.openAppend(Native Method) at java.io.FileOutputStream.<init>(FileOutputStream.java:177) at java.io.FileOutputStream.<init>(FileOutputStream.java:102)
It just means it can't find the log/ directory to create server logs in. So, make a directory called log in your stendhal_server directory. Ta da! (Logs may end up generating a lot of files and taking up space, it's not a default setting unless you choose to have them, by making the directory.)
Can't create admin
Want to be an admin? Now you can! It's easy! Go to data\conf\admins.txt inside your server folder (e.g. where you extracted stendhal-server-1.24.zip) and edit the file. Put each account name which you desire to be an admin on a separate line. End with a new line. The names must be EXACT, or it will not work.
Now restart the server.
On some systems, after launching marauroad you may get error like:
ERROR [main ] AdapterFactory (68 ) - marauroa.server.db.DatabaseConnectionException: Unable to create a connection to: jdbc:mysql://localhost/marauroa marauroa.server.db.DatabaseConnectionException: Unable to create a connection to: jdbc:mysql://localhost/marauroa ... <skipped> Caused by: java.sql.SQLException: Unknown initial character set index '192' received from server. Initial client character set can be forced via the 'characterEncoding' property. ... <skipped>
What you can do in this case: open your mysqld configuration file ( /etc/my.cnf for *nix or \my.ini for Windows) and edit these settings:
collation_server = <...> character_set_server = <...>
Change them to:
collation_server = latin1_swedish_ci character_set_server = latin1
then restart mysqld.
#/service mysqld restart (for Red Hat clones) #/etc/rc.d/rc.mysqld restart (for Slackware) $/sudo /etc/init.d/mysqld restart (for Debian/Ubuntu) stop and start mysqld service (in Windows services window)
Or you can reboot your system.
For learning more about character sets in mysql, see http://dev.mysql.com/doc/refman/5.0/en/charset.html