Tigase Forums

API and development: RE: WebSocket component: to make it more complient with rfc6455

Tigase XMPP Server Board - Thu, 12/14/2017 - 11:17

Thank you very much for detailed information and the in-depth research on the problem. I have opened a bug report for this: #6481. Please "watch" the bug report to get automated updated on the resolution progress.

Categories: Tigase Forums

API and development: WebSocket component: to make it more complient with rfc6455

Tigase XMPP Server Board - Thu, 12/14/2017 - 03:57

Hi guys,

Recently I played with https://www.nativescript.org development.
I used https://github.com/NathanaelA/nativescript-websockets lib to connect to Tigase but unfortunately spent almost one day to figure out why it was not working (was not able to even open WS connection)

Then after some deep debugging I realized that this lib sends the Connection: upgrade header when handshake. But Tigase expects it as Connection: Upgrade here https://tigase.tech/projects/tigase-server/repository/revisions/master/entry/server/src/main/java/tigase/server/websocket/WebSocketXMPPIOService.java#L367

I tried to modify the nativescript-websockets lib but then realized it uses another lib inside to cope with WS - PocketSocket and it's actually it sets this header in lower case format: https://github.com/zwopple/PocketSocket/blob/master/PocketSocket/PSWebSocketDriver.m#L220

My first thought was that it's a bug with the PocketSocket lib.
But then I investigated the rfc6455 and found the following rule in 4.2.1 section:

4. A |Connection| header field that includes the token "Upgrade",
treated as an ASCII case-insensitive value.

https://tools.ietf.org/html/rfc6455#section-4.2.1

So it seems that clients can send this header in any format: Upgrade or upgrade.

Are you able to modify Tigase code a little bit and make it more complient with the spec?

Thank you

Categories: Tigase Forums

API and development: User's roster in tig_pairs are randomly deleted

Tigase XMPP Server Board - Fri, 12/08/2017 - 05:21

I noticed that some user's rosters are being deleted from the database. I looked at the log file, and I see this error:

2017-12-05 08:29:12.836 [pep Queue Worker 0] JabberIqPrivacy.allowed() WARNING: Database problem, please notify the admin. {0}
tigase.db.TigaseDBException: Error getting user data for: /privacy/default-list
at tigase.db.jdbc.JDBCRepository.getData(JDBCRepository.java:273)
at tigase.db.UserRepositoryMDImpl.getData(UserRepositoryMDImpl.java:103)
[...]

I made no changes to the server recently, and previously it was working without issue.

Tigase in itself doesn't remove automatically any data, especially UserData.

However in this case problem is different:
  • it's about user's Privacy List (not exactly related to the roster);
  • the exception points to the state of the ResultSet object and with
    that information comes some questions:
    • Which Tigase XMPP Server do you use?
    • Have you tried using official Microsoft driver instead of default Jtds?
    • Have you experienced some problem with the database access? (attached
      stacktrace would suggest it)
Categories: Tigase Forums

Installation and maintenance: Can't install own certificate for SSL communication. Server uses it...

Tigase XMPP Server Board - Fri, 12/08/2017 - 05:14

I run Tigase XMPP server at AWS EC2 (assume the domain name is ec2.us-west-2.compute.amazonaws.com).
I generate certificate using official documentation:
[...]
Then I put this new .pem file into server/certs directory.
The config.tdsl file is the following:
'cluster-mode' = 'false' 'config-type' = 'default' 'basic-conf' { 'virtual-hosts-cert-ec2.us-west-2.compute.amazonaws.com' = '/home/ubuntu/tigase-server/server/certs/ec2.us-west-2.compute.amazonaws.com.pem' } c2s (class: tigase.server.xmppclient.ClientConnectionManager) { seeOtherHost {} } 'certificate-container' (active = true) { ssl-certs-location='/home/ubuntu/tigase-server/server/certs/' ssl-container-class='tigase.io.SSLContextContainer' } rootSslContextContainer (class: tigase.io.SSLContextContainer, active = true) {} ...
When I connect to server using PSI, server suggests me the certificate that was generated by Tigase.
What should I fix to set up secured communication in Tigase?

Best initial step would be to analyse the logs. First thing that stands
out is that you have errors in your config, namely active = true is an
invalid declaration (should be active: true) which in itself can cause
problems.

