Error message I can't figure out

Need help with SmartFoxServer? You didn't find an answer in our documentation? Please, post your questions here!

Moderators: Lapo, Bax

Sparticus
Posts: 217
Joined: 27 Feb 2006, 17:44
Location: Canada
Contact:

Error message I can't figure out

Postby Sparticus » 01 Mar 2006, 18:24

I am trying to debug and error message that appears in my server logs, but can't figure it out :

2006/03/01 11:27:48.218 - [ WARNING ] [id: 18] (SmartFoxServer.acceptNewConnections): Generic Exception in acceptNewConnections():java.nio.channels.ClosedSelectorException

The weird thing is everything "seems" to be working fine... so it's hard to figure out what's cause this error.
User avatar
Lapo
Site Admin
Posts: 21596
Joined: 21 Mar 2005, 09:50
Location: Italy

Postby Lapo » 01 Mar 2006, 19:27

Not a very common error. :shock:
What OS are you using?
What Java runtime version?
Is it running locally or online?
How frequently does it happen?
Do you use a wireless network card?
Lapo
--
gotoAndPlay()
...addicted to flash games
Sparticus
Posts: 217
Joined: 27 Feb 2006, 17:44
Location: Canada
Contact:

Postby Sparticus » 01 Mar 2006, 19:45

Windows XP Pro for the client.... and a differernt box for the server which is also windows XP pro

My java runtime version is :

I connect to the server over the internet... although I run the client straight from Macromedia Flash application (in other words, I don't run it froma website).

It only started happing within the last hour.... but now it happens every time I restart the server (and only when the server is restarted.... no other times).

I don't use a wireless card

thanx
Sparticus
Posts: 217
Joined: 27 Feb 2006, 17:44
Location: Canada
Contact:

Postby Sparticus » 01 Mar 2006, 19:46

whoops...one sec... I'll get you my java version
Sparticus
Posts: 217
Joined: 27 Feb 2006, 17:44
Location: Canada
Contact:

Postby Sparticus » 01 Mar 2006, 19:50

version :

java version "1.5.0_06"
Sparticus
Posts: 217
Joined: 27 Feb 2006, 17:44
Location: Canada
Contact:

Postby Sparticus » 01 Mar 2006, 20:05

Hmm... I found the error... but can't seem to figure out how to fix it.

I connected to postgres database sucessfully....

I ran a query that returned no no rows... and when i tried to perform some operations on the empty result it died.... I "think" I makde sure the recordset returned isn't empty before pulling data from it....any ideas?


Code: Select all

var sql = "SELECT password FROM accounts where username = '" + nick + "'"
            trace(sql);
            var queryRes = dbase.executeQuery(sql)
            if (queryRes != null)
            {
               // get the row returned
               var tempRow = queryRes.get(0)
               var dbpass = tempRow.getItem("password")
}
            else
            {
               trace("db query failed");
            }
Sparticus
Posts: 217
Joined: 27 Feb 2006, 17:44
Location: Canada
Contact:

Postby Sparticus » 01 Mar 2006, 20:28

if you're curious... here is the error message I found in the console. I see that it's an out of bounds error... but since I used the :

if (queryRes != null)

It shouldn't even run that code which goes out of bounds.... hmm



org.mozilla.javascript.WrappedException: Wrapped java.lang.IndexOutOfBoundsExce
tion: Index: 0, Size: 0 (dbExtension.as#1134)
at org.mozilla.javascript.Context.throwAsScriptRuntimeEx(Context.java:1
76)
at org.mozilla.javascript.MemberBox.invoke(MemberBox.java:191)
at org.mozilla.javascript.NativeJavaMethod.call(NativeJavaMethod.java:1
7)
at org.mozilla.javascript.optimizer.OptRuntime.call1(OptRuntime.java:63

at org.mozilla.javascript.gen.c16._c50(dbExtension.as:1134)
at org.mozilla.javascript.gen.c16._c40(dbExtension.as:807)
at org.mozilla.javascript.gen.c16.call(dbExtension.as)
at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:
04)
at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:27
9)
at org.mozilla.javascript.gen.c16.call(dbExtension.as)
at it.gotoandplay.smartfoxserver.extensions.JavascriptExtension.callJav
ScriptFunction(JavascriptExtension.java:424)
at it.gotoandplay.smartfoxserver.extensions.JavascriptExtension.handleI
ternalEvent(JavascriptExtension.java:177)
at it.gotoandplay.smartfoxserver.controllers.MessageHandler.dispatchEve
t(MessageHandler.java:122)
at it.gotoandplay.smartfoxserver.controllers.SystemHandler.handleLoginR
quest(SystemHandler.java:370)
at it.gotoandplay.smartfoxserver.controllers.SystemHandler.processEvent
SystemHandler.java:164)
at it.gotoandplay.smartfoxserver.controllers.SystemHandler.run(SystemHa
dler.java:112)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
at java.util.ArrayList.RangeCheck(Unknown Source)
at java.util.ArrayList.get(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.mozilla.javascript.MemberBox.invoke(MemberBox.java:174)
... 15 more
User avatar
Lapo
Site Admin
Posts: 21596
Joined: 21 Mar 2005, 09:50
Location: Italy

Postby Lapo » 02 Mar 2006, 06:28

It's likely that your query didn't return any value.

You should modify the code:

Code: Select all

if (queryRes != null)

to

Code: Select all

if (queryRes != null && queryRes.size() > 0)
Lapo

--

gotoAndPlay()

...addicted to flash games

Return to “SmartFoxServer 1.x Discussions and Help”

Who is online

Users browsing this forum: No registered users and 11 guests