"Address already in use" when trying to start XMPP server

0

I've been trying to start a pre-compiled executable that launches an XMPP service but to no avail. This is the project where the executable was from http://sourceforge.net/projects/androidpn/.

My setup is a single box (ubuntu server OS) with two IP addresses (lets call them IP1 and IP2). Every time I try to start the XMPP server, I will get an error "Address already in use" from the Java executable. The ports used by XMPP are free and just to be sure, I made sure that Apache only listens to ports on IP1. However, I am still unable to get the XMPP server to start.

Would it be an issue with the way my 2 IP addresses are set up? Or is there something else I'm missing?

Thanks in advance.

Edit: Thanks to Paul, netstat -pant shows this particular line (5222 is a port used the XMPP server):

tcp 0 0 0.0.0.0:5222 0.0.0.0:* LISTEN 14085/citserver

I am assuming that 0.0.0.0 is referring to all IPs. As I have two IP addresses on this box, would there be a way make citserver/webcit/citadel listen only on the first IP, freeing the same port for the pre-compiled XMPP on the second IP?

p.s. a chunk of the log that describes the error:

{INFO } [2012-06-13 11:23:22,578] <org.hibernate.impl.SessionFactoryImpl> : closing
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'ioAcceptor' defined in class path resource [spring-config.xml]: Invocation of init method failed; nested exception is java.net.BindException: Address already in use
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1338)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:473)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)
        at java.security.AccessController.doPrivileged(Native Method)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380)
        at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264)
        at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
        at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261)
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185)
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:429)
        at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:728)
        at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:380)
        at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:139)
        at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:83)
        at org.androidpn.server.xmpp.XmppServer.start(XmppServer.java:91)
        at org.androidpn.server.xmpp.XmppServer.<init>(XmppServer.java:76)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:532)
        at java.lang.Class.newInstance0(Class.java:372)
        at java.lang.Class.newInstance(Class.java:325)
        at org.androidpn.server.starter.ServerStarter.start(ServerStarter.java:82)
        at org.androidpn.server.starter.ServerStarter.main(ServerStarter.java:48)
Caused by: java.net.BindException: Address already in use
        at sun.nio.ch.Net.bind(Native Method)
        at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:137)
        at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:77)
        at org.apache.mina.transport.socket.nio.NioSocketAcceptor.open(NioSocketAcceptor.java:251)
        at org.apache.mina.transport.socket.nio.NioSocketAcceptor.open(NioSocketAcceptor.java:48)
        at org.apache.mina.core.polling.AbstractPollingIoAcceptor.registerHandles(AbstractPollingIoAcceptor.java:523)
        at org.apache.mina.core.polling.AbstractPollingIoAcceptor.access$200(AbstractPollingIoAcceptor.java:65)
        at org.apache.mina.core.polling.AbstractPollingIoAcceptor$Acceptor.run(AbstractPollingIoAcceptor.java:407)
        at org.apache.mina.util.NamePreservingRunnable.run(NamePreservingRunnable.java:64)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
        at java.lang.Thread.run(Thread.java:679)
{INFO } [2012-06-13 11:23:22,596] <org.androidpn.server.xmpp.XmppServer> : XmppServer stopped

Reuben L.

Posted 2012-06-13T03:24:41.757

Reputation: 942

What OS are you running on? What ports is the XMPP server intending to listen on? Have you confirmed they are definitely free with netstat -an? – Paul – 2012-06-13T03:47:49.073

hi Paul, i'm on ubuntu server. I'm certain as the IP is totally clean. Furthermore, the default ports for XMPP do not clash with any of the ports listed on netstat. – Reuben L. – 2012-06-13T05:35:25.043

The XMPP server disagrees with you. Please [edit] and add the ports XMPP expects to use, along with the results of sudo netstat -pant – Paul – 2012-06-13T05:37:04.490

i might have spoken too soon. I think my citadel server is listening on a port needed by the XMPP server: tcp 0 0 0.0.0.0:5222 0.0.0.0:* LISTEN 14085/citserver

How do I make citadel/citserver listen on the ports of IP1 only (so that I can use the same ports on IP2)? – Reuben L. – 2012-06-13T07:00:59.257

Please update your question to reflect the new query and additional information. – Paul – 2012-06-13T07:38:45.367

No answers