port already in use problem

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

Moderators: Lapo, Bax

luoruize
Posts: 21
Joined: 25 Aug 2009, 11:07

port already in use problem

Postby luoruize » 18 Sep 2009, 09:06

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?
User avatar
Lapo
Site Admin
Posts: 21442
Joined: 21 Mar 2005, 09:50
Location: Italy

Postby Lapo » 19 Sep 2009, 11:27

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
Lapo
--
gotoAndPlay()
...addicted to flash games
luoruize
Posts: 21
Joined: 25 Aug 2009, 11:07

Postby luoruize » 19 Sep 2009, 14:14

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.
Molix
Posts: 40
Joined: 01 Apr 2009, 19:34
Location: Toronto, ON, Canada

Postby Molix » 09 Oct 2009, 19:02

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?
User avatar
alexgenaud
Posts: 13
Joined: 05 Oct 2009, 12:57
Location: Copenhagen, DK
Contact:

Multiple servers, same machine

Postby alexgenaud » 02 Nov 2009, 14:00

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?
User avatar
Lapo
Site Admin
Posts: 21442
Joined: 21 Mar 2005, 09:50
Location: Italy

Postby Lapo » 02 Nov 2009, 14:09

Sure, by adding the <H2EnginePort>XXX</H2EnginePort> to the config, under the ServerSetup node, wherer XXX is your new port value.
Lapo

--

gotoAndPlay()

...addicted to flash games
User avatar
alexgenaud
Posts: 13
Joined: 05 Oct 2009, 12:57
Location: Copenhagen, DK
Contact:

Postby alexgenaud » 02 Nov 2009, 18:29

Excellent. Thanks Lapo
u007
Posts: 18
Joined: 04 Sep 2009, 11:22

Postby u007 » 15 Dec 2009, 03:10

Hmm 1.6.9 doesnt support * as ip.

<ServerIP>127.0.0.1/or your lan ip</ServerIP>
smilefr
Posts: 58
Joined: 23 Mar 2009, 16:50
Location: France

Postby smilefr » 15 Dec 2009, 12:18

From my experience, it does but only on linux servers.
User avatar
Lapo
Site Admin
Posts: 21442
Joined: 21 Mar 2005, 09:50
Location: Italy

Postby Lapo » 15 Dec 2009, 13:44

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
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 9 guests