Project

General

Profile

Tigase 7.0.0 install with mongodb and http api - address already in use

NW NE
Added about 4 years ago

Hi,

I have been really happy when i had saw mongodb supporting in the lates release, so I decided to switch from 5.2.0 to 7.0.0.

I also want to use http api, but 8080 port is already used by tomcat.

I set http/port[I] = 8082, but I get

2015-03-11 20:00:17.451 [main] JavaStandaloneHttpServer.start() SEVERE: null

java.net.BindException: Address already in use

at sun.nio.ch.Net.bind0(Native Method)

at sun.nio.ch.Net.bind(Net.java:344)

at sun.nio.ch.Net.bind(Net.java:336)

at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:199)

at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:74)

at sun.net.httpserver.ServerImpl.<init>(ServerImpl.java:98)

at sun.net.httpserver.HttpServerImpl.<init>(HttpServerImpl.java:50)

at sun.net.httpserver.DefaultHttpServerProvider.createHttpServer(DefaultHttpServerProvider.java:35)

at com.sun.net.httpserver.HttpServer.create(HttpServer.java:129)

at tigase.http.java.JavaStandaloneHttpServer.start(JavaStandaloneHttpServer.java:55)

at tigase.http.HttpServer.start(HttpServer.java:85)

at tigase.http.HttpMessageReceiver.setProperties(HttpMessageReceiver.java:193)

at tigase.conf.ConfiguratorAbstract.setup(ConfiguratorAbstract.java:540)

at tigase.conf.ConfiguratorAbstract.componentAdded(ConfiguratorAbstract.java:177)

at tigase.conf.Configurator.componentAdded(Configurator.java:50)

at tigase.conf.Configurator.componentAdded(Configurator.java:33)

at tigase.server.AbstractComponentRegistrator.addComponent(AbstractComponentRegistrator.java:116)

at tigase.server.MessageRouter.addComponent(MessageRouter.java:108)

at tigase.server.MessageRouter.addRouter(MessageRouter.java:145)

at tigase.server.MessageRouter.setProperties(MessageRouter.java:704)

at tigase.conf.ConfiguratorAbstract.setup(ConfiguratorAbstract.java:540)

at tigase.conf.ConfiguratorAbstract.componentAdded(ConfiguratorAbstract.java:177)

at tigase.conf.Configurator.componentAdded(Configurator.java:50)

at tigase.conf.Configurator.componentAdded(Configurator.java:33)

at tigase.server.AbstractComponentRegistrator.addComponent(AbstractComponentRegistrator.java:116)

at tigase.server.MessageRouter.addRegistrator(MessageRouter.java:131)

at tigase.server.MessageRouter.setConfig(MessageRouter.java:603)

at tigase.server.XMPPServer.start(XMPPServer.java:142)

at tigase.server.XMPPServer.main(XMPPServer.java:112)

error message. As I understand it is come from Jetty. Of course nothing uses port 8082 on my system.

What does it mean? I set http/port incorrectly and Jetty tries to connect to 8080 or ... ?

I also have another error message as well:

2015-03-11 20:00:21.326 [main] Configurator.componentAdded() WARNING: ignoring NPE

java.lang.NullPointerException

at tigase.stun.StunComponent.init(StunComponent.java:164)

at tigase.stun.StunComponent.setProperties(StunComponent.java:115)

at tigase.conf.ConfiguratorAbstract.setup(ConfiguratorAbstract.java:540)

at tigase.conf.ConfiguratorAbstract.componentAdded(ConfiguratorAbstract.java:177)

at tigase.conf.Configurator.componentAdded(Configurator.java:50)

at tigase.conf.Configurator.componentAdded(Configurator.java:33)

at tigase.server.AbstractComponentRegistrator.addComponent(AbstractComponentRegistrator.java:116)

at tigase.server.MessageRouter.addComponent(MessageRouter.java:108)

at tigase.server.MessageRouter.addRouter(MessageRouter.java:145)

at tigase.server.MessageRouter.setProperties(MessageRouter.java:704)

at tigase.conf.ConfiguratorAbstract.setup(ConfiguratorAbstract.java:540)

at tigase.conf.ConfiguratorAbstract.componentAdded(ConfiguratorAbstract.java:177)

at tigase.conf.Configurator.componentAdded(Configurator.java:50)

