Page 1 of 1

port already in use problem

Posted: 18 Sep 2009, 09:06
by luoruize
About a couple of weeks ago I managed to successfully install SFS on my server, and it worked well. Today I tried to check something on the server, but now SFS won't run. Checking the console, I receive several errors. Strangely, the exact same errors are received when trying to run a SFS server a second time on the same machine... I'm totally baffled by this, because the ports are open and there shouldn't be any problem with it. Here's the console output:

11:57:18.406 - [ INFO ] > Starting h2 engine...
11:57:18.500 - [ WARNING ] > Cannot start H2 Engine: org.h2.jdbc.JdbcSQLExceptio
n: Exception opening port 9009 (port may be in use), cause: java.net.BindExcepti
on: Address already in use: JVM_Bind [90061-60]
org.h2.jdbc.JdbcSQLException: Exception opening port 9009 (port may be in use),
cause: java.net.BindException: Address already in use: JVM_Bind [90061-60]
at org.h2.message.Message.getSQLException(Message.java:84)
at org.h2.util.NetUtils.createServerSocketTry(NetUtils.java:54)
at org.h2.util.NetUtils.createServerSocket(NetUtils.java:39)
at org.h2.server.TcpServer.start(TcpServer.java:125)
at org.h2.tools.Server.start(Server.java:362)
at it.gotoandplay.smartfoxserver.SmartFoxServer.bootH2Engine(SmartFoxSer
ver.java:530)
at it.gotoandplay.smartfoxserver.SmartFoxServer.run(SmartFoxServer.java:
579)
Caused by: java.net.BindException: Address already in use: JVM_Bind
at java.net.PlainSocketImpl.socketBind(Native Method)
at java.net.PlainSocketImpl.bind(PlainSocketImpl.java:359)
at java.net.ServerSocket.bind(ServerSocket.java:319)
at java.net.ServerSocket.<init>(ServerSocket.java:185)
at java.net.ServerSocket.<init>(ServerSocket.java:97)
at org.h2.util.NetUtils.createServerSocketTry(NetUtils.java:51)
... 5 more


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

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

os.name: Windows XP
os.arch: x86
os.version: 5.1
java.version: 1.6.0_13
java.vendor: Sun Microsystems Inc.
java.vendor.url: http://java.sun.com/
java.vm.specification.version: 1.0
java.vm.version: 11.3-b02
java.vm.vendor: Sun Microsystems Inc.
java.vm.name: Java HotSpot(TM) Server VM


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

Card:MS TCP Loopback interface
-> 127.0.0.1
Card:Realtek RTL8168/8111 PCI-E Gigabit Ethernet NIC
-> 10.0.0.1


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

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

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

11:57:21.062 - [ INFO ] > Default Buddy List Persister <INITED>
11:57:21.062 - [ WARNING ] > Can't initialize BuddyListManager with passed list-
size of: 0
DB Manager Activated ( org.h2.Driver )
Zone: ImperoGalactica

Lobby (id: 1, max: 500, pass:N)
11:57:21.812 - [ INFO ] > Zone Extension [ login_ext ] created, for zone:ImperoG
alactica
[testExtension.as]: Welcome to the extention!

11:57:21.828 - [ SEVERE ] >

[ --> FATAL ERROR <-- ]: Error initializing server.

Check if server address and port are properly configured.

Exception caught in SmartFoxServer
java.net.BindException: Address already in use: bind
at sun.nio.ch.Net.bind(Native Method)
at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:
119)
at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:59)
at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:52)
at it.gotoandplay.smartfoxserver.SmartFoxServer.initServerSocket(SmartFo
xServer.java:411)
at it.gotoandplay.smartfoxserver.SmartFoxServer.run(SmartFoxServer.java:
607)


Shutting down server...

Press any key to continue . . .


Any thoughts?

Posted: 19 Sep 2009, 11:27
by Lapo
Yes, you are trying to start SmartFox while another instance is already running. Simply shut down the previous version, or if you simply want to check its status connect to it via the Admin Tool

Posted: 19 Sep 2009, 14:14
by luoruize
I thought that that was the problem, but I checked the processes running in the background, and SFS wasn't one of them. I also tried running the admin tool to see if maybe I'm process-blind, but it also couldn't connect... I had to change the ports on which SFS and the embedded DB are running on, and now it's working properly.

Posted: 09 Oct 2009, 19:02
by Molix
Is running multiple instances of SFS on the same machine frowned upon? We've been doing it for a short while, with them just set to different ports. It is kind of necessary so we can test out changes while others keep working with the existing setup.

But I noticed the warning in the logs today (the server starts, but it says H2 doesn't). I could not find 9009 in any of our config files; is it hard-coded somewhere, or can we change it?

Multiple servers, same machine

Posted: 02 Nov 2009, 14:00
by alexgenaud
Hi, I'd like to run multiple servers on the same machine (for development). I've modified the port for each SFS config.xml, but there is a Bind conflict on port 9009 - the H2 engines. Can that be altered as well?

Posted: 02 Nov 2009, 14:09
by Lapo
Sure, by adding the <H2EnginePort>XXX</H2EnginePort> to the config, under the ServerSetup node, wherer XXX is your new port value.

Posted: 02 Nov 2009, 18:29
by alexgenaud
Excellent. Thanks Lapo

Posted: 15 Dec 2009, 03:10
by u007
Hmm 1.6.9 doesnt support * as ip.

<ServerIP>127.0.0.1/or your lan ip</ServerIP>

Posted: 15 Dec 2009, 12:18
by smilefr
From my experience, it does but only on linux servers.

Posted: 15 Dec 2009, 13:44
by Lapo
u007
Please provide more details about the problem.
Also please note that no 1.6.9 version exists. Version 1.6.8 is the very last.

Issue posting rules here:
viewtopic.php?t=3307