H2DB error

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

Moderators: Lapo, Bax

Post Reply
draive
Posts: 51
Joined: 20 Dec 2008, 22:57

H2DB error

Post by draive »

OK, I was going along starting and restarting my server as I always do when coding/debugging. And all of a sudden I get an "already running" error. So, I rebooted the PC and I still get the same error.

Can someone tell me what the heck is going on?? Thanks.

-d

*sys-package-mgr*: processing modified jar, 'C:\Program Files (x86)\SmartFoxServ
erPRO_1.6.2\Server\lib\extensions.jar'
|::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::|
| |
| ...::: SmartFoxServer :::... |
| Multiplayer Socket Server |
| version 1.6.5.01 |
| --- |
| (c) 2004 - 2009 gotoAndPlay() |
| www.smartfoxserver.com |
| www.gotoandplay.it |
| |
|::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::|

::::::::::: { BlueBox INITED } ::::::::::::
: :
: Version 1.0.3 -- (c) 2007 gotoAndPlay() :
: :
:::::::::::::::::::::::::::::::::::::::::::
18:55:48.362 - [ INFO ] > Starting h2 engine...


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

System CPU(s): 2
VM Max memory: 66 MB

os.name: Windows Vista
os.arch: x86
os.version: 6.0
java.version: 1.6.0_03
java.vendor: Sun Microsystems Inc.
java.vendor.url: http://java.sun.com/
java.vm.specification.version: 1.0
java.vm.version: 1.6.0_03-b05
java.vm.vendor: Sun Microsystems Inc.
java.vm.name: Java HotSpot(TM) Client VM


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

Card:Software Loopback Interface 1
-> 0:0:0:0:0:0:0:1
-> 127.0.0.1
Card:WAN Miniport (L2TP)
Card:WAN Miniport (PPTP)
Card:WAN Miniport (PPPOE)
Card:WAN Miniport (IPv6)
Card:WAN Miniport (IP)
Card:RAS Async Adapter
Card:WAN Miniport (SSTP)
Card:WAN Miniport (Network Monitor)
Card:Marvell Yukon 88E8071 PCI-E Gigabit Ethernet Controller
-> fe80:0:0:0:431:ae9c:aa0e:8bfe%10
Card:Intel(R) Wireless WiFi Link 5100
-> fe80:0:0:0:31ee:64b1:6928:97de%11
-> 192.168.1.103
Card:isatap.wistron.com
Card:isatap.{8745BDB8-A57B-4B6C-BFC5-8115FF6B82FD}
-> fe80:0:0:0:0:5efe:c0a8:167%13
Card:Teredo Tunneling Pseudo-Interface
-> 2001:0:4137:9e50:3086:37f2:b53e:94ae
-> fe80:0:0:0:3086:37f2:b53e:94ae%14
Card:WAN Miniport (IPv6)-QoS Packet Scheduler-0000
Card:WAN Miniport (IP)-QoS Packet Scheduler-0000
Card:WAN Miniport (Network Monitor)-QoS Packet Scheduler-0000
Card:Intel(R) Wireless WiFi Link 5100-QoS Packet Scheduler-0000
Card:Marvell Yukon 88E8071 PCI-E Gigabit Ethernet Controller-QoS Packet Schedule
r-0000
Card:Intel(R) Wireless WiFi Link 5100-Native WiFi Filter Driver-0000


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

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

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

DB Manager Activated ( org.h2.Driver )
18:55:49.330 - [ SEVERE ] > DbManager could not retrive a connection. org.h2.jdb
c.JdbcSQLException: Database may be already in use: Lock file modified in the fu
ture: dist=-4665714. Possible solutions: close all other connection(s); use the
server mode [90020-60]
at org.h2.message.Message.getSQLException(Message.java:84)
at org.h2.message.Message.getSQLException(Message.java:88)
at org.h2.message.Message.getSQLException(Message.java:66)
at org.h2.store.FileLock.error(FileLock.java:310)
at org.h2.store.FileLock.waitUntilOld(FileLock.java:143)
at org.h2.store.FileLock.lockFile(FileLock.java:165)
at org.h2.store.FileLock.lock(FileLock.java:69)
at org.h2.engine.Database.open(Database.java:438)
at org.h2.engine.Database.<init>(Database.java:186)
at org.h2.engine.Engine.openSession(Engine.java:50)
at org.h2.engine.Engine.getSession(Engine.java:98)
at org.h2.server.TcpServerThread.run(TcpServerThread.java:87)
at java.lang.Thread.run(Unknown Source)

it.gotoandplay.smartfoxserver.exceptions.DbManagerException: The Test SQL statem
ent failed! Please check your configuration.
at it.gotoandplay.smartfoxserver.SmartFoxServer.setupZone(SmartFoxServer
.java:1843)
at it.gotoandplay.smartfoxserver.lib.ConfigReader.parse_Zones(ConfigRead
er.java:796)
at it.gotoandplay.smartfoxserver.lib.ConfigReader.readZoneConfig(ConfigR
eader.java:174)
at it.gotoandplay.smartfoxserver.SmartFoxServer.initServerSocket(SmartFo
xServer.java:341)
at it.gotoandplay.smartfoxserver.SmartFoxServer.run(SmartFoxServer.java:
609)
Problems in config file: The Test SQL statement failed! Please check your config
uration.
it.gotoandplay.smartfoxserver.exceptions.ConfigurationException: The Test SQL st
atement failed! Please check your configuration.
at it.gotoandplay.smartfoxserver.lib.ConfigReader.readZoneConfig(ConfigR
eader.java:199)
at it.gotoandplay.smartfoxserver.SmartFoxServer.initServerSocket(SmartFo
xServer.java:341)
at it.gotoandplay.smartfoxserver.SmartFoxServer.run(SmartFoxServer.java:
609)

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


