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.
Error message I can't figure out
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
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
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?
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");
}
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
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
It's likely that your query didn't return any value.
You should modify the code:
to
You should modify the code:
Code: Select all
if (queryRes != null)
to
Code: Select all
if (queryRes != null && queryRes.size() > 0)
Return to “SmartFoxServer 1.x Discussions and Help”
Who is online
Users browsing this forum: No registered users and 75 guests