Project

General

Profile

What is the build result of tigase plugins and how to add it into my deployed tigase server?

Alina Sun
Added over 3 years ago

Hello,

I create a tigase plugin and build it successfully. I can see that the plugin is loaded when I run tigase server after I config it init.properties. But I cannot find a .jar file for my plugin. I can find a .class file in the target folder.

Then how could I add my plugin into my deployed tigase server? Copy the .class file and configure it in init.properties? Which directory should I put the .class file?


Replies (6)

Added by Wojciech Kapcia TigaseTeam over 3 years ago

How do you create the plugin exactly?

The easiest solution would be to create simple maven project, include your plugin code in the project and then run build on in - it will result in jar binary.

Alternatively you could use jar commandline utility, but I would say it's more cumbersome.

Added by Alina Sun over 3 years ago

I create the plugin in maven project and then copy the generated .jar file into tigase/jars. And then I add my plugin into init.properties like this:

--sm-plugins = +Alina-GetProducts

But the plugin is not loaded when I run tigase.

If I build my plugin with tigase source code I can get my plugin loaded. But I don't find a .jar file generated for my plugin, I only find a .class file.

Added by Wojciech Kapcia TigaseTeam over 3 years ago

If you include your plugin in tigase-server package it will be included in the tigase-server.jar@. How do you start Tigase? Is your binary included in the CLASSPATH? If you run Tigase using our scripts those take care of building CLASSPATH from all binaries in @jars/ directory, but if you are running Tigase from IDE or using different method then you have to include your newly created jar file as dependency/library.

Added by Alina Sun over 3 years ago

I have added my binary to CLASSPATH and I start tigase both from Eclipse and by "scripts/tigase.sh start etc/tigase.conf". Neither works.

I can see see following log in logs/tigase-console.log. But I cannot find the log which loads my plugin.

2015-10-02 15:28:59.870 [main] ConfiguratorAbstract.parseArgs() CONFIG: Added default config parameter: (--sm-plugins=Alina-GetProducts)

....

Loading plugin: session-close=4:1165 ... , version: 7.0.2-b3821/563fcf81 (2015-05-15/00:41:16)

Loading plugin: session-open=4:1165 ... , version: 7.0.2-b3821/563fcf81 (2015-05-15/00:41:16)

Loading plugin: default-handler=4:1165 ... , version: 7.0.2-b3821/563fcf81 (2015-05-15/00:41:16)

Loading plugin: jabber:iq:auth=8:582 ... , version: 7.0.2-b3821/563fcf81 (2015-05-15/00:41:16)

Loading plugin: urn:ietf:params:xml:ns:xmpp-sasl=8:582 ... , version: 7.0.2-b3821/563fcf81 (2015-05-15/00:41:16)

Loading plugin: urn:ietf:params:xml:ns:xmpp-bind=8:582 ... , version: 7.0.2-b3821/563fcf81 (2015-05-15/00:41:16)

Loading plugin: urn:ietf:params:xml:ns:xmpp-session=8:582 ... , version: 7.0.2-b3821/563fcf81 (2015-05-15/00:41:16)

Loading plugin: jabber:iq:roster=16:291 ... , version: 7.0.2-b3821/563fcf81 (2015-05-15/00:41:16)

Loading plugin: jabber:iq:privacy=8:582 ... , version: 7.0.2-b3821/563fcf81 (2015-05-15/00:41:16)

Loading plugin: jabber:iq:version=8:582 ... , version: 7.0.2-b3821/563fcf81 (2015-05-15/00:41:16)

Loading plugin: http://jabber.org/protocol/stats=8:582 ... , version: 7.0.2-b3821/563fcf81 (2015-05-15/00:41:16)

Loading plugin: starttls=8:582 ... , version: 7.0.2-b3821/563fcf81 (2015-05-15/00:41:16)

Loading plugin: vcard-temp=8:582 ... , version: 7.0.2-b3821/563fcf81 (2015-05-15/00:41:16)

Loading plugin: http://jabber.org/protocol/commands=8:582 ... , version: 7.0.2-b3821/563fcf81 (2015-05-15/00:41:16)

Loading plugin: jabber:iq:private=8:582 ... , version: 7.0.2-b3821/563fcf81 (2015-05-15/00:41:16)

Loading plugin: urn:xmpp:ping=8:582 ... , version: 7.0.2-b3821/563fcf81 (2015-05-15/00:41:16)

Loading plugin: presence=16:291 ... , version: 7.0.2-b3821/563fcf81 (2015-05-15/00:41:16)

Loading plugin: disco=8:582 ... , version: 7.0.2-b3821/563fcf81 (2015-05-15/00:41:16)

Loading plugin: zlib=8:582 ... , version: 7.0.2-b3821/563fcf81 (2015-05-15/00:41:16)

Loading plugin: amp=8:582 ... , version: 7.0.2-b3821/563fcf81 (2015-05-15/00:41:16)

Loading plugin: message-carbons=8:582 ... , version: 7.0.2-b3821/563fcf81 (2015-05-15/00:41:16)

Added by Wojciech Kapcia TigaseTeam over 3 years ago

Can you share source of your plugin? Has it compiled correctly? Is your plugin class present in the resulting binary jar?

Added by Alina Sun over 3 years ago

Hi Wojciech,

I find that my classes are not in the resulting binary jar. My plugin can be loaded successfully after I generate a correct jar file. Thanks very much for your help.

Alina Sun

    (1-6/6)