As for the issue - you shouldn't have to explicitly configure the
certificate -- you only need to place it in a file which name matches
the VHost for which you generated it, i.e. in your case it would be
certs/ec2.us-west-2.compute.amazonaws.com.pem for
ec2.us-west-2.compute.amazonaws.com VHost.

I would also greatly simplify the configuration and avoid explicit
declaration of the class (unless really needed).

Categories: Tigase Forums

API and development: User's roster in tig_pairs are randomly deleted

Tigase XMPP Server Board - Tue, 12/05/2017 - 00:13

I noticed that some user's rosters are being deleted from the database. I looked at the log file, and I see this error:

2017-12-05 08:29:12.836 [pep Queue Worker 0] JabberIqPrivacy.allowed() WARNING: Database problem, please notify the admin. {0}
tigase.db.TigaseDBException: Error getting user data for: /privacy/default-list
at tigase.db.jdbc.JDBCRepository.getData(JDBCRepository.java:273)
at tigase.db.UserRepositoryMDImpl.getData(UserRepositoryMDImpl.java:103)
at tigase.xmpp.RepositoryAccess.getData(RepositoryAccess.java:767)
at tigase.xmpp.impl.Privacy.getDefaultListName(Privacy.java:241)
at tigase.xmpp.impl.Privacy.getDefaultList(Privacy.java:215)
at tigase.xmpp.impl.JabberIqPrivacy.allowed(JabberIqPrivacy.java:261)
at tigase.xmpp.impl.JabberIqPrivacy.filter(JabberIqPrivacy.java:139)
at tigase.server.xmppsession.SessionManager.addOutPackets(SessionManager.java:978)
at tigase.server.xmppsession.SessionManager$ProcessorWorkerThread.process(SessionManager.java:2439)
at tigase.util.WorkerThread.run(WorkerThread.java:128)
Caused by: java.sql.SQLException: Invalid state, the ResultSet object is closed.
at net.sourceforge.jtds.jdbc.JtdsResultSet.checkOpen(JtdsResultSet.java:287)
at net.sourceforge.jtds.jdbc.JtdsResultSet.next(JtdsResultSet.java:571)
at net.sourceforge.jtds.jdbc.JtdsResultSet.close(JtdsResultSet.java:488)
at net.sourceforge.jtds.jdbc.JtdsStatement.closeCurrentResultSet(JtdsStatement.java:320)
at net.sourceforge.jtds.jdbc.JtdsStatement.closeAllResultSets(JtdsStatement.java:342)
at net.sourceforge.jtds.jdbc.JtdsStatement.reset(JtdsStatement.java:729)
at net.sourceforge.jtds.jdbc.JtdsPreparedStatement.executeQuery(JtdsPreparedStatement.java:970)
at tigase.db.jdbc.JDBCRepository.getUserUID(JDBCRepository.java:466)
at tigase.db.jdbc.JDBCRepository.getUserUID(JDBCRepository.java:1178)
at tigase.db.jdbc.JDBCRepository.getNodeNID(JDBCRepository.java:1162)
at tigase.db.jdbc.JDBCRepository.getData(JDBCRepository.java:239)
at tigase.db.UserRepositoryMDImpl.getData(UserRepositoryMDImpl.java:103)
at tigase.xmpp.RepositoryAccess.getData(RepositoryAccess.java:767)
at tigase.xmpp.impl.Privacy.getDefaultListName(Privacy.java:241)
at tigase.xmpp.impl.Privacy.getDefaultList(Privacy.java:215)
at tigase.xmpp.impl.JabberIqPrivacy.allowed(JabberIqPrivacy.java:261)
at tigase.xmpp.impl.JabberIqPrivacy.filter(JabberIqPrivacy.java:139)
at tigase.server.xmppsession.SessionManager.addOutPackets(SessionManager.java:978)
at tigase.server.xmppsession.SessionManager$ProcessorWorkerThread.process(SessionManager.java:2439)
at tigase.util.WorkerThread.run(WorkerThread.java:128)

I made no changes to the server recently, and previously it was working without issue.

Categories: Tigase Forums

Installation and maintenance: Can't install own certificate for SSL communication. Server uses it...