at tigase.conf.Configurator.componentAdded(Configurator.java:33)

at tigase.server.AbstractComponentRegistrator.addComponent(AbstractComponentRegistrator.java:116)

at tigase.server.MessageRouter.addRegistrator(MessageRouter.java:131)

at tigase.server.MessageRouter.setConfig(MessageRouter.java:603)

at tigase.server.XMPPServer.start(XMPPServer.java:142)

at tigase.server.XMPPServer.main(XMPPServer.java:112)

I installed tigase 7.0.0 manually downloading tigase-server-7.0.0-b3802-dist-max.tar.gz and having conf and properties files below:

tigase.conf:

#osgiEnabled=(true|false)

#osgiEnabled=false

OSGI=false

ENC="-Dfile.encoding=UTF-8 -Dsun.jnu.encoding=UTF-8"

DRV="-Djdbc.drivers=com.mysql.jdbc.Driver:org.postgresql.Driver:org.apache.derby.jdbc.EmbeddedDriver"

#GC="-XX:+UseBiasedLocking -XX:+UseConcMarkSweepGC -XX:+CMSIncrementalMode -XX:ParallelCMSThreads=2 -XX:-ReduceInitialCardMarks"

#EX="-XX:+OptimizeStringConcat -XX:+DoEscapeAnalysis -XX:+UseNUMA"

#JMX_REMOTE_IP="-Djava.rmi.server.hostname=0.0.0.0"

JAVA_HOME="/usr/lib/jvm/java-7-oracle"

CLASSPATH=""

JAVA_OPTIONS="${GC} ${EX} ${ENC} ${DRV} ${JMX_REMOTE_IP} -server -Xms100M -Xmx200M -XX:PermSize=32m -XX:MaxPermSize=256m -XX:MaxDirectMemorySize=128m "

TIGASE_CONFIG="etc/tigase.xml"

TIGASE_OPTIONS=" --property-file etc/init.properties "

init.properties

--comp-class-1 = tigase.muc.MUCComponent

--virt-hosts = tigase.mydomain.com

--user-db-uri = mongodb://localhost/tigase_test

--admins = admin@tigase.mydomain.com

--comp-name-6 = message-archive

--comp-name-5 = http

--comp-name-4 = stun

--comp-name-3 = proxy

config-type = --gen-config-all

--comp-name-2 = pubsub

--comp-name-1 = muc

--cluster-mode = false

--sm-plugins = +message-archive-xep-0136,+jabber:iq:auth,+urn:ietf:params:xml:ns:xmpp-sasl,+urn:ietf:params:xml:ns:xmpp-bind,+urn:ietf:params:xml:ns:xmpp-session,+jabber:iq:register,+jabber:iq:roster,+presence,+jabber:iq:privacy,+jabber:iq:version,+http://jabber.org/protocol/stats,+starttls,+msgoffline,+vcard-temp,+http://jabber.org/protocol/commands,+jabber:iq:private,+urn:xmpp:ping,+basic-filter,+domain-filter,+pep,-zlib

--comp-class-6 = tigase.archive.MessageArchiveComponent

--debug = server,db

http/port[I] = 8082

--comp-class-5 = tigase.http.HttpMessageReceiver

--comp-class-4 = tigase.stun.StunComponent

--comp-class-3 = tigase.socks5.Socks5ProxyComponent

--comp-class-2 = tigase.pubsub.PubSubComponent

Thank you and respect if you have any hint!


Replies (2)

Added by Andrzej Wójcik IoT 1 CloudTigaseTeam about 4 years ago

As for issue with HTTP port, you properly used http/port[I] but in your case it should be http/http/port[I] as http/port[I] is name of property used by HTTP component which needs to be prefixed by component name (in your case it is http as well).

As for NPE in StunComponent - this component requires additonal configuration to be done (see https://projects.tigase.org/projects/stun/wiki/Configuration), but this NPE should not cause additional issues outside Stun component.

One more thing - Tigase HTTP API may use Jetty if it is configured to do so, but by default it uses simple HTTP Server which is embedded in Java. We decided to used Jetty only as optional server implementation to be able to use more advanced features when needed but not to depend on Jetty.

Added by NW NE about 4 years ago

works like a charm! Thank you!

    (1-2/2)