Page 1 of 1
Problem: Server won't launch
Posted: 08 Jul 2011, 18:46
by Damace
I made a shell script in /usr/bin, that was supposed to execute sfs2x.sh, so I could start SmartFox Server from any directory.
The script didn't work, and now when I try to launch the server with the native sfs2x.sh, it throws this exception.
Exception: java.net.BindException
Message: Address already in use
Description: Unexpected error during Server boot. The server cannot start.
Solution: Please email us the content of this error message, including the stack trace to
support@smartfoxserver.com
+--- --- ---+
Stack Trace:
+--- --- ---+
sun.nio.ch.Net.bind(Native Method)
sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:126)
sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:59)
org.mortbay.jetty.nio.SelectChannelConnector.open(SelectChannelConnector.java:216)
org.mortbay.jetty.nio.SelectChannelConnector.doStart(SelectChannelConnector.java:315)
org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
org.mortbay.jetty.Server.doStart(Server.java:235)
org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
com.smartfoxserver.v2.http.SFSHttpServer.start(SFSHttpServer.java:110)
com.smartfoxserver.v2.SmartFoxServer.start(SmartFoxServer.java:231)
com.smartfoxserver.v2.Main.main(Main.java:31)
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
Tried to reinstall the server - didn't work.
Posted: 08 Jul 2011, 18:59
by Damace
Uninstalled. Deleted the SFS2X installation folder. Restarted. Installed RC1a, updated to RC3. Up and running..
Posted: 10 Jul 2011, 12:58
by Bax
The error message simply meant that you had another instance of SFS2X already running (probably as a service).
Posted: 10 Jul 2011, 15:02
by Damace
I want to be able to
restart the SFS from the AdminTool, but something is wrong, and I don't know what.
Here is what I do:
1) Install SFS2X
2) Go to AdminTool
3) Do something
4) Press restart button in the AdminTool so the changes will take place
5) Get an error saying ./sfs2x.sh permission denied
6) Goto terminal to fix the permissions on the sfs2x.sh
7) chmod go+x sfs2x.sh
8) Start the server again via SFS2X.app
9) Try to restart it from the AdminTool
10) Don't get the permissions error, but get the error from the first post
11) Listen to smart people on the forum and
try to shut down the sfs2x-service (./sfs2x-service stop)
12) Try to start the server again and get this:
Code: Select all
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
Exception: java.net.BindException
Message: Address already in use
Description: Unexpected error during Server boot. The server cannot start.
Solution: Please email us the content of this error message, including the stack trace to support@smartfoxserver.com
+--- --- ---+
Stack Trace:
+--- --- ---+
sun.nio.ch.Net.bind(Native Method)
sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:126)
sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:59)
org.mortbay.jetty.nio.SelectChannelConnector.open(SelectChannelConnector.java:216)
org.mortbay.jetty.nio.SelectChannelConnector.doStart(SelectChannelConnector.java:315)
org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
org.mortbay.jetty.Server.doStart(Server.java:235)
org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
com.smartfoxserver.v2.http.SFSHttpServer.start(SFSHttpServer.java:110)
com.smartfoxserver.v2.SmartFoxServer.start(SmartFoxServer.java:231)
com.smartfoxserver.v2.Main.main(Main.java:31)
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
I must say that all of this is just to get the Restart button in the AdminTool to work. And it is still not working.
Posted: 11 Jul 2011, 00:57
by jurekf
It's the Jetty web server in SFS that can't start because another web server has already taken its preferred port. There's another thread on the forum with the same problem but I can't find it now.
1. Shut down SFS2X
2. Go to
http://localhost:8080
3. Figure out what webserver that is, and shut it down as well
Posted: 11 Jul 2011, 11:54
by Damace
If I shutdown SFS2X then
http://localhost:8080/ doesn't load.
Posted: 12 Jul 2011, 00:46
by jurekf
Perhaps SFS2X is starting twice. Check TaskManager or ps -A and see how many java processes are started.
Posted: 12 Jul 2011, 08:42
by Bax
Which operating system are you using?
Posted: 12 Jul 2011, 12:07
by Damace
When I first start SFS2X there is only 1 java process:
Code: Select all
mys-macbook-air:bin Damace$ ps -ax | grep java
4154 ?? 0:10.82 /usr/bin/java -cp ./:build/:lib/*:lib/Jetty/*:extensions/__lib__/* -Dfile.encoding=UTF-8 com.smartfoxserver.v2.Main
When I hit the restart button, the SFS2X.app shows this log:
Code: Select all
17:02:36,822 INFO [com.smartfoxserver.v2.controllers.ExtensionController-1] Extensions - {Admin}: Restarting SmartFoxServer...
17:02:36,827 WARN [com.smartfoxserver.v2.controllers.ExtensionController-1] v2.SmartFoxServer - *** SERVER RESTARTING ***
17:02:37,898 WARN [SocketWriter-1] core.SocketWriter - SocketWriter thread interruped: Thread[SocketWriter-1,5,main]
17:02:37,897 WARN [Scheduler1-thread-1] bootLogger - Scheduler: scheduler interrupted.
17:02:40,405 INFO [com.smartfoxserver.v2.controllers.ExtensionController-1] controllers.SystemController - Controller stopping: com.smartfoxserver.v2.controllers.SystemController, Unprocessed tasks: 0
17:02:40,405 INFO [com.smartfoxserver.v2.controllers.ExtensionController-1] controllers.ExtensionController - Controller stopping: com.smartfoxserver.v2.controllers.ExtensionController, Unprocessed tasks: 0
17:02:40,405 WARN [com.smartfoxserver.v2.controllers.SystemController-1] controllers.SystemController - Controller main loop was interrupted
17:02:40,408 INFO [com.smartfoxserver.v2.controllers.ExtensionController-1] sessions.DefaultSessionManager - Session removed: { Id: 2, Type: DEFAULT, Logged: Yes, IP: 127.0.0.1:54544 }
17:02:40,410 WARN [com.smartfoxserver.v2.controllers.SystemController-1] controllers.SystemController -
java.lang.InterruptedException
java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.reportInterruptAfterWait(AbstractQueuedSynchronizer.java:1961)
java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:1996)
java.util.concurrent.PriorityBlockingQueue.take(PriorityBlockingQueue.java:220)
com.smartfoxserver.bitswarm.controllers.AbstractController.run(AbstractController.java:95)
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
java.lang.Thread.run(Thread.java:680)
17:02:40,416 WARN [com.smartfoxserver.v2.controllers.ExtensionController-1] bootLogger - Error when shutting down Accept selector: sleep interrupted
17:02:40,417 WARN [com.smartfoxserver.v2.controllers.ExtensionController-1] bootLogger -
java.lang.InterruptedException: sleep interrupted
java.lang.Thread.sleep(Native Method)
com.smartfoxserver.bitswarm.core.SocketAcceptor.destroy(SocketAcceptor.java:118)
com.smartfoxserver.bitswarm.core.BitSwarmEngine.stopCoreServices(BitSwarmEngine.java:397)
com.smartfoxserver.bitswarm.core.BitSwarmEngine.shutDownSequence(BitSwarmEngine.java:311)
com.smartfoxserver.v2.SmartFoxServer.restart(SmartFoxServer.java:308)
com.smartfoxserver.v2.admin.handlers.AdminReqHandler.handleClientRequest(AdminReqHandler.java:50)
com.smartfoxserver.v2.extensions.SFSExtension.handleClientRequest(SFSExtension.java:192)
com.smartfoxserver.v2.controllers.ExtensionController.processRequest(ExtensionController.java:137)
com.smartfoxserver.bitswarm.controllers.AbstractController.run(AbstractController.java:96)
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
java.lang.Thread.run(Thread.java:680)
17:02:40,488 INFO [:::SFSRestarter:::] util.SFSRestart - Process restarted: java.lang.UNIXProcess@5e9c8834
17:02:44,498 WARN [SFS2X ShutdownHook] core.SFSShutdownHook - SFS2X is shutting down. The process may take a few seconds...
17:02:44,501 INFO [Thread-1] managers.SFSZoneManager - BuddyList saveAll...
17:02:44,520 INFO [Thread-2] managers.SFSBannedUserManager - BanUser data saved.
Now if I check the java processes, then there is still 1 running, differing from the first one, but there is no instance of SFS:
Code: Select all
mys-macbook-air:bin Damace$ ps -ax | grep java
4646 ?? 0:07.64 /usr/bin/java -cp ./:lib/*:lib/Jetty/*:extensions/__lib__/* -Dfile.encoding=UTF-8 com.smartfoxserver.v2.Main
Lastly if I try to start up SFS2X.app, then this log comes up:
Code: Select all
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
Exception: java.net.BindException
Message: Address already in use
Description: Unexpected error during Server boot. The server cannot start.
Solution: Please email us the content of this error message, including the stack trace to support@smartfoxserver.com
+--- --- ---+
Stack Trace:
+--- --- ---+
sun.nio.ch.Net.bind(Native Method)
sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:126)
sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:59)
org.mortbay.jetty.nio.SelectChannelConnector.open(SelectChannelConnector.java:216)
org.mortbay.jetty.nio.SelectChannelConnector.doStart(SelectChannelConnector.java:315)
org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
org.mortbay.jetty.Server.doStart(Server.java:235)
org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
com.smartfoxserver.v2.http.SFSHttpServer.start(SFSHttpServer.java:110)
com.smartfoxserver.v2.SmartFoxServer.start(SmartFoxServer.java:231)
com.smartfoxserver.v2.Main.main(Main.java:31)
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
And if I check my java processes after this then there are 2 running:
Code: Select all
mys-macbook-air:bin Damace$ ps -ax | grep java
4646 ?? 0:08.29 /usr/bin/java -cp ./:lib/*:lib/Jetty/*:extensions/__lib__/* -Dfile.encoding=UTF-8 com.smartfoxserver.v2.Main
4655 ?? 0:06.86 /usr/bin/java -cp ./:build/:lib/*:lib/Jetty/*:extensions/__lib__/* -Dfile.encoding=UTF-8 com.smartfoxserver.v2.Main
2 bax: I running OS X 1.6.7
P.S. It is definitely about too much SFS2X running at the same time, because after all that I just described I did "jps -l" and 2 smartfoxserver processes came up. I killed them and successfully started SFS2X.
Posted: 12 Jul 2011, 13:41
by Bax
You should read the informations about the
Restart feature contained in the yellow box near the bottom of
this page.
The restart is working fine (those errors you see are normal and make no harm): it simply creates a new process which isn't running in the terminal anymore. In fact if you try to connect to the server instance using the AdminTool, you will succeed.
Posted: 12 Jul 2011, 18:11
by Damace
Yes, I already read that.
Problem is that when I restart the server from the AdminTool SFS2X.app stops logging and the only button left for me to press is "Quit". Is that supposed to be that way - no visible logs after restart from AdminTool?
Posted: 13 Jul 2011, 08:24
by Bax
Not in the terminal window, but the SFS log files are still updated of course.
Posted: 13 Jul 2011, 11:22
by Damace
I don't use terminal window, I only use SFS2X.app and AdminTool.
I'll rephrase - Is there a way to restart SFS2X from AdminTool and after that see real-time the logs in SFS2X.app like it was just opened? Because right now after restart I can only close SFS2X.app.
Posted: 13 Jul 2011, 11:34
by Bax
SFS2X.app is just a wrapped terminal window, more or less.
Anyway, the answer is no: the restart button of the AdminTool terminates the current process (the one started by SFS2X.app) and launches a new one executing the startup script directly.
Posted: 13 Jul 2011, 12:31
by Damace
Ok, I guess this sums it up.