Tigase XMPP Server Board

Installation and maintenance: RE: How to make emojis saved to archived tables in tigase 7.0.2, My...

Wed, 04/05/2017 - 10:48

This is a duplicate topic of https://projects.tigase.org/boards/15/topics/7191?r=7197 - please refrain yourself from creating multiple threads for the same problem.

Categories: Tigase Forums

Installation and maintenance: RE: Would tigase 7.1.0 support emojies storage in archived tables?

Wed, 04/05/2017 - 10:47

The problem with lack of emoji support is only applicable to MySQL database - other supported databases store emoji without problem.
We have just implemented support for emoji for MySQL (vide #5033) and it will be included in 7.2.0 release (it's part of current nightly releases)

Categories: Tigase Forums

API and development: RE: Confusing problem debugging server in Eclipse

Wed, 04/05/2017 - 10:44

Jay Cothran wrote:

I have all the jars in the classpath and on the Java Build Path. What else do I need to do?

What jars? Have you included Derby driver in your class-path? Following line:
Caused by: tigase.db.DBInitException: Not found class supporting uri

suggests that it's missing.

Categories: Tigase Forums

Installation and maintenance: RE: Offline User storage

Tue, 04/04/2017 - 17:40

Alex Kobzar wrote:

Thanks. But this documentation is very simple for me.

What is exactly unclear? It's only the First topic. On the remaining pages there are more details.
Maybe this will be more clear: 3. HTTP File Upload component

Where i need insert setting? I think not in the init.properties?

Yes, in init properties, but it's in new DSL file format

And what about other side? What it must be? WebDAv? Apache? or something else?
i can't found any info about it. %(

What "other side"? Storage? It's covered in HTTP File Upload - Storage

Categories: Tigase Forums

Installation and maintenance: RE: Upgrade to tigase 7.1.0 from 7.0.2 without upgrading database (...

Tue, 04/04/2017 - 14:54

If you are concerned about database version then yes - you can stick with MySQL 5.5.x version -- again, DB requirements are covered in Recommended database versions and MySQL 5.5 is minimal required version.

Categories: Tigase Forums

Installation and maintenance: RE: Upgrade to tigase 7.1.0 from 7.0.2 without upgrading database (...

Tue, 04/04/2017 - 14:03

Unfortunately migrating database is required while upgrading from 7.0.x version to 7.1.x version - for the details please check the documentation which covers the details: http://docs.tigase.org/tigase-server/7.1.0/Administration_Guide/html_chunk/tigase710.html#_changes_to_database_schemas

Categories: Tigase Forums

Installation and maintenance: How to make emojis saved to archived tables in tigase 7.0.2, MySQL ...

Tue, 04/04/2017 - 09:02

Hello there!

I currently have a problem with tigase 7.0.2 (running on MySQL 5.5.x) in which the emojis or messages which contain emojis are not stored in archived tables (e.g. muc_history and tig_ma_msgs) even I have enabled UFT8mb4 for those tables. There're many articles created out there but I've not been able to apply any of them successfully yet.

Would someone please advise if there's good topic about this which I can refer, or please advise me steps I could do to make messages which contain emojis stored in archived tables (muc_history and tig_ma_msgs) by tigase?

Thanks,
Trung

Categories: Tigase Forums

Installation and maintenance: Would tigase 7.1.0 support emojies storage in archived tables?

Tue, 04/04/2017 - 08:58

Hello there!

I currently have a problem with tigase 7.0.2 (running on MySQL 5.5.x) in which the emojis or messages which contain emojis are not stored in archived tables (e.g. muc_history and tig_ma_msgs) even I have enabled UFT8mb4 for those tables. I've searched and tried many suggestions from other forum topics and have not been able to have emojis saved to those archived tables yet. I'm wondering if tigase 7.1.0 support emojis by default for archived tables (muc_history and tig_ma_msgs). I would be appreciated if someone please advise this, please? Thank a lot in advance!

Trung

Categories: Tigase Forums

Installation and maintenance: Upgrade to tigase 7.1.0 from 7.0.2 without upgrading database (runn...

Tue, 04/04/2017 - 08:52

Hello,

Would someone please advise if I could upgrade from tigase 7.0.2 to tigase 7.1.0 without having to migrate database which is running on MySQL 5.5.x?

Thanks,
Trung

Categories: Tigase Forums

Installation and maintenance: RE: Offline User storage

Mon, 04/03/2017 - 02:19

Thanks. But this documentation is very simple for me.
Where i need insert setting? I think not in the init.properties?
And what about other side? What it must be? WebDAv? Apache? or something else?
i can't found any info about it. %(

Categories: Tigase Forums

API and development: RE: Receiving off line messages when going back online.

Mon, 04/03/2017 - 00:21

hi,thanks for the comments. Unfortunatley I have no control over the server side.

Categories: Tigase Forums

API and development: RE: Confusing problem debugging server in Eclipse

Sat, 04/01/2017 - 03:20

Thanks for your reply. I am using the Derby DB. I have all the jars in the classpath and on the Java Build Path. What else do I need to do?

Categories: Tigase Forums

API and development: RE: Confusing problem debugging server in Eclipse

Fri, 03/31/2017 - 14:21

Do you have all dependencies (including jdbc drivers) as your dependencies?

Categories: Tigase Forums

API and development: RE: Send push notification with every message

Fri, 03/31/2017 - 14:12

Staton Eichman wrote:

Just to confirm, does the server need to be reset after adding the plugin?

Yes, each time you change binary or configuration file you have to restart the server to apply the changes.

Staton Eichman wrote:

I overwrote a .jar file on the server, restarted the server, and then the server would not start. So I reverted back to the original jar file, restarted the server again, and now the server works fine. But everytime I send a message, I get this error (it is supposed to send a push notification):

[...]

But its the exact same jar file as before, so why am I getting this warning now? Previously, it was working fine.

Staton Eichman wrote:

Here is the packet that is in question. It is using modified code from Kontalk's Push notifications, to work with APNS instead of GCM.

[...]
<error code="501" type="cancel"> <feature-not-implemented xmlns="urn:ietf:params:xml:ns:xmpp-stanzas"/> <text xml:lang="en" xmlns="urn:ietf:params:xml:ns:xmpp-stanzas">Feature not supported yet.</text> </error>

This is an error packet from push component indicating that there is a problem with it (i.e. this is a response)

Again, it was working fine before I restarted the server. Do I need to restart it in a certain way? (Using Windows Server). I tried starting it from the Services manager, tried starting it by double clicking Run.bat, but still no success.

It's really difficult to troubleshoot it with so little information. Is your component deployed locally (i.e. within same server instance)? or is it external component? It looks it's internal (judging from the logs) but it's malfunctioning for some reason.

The plugin/component should be loaded, as I see this entry in the log file before the above entry:

[...]

Running Tigase-7.0.1-b3809

Edit: although the log file says the plugin loaded, using PSI's service discovery and logged in as admin, I do not see my component listed

You won't see pluing in service discovery. You will only see component if you are logged as an admin user.

Staton Eichman wrote:

After doing a bit more work and research, I still can't solve this issue. Here is the code that creates the "push" packet, that is to be processed by the push component:

[...]

From the log file:
[...]

Here is the function where the "Error packet to the SM's own session" is coming from: https://projects.tigase.org/projects/tigase-server/repository/revisions/master/entry/server/src/main/java/tigase/server/xmppsession/SessionManager.java#L1604

Any help would be greatly appreciated.

Check how does the generated packet looks like and if it's correctly addressed.

Categories: Tigase Forums

API and development: RE: Receiving off line messages when going back online.

Fri, 03/31/2017 - 08:23
I think that you are experiencing an issue with delayed delivery of messages which failed to be delivered to previous connection as previous stream is still available for resumption. I think that you can do one of two things:
  • force your client to always use the same resource name:
    jaxmpp1.getConnectionConfiguration().setResource(resource);
  • try to change stream resumption timeout to lower value on server side (ie. to 0)
    c2s/urn\:xmpp\:sm\:3/max-resumption-timeout[I]=0 c2s/urn\:xmpp\:sm\:3/resumption-timeout[I]=0
Categories: Tigase Forums

API and development: Confusing problem debugging server in Eclipse

Fri, 03/31/2017 - 07:53

I am building the stable branch (7.1.1-SNAPSHOT) of the server with Eclipse neon.3. The build goes fine except for 2 (apparently bogus) java problems in ConnectionManagerTest. I notice however that the JDBCRepositoryTest is skipped. All other jars except the server are from the tigase-server-7.1.0-b4379-dist-max.zip distribution. JDK is jdk1.8.0_121.

I can run the resulting jar from the command line with no problems. I can create new accounts, login and chat. When I attempt to start the server in the debugger, it is unable to find the (any) repository. ModulesManagerImpl.getInstance().getImplementations(cls) in DataRepository.getRepoClass(...) returns an empty set. It appears that RepositoryFactory.initialize(...) is not being called.

In the Debug Configuration...
Program arguments:
--property-file etc/init.properties

VM arguments:
-Djdbc.drivers=com.mysql.jdbc.Driver

init.properties:
--comp-class-1 = tigase.muc.MUCComponent
--virt-hosts = localhost,192.168.0.114
--user-db-uri = jdbc:derby:D:\\Tigase\\tigasedb
--user-db = derby
--admins = admin@localhost
--comp-name-4 = message-archive
--comp-name-3 = proxy
config-type = --gen-config-def
--comp-name-2 = pubsub
--comp-name-1 = muc
--cluster-mode = true
--sm-plugins = +message-archive-xep-0136
--debug = server
--comp-class-4 = tigase.archive.MessageArchiveComponent
--comp-class-3 = tigase.socks5.Socks5ProxyComponent
--comp-class-2 = tigase.pubsub.PubSubComponent

Console output:
componentInfo{Title=Tigase XML Tools, Version=3.5.0-b252/d7b28574, Class=tigase.xml.XMLUtils}
componentInfo{Title=Tigase Utils, Version=3.5.0-b326/97aff18b, Class=tigase.util.ClassUtil}
componentInfo{Class=tigase.server.XMPPServer}
2017-03-31 10:24:29.610 [main] ConfiguratorAbstract.parseArgs() CONFIG: Setting defaults: --property-file = etc/init.properties
2017-03-31 10:24:29.632 [main] ConfiguratorAbstract.parseArgs() CONFIG: Loading initial properties from property file: etc/init.properties
2017-03-31 10:24:29.632 [main] ConfiguratorAbstract.parseArgs() CONFIG: Added default config parameter: (--cluster-mode=true)
2017-03-31 10:24:29.633 [main] ConfiguratorAbstract.parseArgs() CONFIG: Added default config parameter: (config-type=--gen-config-def)
2017-03-31 10:24:29.633 [main] ConfiguratorAbstract.parseArgs() CONFIG: Added default config parameter: (--debug=server)
2017-03-31 10:24:29.633 [main] ConfiguratorAbstract.parseArgs() CONFIG: Added default config parameter: (--user-db=derby)
2017-03-31 10:24:29.633 [main] ConfiguratorAbstract.parseArgs() CONFIG: Added default config parameter: (--admins=admin@localhost)
2017-03-31 10:24:29.633 [main] ConfiguratorAbstract.parseArgs() CONFIG: Added default config parameter: (--user-db-uri=jdbc:derby:D:\Tigase\tigasedb)
2017-03-31 10:24:29.634 [main] ConfiguratorAbstract.parseArgs() CONFIG: Added default config parameter: (--virt-hosts=localhost,192.168.0.114)
2017-03-31 10:24:29.634 [main] ConfiguratorAbstract.parseArgs() CONFIG: Added default config parameter: (--comp-name-4=message-archive)
2017-03-31 10:24:29.634 [main] ConfiguratorAbstract.parseArgs() CONFIG: Added default config parameter: (--comp-class-4=tigase.archive.MessageArchiveComponent)
2017-03-31 10:24:29.634 [main] ConfiguratorAbstract.parseArgs() CONFIG: Added default config parameter: (--comp-name-3=proxy)
2017-03-31 10:24:29.634 [main] ConfiguratorAbstract.parseArgs() CONFIG: Added default config parameter: (--comp-class-3=tigase.socks5.Socks5ProxyComponent)
2017-03-31 10:24:29.635 [main] ConfiguratorAbstract.parseArgs() CONFIG: Added default config parameter: (--comp-name-2=pubsub)
2017-03-31 10:24:29.635 [main] ConfiguratorAbstract.parseArgs() CONFIG: Added default config parameter: (--comp-class-2=tigase.pubsub.PubSubComponent)
2017-03-31 10:24:29.635 [main] ConfiguratorAbstract.parseArgs() CONFIG: Added default config parameter: (--comp-class-1=tigase.muc.MUCComponent)
2017-03-31 10:24:29.635 [main] ConfiguratorAbstract.parseArgs() CONFIG: Added default config parameter: (--comp-name-1=muc)
2017-03-31 10:24:29.635 [main] ConfiguratorAbstract.parseArgs() CONFIG: Added default config parameter: (--sm-plugins=+message-archive-xep-0136)
2017-03-31 10:24:29.639 [main] SimpleCache.<init>() WARNING: Tigase cache turned off.
2017-03-31 10:24:29.640 [main] SimpleCache.<init>() WARNING: Tigase cache turned off.
2017-03-31 10:24:30.635 [main] DNSResolverDefault.<init>() WARNING: Resolving default host name: xps8500 took: 995
2017-03-31 10:24:30.650 [main] AbstractMessageReceiver.setMaxQueueSize() FINEST: message-router maxQueueSize: 9,526, maxInQueueSize: 594, maxOutQueueSize: 19,052
2017-03-31 10:24:30.653 [main] MessageRouter.addRegistrator() INFO: Adding registrator: Configurator
2017-03-31 10:24:30.653 [main] MessageRouter.addComponent() INFO: Adding component:
2017-03-31 10:24:30.654 [main] ConfiguratorAbstract.componentAdded() CONFIG: component: basic-conf
2017-03-31 10:24:30.654 [main] ConfiguratorAbstract.setup() CONFIG: Setting up component: basic-conf
2017-03-31 10:24:31.392 [main] ConfiguratorAbstract.setup() CONFIG: Component basic-conf defaults: {component-id=basic-conf@xps8500, def-hostname=xps8500, admins=[Ljava.lang.String;@206a70ef, scripts-dir=scripts/admin, command/ALL=ADMIN, logging/.level=CONFIG, logging/handlers=java.util.logging.ConsoleHandler java.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=32, data-repo-pool-size=32, user-repo-class=derby, user-repo-url=jdbc:derby:D:\Tigase\tigasedb, auth-repo-class=tigase.db.jdbc.TigaseCustomAuth, auth-repo-url=jdbc:derby:D:\Tigase\tigasedb, ssl-container-class=tigase.io.jdk18.SNISSLContextContainer, ssl-certs-location=certs/, ssl-def-cert-domain=default, config-dump-file=etc/config-dump.properties}
2017-03-31 10:24:31.392 [main] ConfiguratorAbstract.setup() CONFIG: Component basic-conf configuration: {component-id=basic-conf@xps8500, def-hostname=xps8500, admins=[Ljava.lang.String;@206a70ef, scripts-dir=scripts/admin, command/ALL=ADMIN, logging/.level=CONFIG, logging/handlers=java.util.logging.ConsoleHandler java.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=32, data-repo-pool-size=32, user-repo-class=derby, user-repo-url=jdbc:derby:D:\Tigase\tigasedb, auth-repo-class=tigase.db.jdbc.TigaseCustomAuth, auth-repo-url=jdbc:derby:D:\Tigase\tigasedb, ssl-container-class=tigase.io.jdk18.SNISSLContextContainer, ssl-certs-location=certs/, ssl-def-cert-domain=default, config-dump-file=etc/config-dump.properties}
2017-03-31 10:24:31.393 [main] ConfiguratorAbstract.setProperties() INFO: Propeties size is 33, and here are all propeties: {component-id=basic-conf@xps8500, def-hostname=xps8500, admins=[Ljava.lang.String;@206a70ef, scripts-dir=scripts/admin, command/ALL=ADMIN, logging/.level=CONFIG, logging/handlers=java.util.logging.ConsoleHandler java.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=32, data-repo-pool-size=32, user-repo-class=derby, user-repo-url=jdbc:derby:D:\Tigase\tigasedb, auth-repo-class=tigase.db.jdbc.TigaseCustomAuth, auth-repo-url=jdbc:derby:D:\Tigase\tigasedb, ssl-container-class=tigase.io.jdk18.SNISSLContextContainer, ssl-certs-location=certs/, ssl-def-cert-domain=default, config-dump-file=etc/config-dump.properties, shared-user-repo=null, shared-user-repo-params=null, shared-auth-repo=null, shared-auth-repo-params=null}
2017-03-31 10:24:41.381 [main] ConfiguratorAbstract.setProperties() SEVERE: Can't initialize user default repository:
tigase.db.DBInitException: Problem initializing jdbc connection: jdbc:derby:D:\Tigase\tigasedb
at tigase.db.jdbc.JDBCRepository.initRepository(JDBCRepository.java:627)
at tigase.db.RepositoryFactory.getUserRepository(RepositoryFactory.java:672)
at tigase.conf.ConfiguratorAbstract.addUserRepo(ConfiguratorAbstract.java:888)
at tigase.conf.ConfiguratorAbstract.setProperties(ConfiguratorAbstract.java:817)
at tigase.conf.ConfiguratorAbstract.setup(ConfiguratorAbstract.java:519)
at tigase.conf.ConfiguratorAbstract.componentAdded(ConfiguratorAbstract.java:152)
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:138)
at tigase.server.MessageRouter.setConfig(MessageRouter.java:644)
at tigase.server.XMPPServer.start(XMPPServer.java:142)
at tigase.server.XMPPServer.main(XMPPServer.java:112)
Caused by: tigase.db.DBInitException: Not found class supporting uri = jdbc:derby:D:\Tigase\tigasedb
at tigase.db.RepositoryFactory.getRepoClass(RepositoryFactory.java:508)
at tigase.db.RepositoryFactory.getRepoClassName(RepositoryFactory.java:535)
at tigase.db.RepositoryFactory.getDataRepository(RepositoryFactory.java:420)
at tigase.db.jdbc.JDBCRepository.initRepository(JDBCRepository.java:590)
at tigase.db.RepositoryFactory.getUserRepository(RepositoryFactory.java:672)
at tigase.conf.ConfiguratorAbstract.addUserRepo(ConfiguratorAbstract.java:888)
at tigase.conf.ConfiguratorAbstract.setProperties(ConfiguratorAbstract.java:817)
at tigase.conf.ConfiguratorAbstract.setup(ConfiguratorAbstract.java:519)
at tigase.conf.ConfiguratorAbstract.componentAdded(ConfiguratorAbstract.java:152)
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:138)
at tigase.server.MessageRouter.setConfig(MessageRouter.java:644)
at tigase.server.XMPPServer.start(XMPPServer.java:142)
at tigase.server.XMPPServer.main(XMPPServer.java:112)

Since there is no repository nothing works after this and the server shutsdown. Any suggestions would be greatly appreciated.

Categories: Tigase Forums

API and development: RE: Receiving off line messages when going back online.

Fri, 03/31/2017 - 05:46

it certainly seems to be something to do with time after if I wait a period of time before then going back online then I do receive the missed messaged.
Is there an heartbeat tick which I can change?

Categories: Tigase Forums

API and development: Receiving off line messages when going back online.

Fri, 03/31/2017 - 02:02

Hello,
I'm new to the Tigase API and not familiar with it.
I have created a java program which receives message perfectly fine when its up and running. The thing is it may well crash of be stopped for some reason. If that is the case its important that it receives any missed messages while being offline as soon as it goes back online.

Anyway that the way I thought that it should work and I have tried experiments with other chat application and I see this does happen with them. But when I try the same experiments with my code I do not see any of the missed messages.
the logon code is below:

jaxmpp1.getModulesManager().register(new InBandRegistrationModule());
jaxmpp1.getModulesManager().register(new MessageModule());
try {
jaxmpp1.getModulesManager().register(new MessageCarbonsModule());
} catch (JaxmppException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
jaxmpp1.getEventBus().addHandler(MessageModule.MessageReceivedHandler.MessageReceivedEvent.class, messageHandler);
jaxmpp1.getModulesManager().register(new MucModule());
jaxmpp1.getModulesManager().register(new AdHocCommansModule());
jaxmpp1.getModulesManager().register(new RosterModule());
jaxmpp1.getModulesManager().register(new MessageArchivingModule());
jaxmpp1.getModulesManager().register(new PubSubModule());
try {
Thread.sleep(1000);
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}

try {
tigase.jaxmpp.j2se.Roster.initialize(jaxmpp1);
tigase.jaxmpp.j2se.Presence.initialize(jaxmpp1);
}
catch (JaxmppException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
} jaxmpp1.getProperties().setUserProperty( SessionObject.USER_BARE_JID, BareJID.bareJIDInstance( UserName ) );
jaxmpp1.getProperties().setUserProperty( SessionObject.PASSWORD, PassWord ); jaxmpp1.getEventBus().addHandler(PresenceModule.ContactChangedPresenceHandler.ContactChangedPresenceEvent.class, presence);

PresenceModule presenceModule = jaxmpp1.getModulesManager().getModule(PresenceModule.class);

jaxmpp1.login(true);
presenceModule.subscribe(JID.jidInstance(subscribeTo));

MessageHandler

MessageModule.MessageReceivedHandler messageHandler = new MessageModule.MessageReceivedHandler() {

public void onMessageReceived(SessionObject sessionObject,
Chat chat, Message stanza) {
//some code I can t show you
//I'm expecting everything offline to be sent here once going back online
}
}

It could be that I am just missing that messages after first loggin on?

Anyone have a clue about what I'm doing wrong?

Thanks.
Dan.

Categories: Tigase Forums

API and development: RE: Send push notification with every message

Wed, 03/29/2017 - 01:42

After doing a bit more work and research, I still can't solve this issue. Here is the code that creates the "push" packet, that is to be processed by the push component:

public void postProcess(Packet packet, XMPPResourceConnection session, NonAuthUserRepository repo, Queue<Packet> results, Map<String, Object> settings) { if (session == null && packet.getElemName().equals(Message.ELEM_NAME) && packet.getType() == StanzaType.chat && (packet.getElement().getChild("body") != null || packet.getElement().getChild("request", "urn:xmpp:receipts") != null)) { if (log.isLoggable(Level.FINEST)) { log.finest("Processing packet: " + packet.toString()); } Element request = new Element("message"); request.setAttribute("type", "push"); request.addChild(new Element("push", new String[]{"xmlns", "jid"}, new String[]{XMLNS, packet.getStanzaTo().getBareJID().toString()})); // send request to push component JID compJid = JID.jidInstanceNS(componentName, packet.getStanzaTo().getDomain(), null); JID fromJid = JID.jidInstanceNS(packet.getStanzaTo().getDomain()); Packet p = Packet.packetInstance(request, fromJid, compJid); results.offer(p); packet.processedBy(ID); } }

From the log file:
2017-03-29 16:27:34.496 [in_1-sess-man] SessionManager.processPacket() WARNING: Error packet to the SM's own session: from=sess-man@db3, to=sess-man@db3, DATA= <message to="mydomain.net" type="error" from="push@mydomain.net"> <push jid="aaaaaaaa@mydomain.net" xmlns="http://mydomain.net/extensions/push"/> <error code="503" type="cancel"> <service-unavailable xmlns="urn:ietf:params:xml:ns:xmpp-stanzas"/> <text xml:lang="en" xmlns="urn:ietf:params:xml:ns:xmpp-stanzas">Service not available.</text> </error> </message> , SIZE=360, XMLNS=null, PRIORITY=NORMAL, PERMISSION=NONE, TYPE=error

Here is the function where the "Error packet to the SM's own session" is coming from: https://projects.tigase.org/projects/tigase-server/repository/revisions/master/entry/server/src/main/java/tigase/server/xmppsession/SessionManager.java#L1604

Any help would be greatly appreciated.

Categories: Tigase Forums

API and development: RE: Send push notification with every message

Mon, 03/27/2017 - 21:18

Here is the packet that is in question. It is using modified code from Kontalk's Push notifications, to work with APNS instead of GCM.

<pushmessage from="push@mydomain.net" type="error" to="mydomain.net"> <message from="aaaaaa@mydomain.net/MatriX-for-Android" type="chat" xmlns="jabber:client" id="1490669155576" to="zzzzzz@mydomain.net"> <body>d</body> <subject>chat</subject> <time>1490669155576</time> <request xmlns="urn:xmpp:receipts"/> </message> <error code="501" type="cancel"> <feature-not-implemented xmlns="urn:ietf:params:xml:ns:xmpp-stanzas"/> <text xml:lang="en" xmlns="urn:ietf:params:xml:ns:xmpp-stanzas">Feature not supported yet.</text> </error> </pushmessage>, SIZE=548, XMLNS=null, PRIORITY=NORMAL, PERMISSION=NONE, TYPE=error

Again, it was working fine before I restarted the server. Do I need to restart it in a certain way? (Using Windows Server). I tried starting it from the Services manager, tried starting it by double clicking Run.bat, but still no success.

The plugin/component should be loaded, as I see this entry in the log file before the above entry:

MyAppPushNotification.postProcess() FINEST: Processing packet: from=sess-man@db3, to=sess-man@db3, DATA=<pushmessage ...

Running Tigase-7.0.1-b3809

Categories: Tigase Forums

Pages

Get in touch

We provide software products, consulting and custom development services

Tigase, Inc.
100 Pine Street, Suite 1250
San Francisco, CA 94111, USA
Phone: (415) 315 9771

Follow us on:

Twitter

  • New Blog post: experiences with Tigase Messenger for iOS: https://t.co/0iP7bTfjCX 3 days 21 hours ago
  • Trying out our new iOS application and have questions? Check out documentation if you need help. https://t.co/omsDijTW1k 6 days 5 hours ago
Back to Top