Shutting down server...

Press any key to continue . . .
I have tried killing power to the pc and starting fresh and I still get the same error.
jjduran
Posts: 90
Joined: 03 Jan 2007, 05:11
Contact:

Post by jjduran »

The internal DatabaseManager is called h2db and one of the example zones in the config.xml file is also called h2db. Try renaming the example Zone "h2db" to something else like "h2dbtest" or remove it from the config.xml completely if you don't use it.

Found that in another post... it might apply here. Let me know.
Player-vs-Player Online Battles
EpicDuel.com
draive
Posts: 51
Joined: 20 Dec 2008, 22:57

Post by draive »

jjduran wrote:The internal DatabaseManager is called h2db and one of the example zones in the config.xml file is also called h2db. Try renaming the example Zone "h2db" to something else like "h2dbtest" or remove it from the config.xml completely if you don't use it.

Found that in another post... it might apply here. Let me know.
I took those extensions out and only have mine running.

There is mention that SFS runs an SQL test command in the config? Where is this in the file, I cant see it.

Perhaps I did something to fry the db? The last thing I did was make a table called Players.
draive
Posts: 51
Joined: 20 Dec 2008, 22:57

Post by draive »

Nevermind found the test sql

<TestSQL><![CDATA[SELECT COUNT(*) FROM ROOMS]]></TestSQL>

I didnt do anything to that table... hrmmmmmm
draive
Posts: 51
Joined: 20 Dec 2008, 22:57

Post by draive »

It appears something has happened to my ROOMS table.... how do I get it running so that I can access it to fix it?
jjduran
Posts: 90
Joined: 03 Jan 2007, 05:11
Contact:

Post by jjduran »

Here are the docs on how to login to the H2 interface... the only problem is that you need to have physical access to the machine the database is on:

http://www.smartfoxserver.com/docs/inde ... ddedDb.htm


I would review your config file though to make sure it contains no errors, your post mentions:

Code: Select all

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


Shutting down server...

Press any key to continue . . . 
It might be best to recreate your config file using the provided config template to be sure it is error free.
Player-vs-Player Online Battles
EpicDuel.com
draive
Posts: 51
Joined: 20 Dec 2008, 22:57

Post by draive »

Thanks for the link but you cant run the admindb startup bat unless the sfs server is running. So its catch22.

Yeah, the config was the first thing I checked and I promise there are zero issues with it. In addition, this happened between two restarts that I did back to back. So its impossible to be the config file.

Now, I was messing with the db so if I accidentally messed it up then that is fine but the big question is since it is embedded, how do you access it if SFS wont run and get it going because SFS fails on startup.
jjduran
Posts: 90
Joined: 03 Jan 2007, 05:11
Contact:

Post by jjduran »

Another post mentioned that the H2 database is case-sensitive... is it possible that the table is actually named "Rooms" and not "ROOMS"?
Player-vs-Player Online Battles
EpicDuel.com
draive
Posts: 51
Joined: 20 Dec 2008, 22:57

Post by draive »

Woah, just noticed the time on my PC was somehow set back two hours. I changed the time on the pc and now it works.

WTH?

lol
User avatar
Lapo
Site Admin
Posts: 23438
Joined: 21 Mar 2005, 09:50
Location: Italy

Post by Lapo »

Ouch :shock: :shock:
Lapo
--
gotoAndPlay()
...addicted to flash games
User avatar
rjgtav
Posts: 2813
Joined: 19 Apr 2009, 11:31
Location: Lisbon, Portugal

Post by rjgtav »

Hi. this happened to me too. I just changed my computers time to the FUTURE and it just opened. Why does this happen?
And how can i solve this? cause i want to put my pc's time correct...

Well, i've been googling, and found in the h2 database changelog (http://www.h2database.com/html/changelog.html) and the error has been fixed since the 1.2.124 version. So how do i update h2 version? I noticed that you updated it through an update to sfs.

UPDATE

I've found how to update the h2 database. downloaded the latest jar from http://www.h2database.com/html/download.html and put it in the lib folder. But now it says Unsupported database file version or invalid file header in file "Old database: C:\Users\Rjgtav\clientes.data.db - please convert the database to a SQL script and re-create it.". So i'm gonna trying older versions.

UPDATE 2

YES! Updated to the version that solved the error (1.2.124 (2009-11-20)), and is working now. I thought it was more difficult to update it.

For who reads this topic in the future, here are the instructions to update h2 database.

1. Make a backup of your database.
2. Shutdown sfs and adminDB
3. Go http://www.h2database.com/html/changelog.html to check which version solved your error.
4. Then go http://code.google.com/p/h2database/downloads/list and download the zip of the version you want to download.
5. Extract h2\bin\h2-blabla.jar.
6. Copy the [SFS Installation Folder]\Server\lib\h2.jar to another connection (to restore if the upgrade fails) then delete it
7. Copy the h2-blabla.jar to Copy the [SFS Installation Folder]\Server\lib\
8. Rename it to h2.jar
9. Start Smartfox Server

One question (forget the older ones): Why doesn't sfs use the latest h2 database version?
User avatar
rjgtav
Posts: 2813
Joined: 19 Apr 2009, 11:31
Location: Lisbon, Portugal

Post by rjgtav »

Can any1 explain this?
Haniman
Posts: 35
Joined: 02 Sep 2009, 22:52

Post by Haniman »

Hey, thanks a lot for the solution. I had the same problem and 1.2.124 solved it. :)
Post Reply