Project

General

Profile

Newbie Question- Support Account Creation

Uma S
Added about 5 years ago

I have tigase5.1 installed on my windows 7 box and derby database.

The server starts up with no issues.

In my android app connected to tigase using xmpp/asmack, I would like to create accounts on the fly (without administrator intervention)

if (!currentConn.isAuthenticated()){

        AccountManager acManager = new AccountManager(currentConn);

        acManager.supportsAccountCreation(); }

Some googling led me to believe that I shud have jdbc:derby://localhost/tigasedb?user=admin?password=tigase?autoCreateUser=true (even though it is mentioned for an external DB repository). If I start my server with --user-db-uri as the above, the server gives an intialization exception initializing the jdbc connection.

The server earlier had --user-db-uri=jdbc:derby:c://tigase//tigase-config-type.

Is there any other parameter or configuration that I need to do?


Replies (4)

Added by Uma S about 5 years ago

Server start up log

c:\Tigase>java -cp "jars/tigase-server.jar;libs/*" -Djdbc.drivers=com.mysql.jdbc.Driver tigase.server.XMPPServer --property-file etc/init.properties
2013-12-06 11:52:08  DNSResolver.<clinit>()              WARNING:  Resolving default host name took: 15
2013-12-06 11:52:08  ConfiguratorAbstract.parseArgs()    CONFIG:   Setting defaults: --property-file=etc/init.properties
2013-12-06 11:52:08  ConfiguratorAbstract.parseArgs()    CONFIG:   Loading initial properties from property file: etc/init.properties
2013-12-06 11:52:08  ConfiguratorAbstract.parseArgs()    CONFIG:   Added default config parameter: (--user-db=derby)
2013-12-06 11:52:08  ConfiguratorAbstract.parseArgs()    CONFIG:   Added default config parameter: (--admins=admin@user-pc)
2013-12-06 11:52:08  ConfiguratorAbstract.parseArgs()    CONFIG:   Added default config parameter: (--user-db-uri=jdbc:derby:c:\Tigase\tigasedb)
2013-12-06 11:52:08  ConfiguratorAbstract.parseArgs()    CONFIG:   Added default config parameter: (config-type=--gen-config-def)
2013-12-06 11:52:08  ConfiguratorAbstract.parseArgs()    CONFIG:   Added default config parameter: (--virt-hosts=user-pc)
2013-12-06 11:52:08  ConfiguratorAbstract.parseArgs()    CONFIG:   Added default config parameter: (--debug=server)
2013-12-06 11:52:08  MessageRouter.addRegistrator()      INFO:     Adding registrator: Configurator
2013-12-06 11:52:08  MessageRouter.addComponent()        INFO:     Adding component: Configurator
2013-12-06 11:52:08  ConfiguratorAbstract.componentAdded()  CONFIG:  component: basic-conf
2013-12-06 11:52:08  ConfiguratorAbstract.setup()        CONFIG:   Setting up component: basic-conf
2013-12-06 11:52:08  ConfiguratorAbstract.setup()        CONFIG:   Component basic-conf defaults: {component-id=basic-conf@user-pc.home, def-hostname=user-pc.home, admins=[Ljava.lang.String;@3ced0338, scripts-dir=scripts/admin, command/ALL=ADMIN, logging/.level=CONFIG, logging/handlers=java.util.logging.ConsoleHandlerjava.util.logging.FileHandler, logging/java.util.logging.ConsoleHandler.formatter=tigase.util.LogFormatter, logging/java.util.logging.ConsoleHandler.level=WARNING, logging/java.util.logging.FileHandler.append=true, logging/java.util.logging.FileHandler.count=5, logging/java.util.logging.FileHandler.formatter=tigase.util.LogFormatter, logging/java.util.logging.FileHandler.limit=10000000, logging/java.util.logging.FileHandler.pattern=logs/tigase.log, logging/tigase.useParentHandlers=true, logging/java.util.logging.FileHandler.level=ALL, logging/tigase.server.level=ALL, user-domain-repo-pool=tigase.db.UserRepositoryMDImpl, auth-domain-repo-pool=tigase.db.AuthRepositoryMDImpl, user-repo-pool-size=1, user-repo-class=derby, user-repo-url=jdbc:derby:c:\Tigase\tigasedb, auth-repo-class=tigase.db.jdbc.TigaseCustomAuth, auth-repo-url=jdbc:derby:c:\Tigase\tigasedb, ssl-container-class=tigase.io.SSLContextContainer, ssl-certs-location=certs/, ssl-def-cert-domain=default}
2013-12-06 11:52:08  ConfiguratorAbstract.setup()        CONFIG:   Component basic-conf configuration: {component-id=basic-conf@user-pc.home,def-hostname=user-pc.home,admins=[Ljava.lang.String;@3ced0338,scripts-dir=scripts/admin,command/ALL=ADMIN,logging/handlers=java.util.logging.ConsoleHandlerjava.util.logging.FileHandler,logging/java.util.logging.ConsoleHandler.formatter=tigase.util.LogFormatter,logging/java.util.logging.ConsoleHandler.level=WARNING,logging/java.util.logging.FileHandler.append=true,logging/java.util.logging.FileHandler.count=5,logging/java.util.logging.FileHandler.formatter=tigase.util.LogFormatter,logging/java.util.logging.FileHandler.limit=10000000,logging/java.util.logging.FileHandler.pattern=logs/tigase.log, logging/tigase.useParentHandlers=true, logging/java.util.logging.FileHandler.level=ALL, logging/tigase.server.level=ALL, user-domain-repo-pool=tigase.db.UserRepositoryMDImpl, auth-domain-repo-pool=tigase.db.AuthRepositoryMDImpl, user-repo-pool-size=1, user-repo-class=derby, user-repo-url=jdbc:derby:c:\Tigase\tigasedb, auth-repo-class=tigase.db.jdbc.TigaseCustomAuth, auth-repo-url=jdbc:derby:c:\Tigase\tigasedb, ssl-container-class=tigase.io.SSLContextContainer, ssl-certs-location=certs/, ssl-def-cert-domain=default}
Loading plugin: session-close=4 ...
Loading plugin: session-open=4 ...
Loading plugin: default-handler=4 ...
Loading plugin: jabber:iq:register=2 ...
Loading plugin: jabber:iq:auth=4 ...
Loading plugin: urn:ietf:params:xml:ns:xmpp-sasl=4 ...
Loading plugin: urn:ietf:params:xml:ns:xmpp-bind=2 ...
Loading plugin: urn:ietf:params:xml:ns:xmpp-session=2 ...
Loading plugin: jabber:iq:roster=8 ...
Loading plugin: jabber:iq:privacy=2 ...
Loading plugin: jabber:iq:version=2 ...
Loading plugin: http://jabber.org/protocol/stats=2 ...
Loading plugin: starttls=2 ...
Loading plugin: vcard-temp=2 ...
Loading plugin: http://jabber.org/protocol/commands=2 ...
Loading plugin: jabber:iq:private=2 ...
Loading plugin: urn:xmpp:ping=2 ...
Loading plugin: presence=8 ...
Loading plugin: disco=2 ...
Loading plugin: pep=2 ...
Loading plugin: amp=2 ...
2013-12-06 11:52:17  SocketThread.<clinit>()             WARNING:  17 socketReadThreads started.
2013-12-06 11:52:17  SocketThread.<clinit>()             WARNING:  17 socketWriteThreads started.
2013-12-06 11:52:17  SSLContextContainer.getSSLContext()  WARNING: Auto-generated certificate for domain: user-pc

Added by Wojciech Kapcia TigaseTeam about 5 years ago

  • mentioned auto-creation (i.e. ?autoCreateUser=true of users is only a connection parameter thus it should look like this in your case:
--user-db-uri=jdbc:derby:c://tigase//tigase-config-type?autoCreateUser=true
  • in-band registration (i.e. registration without admin intervention) is handle by jabber:iq:register plugin, which is loaded.

Could you provide excerpt from logs from the time you try to create account? Does it work in different IM clients (Psi IM for example)?

Added by Uma S about 5 years ago

Just an added information, I am trying to migrate from Openfire to Tigase.. And the client code works with Openfire.

When I use

--user-db-uri=jdbc:derby:c://tigase//tigase-config-type?autoCreateUser=true I get an IllegalArguementException : You have t provide a key with at least 'component_name/key_name':config-type?autoCreateUser.

Log file

2013-12-06 13:12:00 ConnectionManager$ConnectionListenerImpl.accept() FINEST: Accept called for service: null@null

2013-12-06 13:12:00 ConnectionManager.serviceStarted() FINER: c2s Connection started: null, type: accept, Socket: nullSocket[addr=/192.168.1.4,port=59129,localport=5222]

2013-12-06 13:12:00 SocketThread.() WARNING: 17 socketReadThreads started.

2013-12-06 13:12:00 SocketThread.() WARNING: 17 socketWriteThreads started.

2013-12-06 13:12:00 ClientConnectionManager.xmppStreamOpened() FINER: Stream opened: {xmlns:stream=http://etherx.jabber.org/streams, to=192.168.1.2, xmlns=jabber:client, version=1.0}

2013-12-06 13:12:00 ConnectionManager.serviceStopped() FINER: c2s Connection stopped: c2s@user-pc.home/192.168.1.2_5222_192.168.1.4_59129, type: accept, Socket: c2s@user-pc.home/192.168.1.2_5222_192.168.1.4_59129 Socket[unconnected]

2013-12-06 13:12:00 ClientConnectionManager.xmppStreamClosed() FINER: Stream closed: c2s@user-pc.home/192.168.1.2_5222_192.168.1.4_59129

Added by Wojciech Kapcia TigaseTeam about 5 years ago

Ok, you are using windows thus correct DB URI for Derby is:

--user-db-uri=jdbc:derby:c:\\tigase\\tigase-config-type

(as you are using only one db you do not need any parameters)

Please try to run server with following debug options:

--debug=db,server,xmpp.impl

end provide full logs.

Lastly - with the above setup, are there still any exceptions in the logs? Mostly related to DB initialization? Are you able to perform in-band registration using regular client (Psi?)

    (1-4/4)