Tigase XMPP Server Board - Mon, 12/04/2017 - 02:39

I run Tigase XMPP server at AWS EC2 (assume the domain name is ec2.us-west-2.compute.amazonaws.com).
I generate certificate using official documentation:
openssl genrsa -out private.key 4096 openssl req -new -key private.key -out ec2.us-west-2.compute.amazonaws.com.csr -sha256 openssl x509 -req -days 365 -in ec2.us-west-2.compute.amazonaws.com.csr -signkey private.key -out ec2.us-west-2.compute.amazonaws.com.crt cat ec2.us-west-2.compute.amazonaws.com.crt private.key > ec2.us-west-2.compute.amazonaws.com.pem
Then I put this new .pem file into server/certs directory.
The config.tdsl file is the following:
'cluster-mode' = 'false' 'config-type' = 'default' 'basic-conf' { 'virtual-hosts-cert-ec2.us-west-2.compute.amazonaws.com' = '/home/ubuntu/tigase-server/server/certs/ec2.us-west-2.compute.amazonaws.com.pem' } c2s (class: tigase.server.xmppclient.ClientConnectionManager) { seeOtherHost {} } 'certificate-container' (active = true) { ssl-certs-location='/home/ubuntu/tigase-server/server/certs/' ssl-container-class='tigase.io.SSLContextContainer' } rootSslContextContainer (class: tigase.io.SSLContextContainer, active = true) {} ...
When I connect to server using PSI, server suggests me the certificate that was generated by Tigase.
What should I fix to set up secured communication in Tigase?
Thanks!

Categories: Tigase Forums

API and development: RE: Stopping a component

Tigase XMPP Server Board - Thu, 11/30/2017 - 05:58

Thank you for reporting - there may be some issue with calling this method, I've created the task to resolve this: #6411 - please watch it to be notified upon resolution.

Categories: Tigase Forums

API and development: RE: Stopping a component

Tigase XMPP Server Board - Thu, 11/23/2017 - 03:42

when I override method stop() I expect this method to be called when the component is stopping (to store data in database), but it is not called

Categories: Tigase Forums

API and development: RE: tigase v 7.1.1 ,in Cluster ,presencesubscription will not work correctly?

Tigase XMPP Server Board - Wed, 11/22/2017 - 10:51

Hi,

There can be many reasons for this, from the server misconfiguration in cluster mode or network level misconfiguration between cluster nodes (incorrect hostnames for example), to incomplete presence subscription data flow. Make sure both users have generated subscription requests and both users accepted subscription requests.

Categories: Tigase Forums

API and development: tigase v 7.1.1 ,in Cluster ,presencesubscription will not work correctly?

Tigase XMPP Server Board - Tue, 11/21/2017 - 19:13

hello!
I hava a question about presencesubscription in cluster.
tigase version is 7.1.1 ,with default strategy.
UserA connect to the cluster node 01 and UserB connect to the other cluster node 02,
they start to make subscription to each other.
It occurs that their subscriptions is inconsistent, such as roset iqs:

UserA :
<iq type="result" id="aaf9a" to="UserA">
<query xmlns="jabber:iq:roster">
<item subscription="both" jid="UserB"/>
</query>
<iq>

UserB:

<iq type="result" id="aaf9b" to="UserB">
<query xmlns="jabber:iq:roster">
<item subscription="from" jid="UserA"/>
</query>
<iq>

thank for your reply!

Categories: Tigase Forums

API and development: RE: Stopping a component

Tigase XMPP Server Board - Fri, 11/17/2017 - 09:33

It's described in the documentation http://docs.tigase.org/tigase-server/snapshot/Development_Guide/html_chunk/cil8.html:

Stopping a component
Component instance may be stopped at any point of Tigase XMPP Server runtime, ie. due to reconfiguration, or due to server graceful shutdown.

In both cases following methods of a component will be called:

void stop() - first method stops component internal processing queues.
void beforeUnregister() (optional) - if component implements UnregisterAware interface this method is called to notify instance of a component that it is being unloaded.
void unregister(Kernel kernel) (optional) - if component implements RegistrarBean called to give component a way to unregister beans (if needed).

So to answer your question - the method will be called before stopping the component instance but not necessarily server.

You can use method tigase.sys.TigaseRuntime#addShutdownHook() to add your custom hook, which will be executed during server shutdown.

Categories: Tigase Forums

API and development: RE: Stopping a component

Tigase XMPP Server Board - Wed, 11/15/2017 - 01:08

how can I call my method before shutting down the server?

Categories: Tigase Forums

API and development: Stopping a component

Tigase XMPP Server Board - Tue, 11/14/2017 - 01:13

Does the method stop() work before shutting down the server (tigase-server-8.0.0-SNAPSHOT-b5058)?

Categories: Tigase Forums

API and development: RE: Packet.getStanzaFrom() NoSuchMethodError

Tigase XMPP Server Board - Tue, 11/07/2017 - 17:38

Yes, it was a version mismatch. Fixed it. Thank you.

Categories: Tigase Forums

API and development: RE: Packet.getStanzaFrom() NoSuchMethodError

Tigase XMPP Server Board - Sat, 11/04/2017 - 01:53

Recently we moved classes JID and BareJID from package tigase.xmpp to package tigase.xmpp.jid. Looking at your error it looks like you are developing your component using newest snapshot build of Tigase XMPP Server, which has JID and BareJID already moved but you are starting component on the server where an older version of Tigase XMPP Server is deployed (build from before the move).

Please try to upgrade your installation to newest snapshot build of Tigase XMPP Server and this should solve this error.

Categories: Tigase Forums

API and development: Packet.getStanzaFrom() NoSuchMethodError

Tigase XMPP Server Board - Fri, 11/03/2017 - 20:40

I'm writing a Component, and have been getting errors with JIDs. Here I'm trying to find out who a packet is from, so I can do a thing.

@Override
public void processPacket(Packet packet) {
if(packet.getStanzaFrom().toString().equals(myUsername)){
// Do my thing.
}
}

When I run this Component, and send it a packet, I get the following error:

2017-11-03 22:52:16.315 [in_0-tigase-remote-component] ThreadExceptionHandler.uncaughtException() SEVERE: Uncaught thread: "in_0-tigase-remote-component" exception
java.lang.NoSuchMethodError: tigase.server.Packet.getStanzaFrom()Ltigase/xmpp/jid/JID;
at TigaseRemoteComponent.processPacket(TigaseRemoteComponent.java:18)
at tigase.server.AbstractMessageReceiver$QueueListener.run(AbstractMessageReceiver.java:1570)

Why can't it find the Packet.getStanzaFrom() method?

Categories: Tigase Forums

API and development: RE: Developing with IntelliJ?

Tigase XMPP Server Board - Sun, 10/29/2017 - 14:01

This is what I added to the POM file to get it working:

<dependencies><dependency>
<groupId>tigase</groupId>
<artifactId>tigase-server</artifactId>
<version>8.0.0-SNAPSHOT</version>
</dependency></dependencies>
<repositories>
<repository>
<id>tigase</id>
<name>Tigase repository</name>
<url>http://maven-repo.tigase.org/repository/release&lt;/url>
</repository>
<repository>
<id>tigase-snapshot</id>
<name>Tigase repository</name>
<url>http://maven-repo.tigase.org/repository/snapshot&lt;/url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>

Categories: Tigase Forums

API and development: RE: Developing with IntelliJ?

Tigase XMPP Server Board - Tue, 10/24/2017 - 10:45

Thanks. I'll read the Maven guide and ignore those IDEA errors.

Categories: Tigase Forums

API and development: RE: Developing with IntelliJ?

Tigase XMPP Server Board - Tue, 10/24/2017 - 07:45

Thanks. I'll read the Maven guide and ignore those IDEA errors.

Categories: Tigase Forums

API and development: RE: Developing with IntelliJ?

Tigase XMPP Server Board - Tue, 10/24/2017 - 02:22

Wojciech already told you that you need to create your own Maven project and which lines you need to add as a dependency. However, you need to add them in the correct place within XML structure. For that, I would recommend consulting with Maven documentation, see guides and documentation at http://maven.apache.org/guides/

As for our project XML, lines marked as containing errors within IDEA are correct, but IDEA is not aware of additional variables which we defined within maven project and due to that it reports errors.

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

Back to Top