Project

General

Profile

New component development : MessageRouterConfig.hasClassForServerComponent() WARNING: Can't load component

pranathi venkatayogi
Added almost 2 years ago

I have a written a simple component (translate), which just prints the packet into log file.

However in the tigase.log i get the following error:

[WrapperSimpleAppMain]  MessageRouterConfig.hasClassForServerComponent()  WARNING: Can't load component translate: tigase.translate.TranslateComponent

Could someone please point to me what i may be missing or how i can log additional details in the log to debug further.

Following is the init.properties and i am attaching my jar file as well.

--comp-class-1 = tigase.muc.MUCComponent
--virt-hosts = localhost
--user-db-uri = jdbc:derby:C:\\Users\\admpvenkatayogi\\Tigase\\tigasedb
--user-db = derby
--admins = admin@LAB91100
--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,+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
--debug = server
--comp-class-4 = tigase.archive.MessageArchiveComponent
--comp-class-3 = tigase.socks5.Socks5ProxyComponent
--comp-class-2 = tigase.pubsub.PubSubComponent
--comp-name-5 = translate
--comp-class-5 = tigase.translate.TranslateComponent
--debug=server,cluster,xml

Server version: tigase-server-7.0.4


Replies (9)

Added by Andrzej Wójcik IoT 1 CloudTigaseTeam almost 2 years ago

From what I see, you are trying to add your own component to Tigase XMPP Server running under Windows and started using wrapper (Tigase XMPP Server is started as a service using wrapper).

In versions of Tigase XMPP Server prior to 7.1.0, wrapper.conf file which was used to configure wrapper contains list of jars which needs to be loaded. Only this jars are loaded by JVM and as jar with your component is not listed it is not loaded and not available for Tigase XMPP Server.

In Tigase XMPP Server 7.1.0-SNAPSHOT we updated wrapper software to a new version which allows us to load every jar from jars directory. If you placed jars with custom component in jars directory it would be automatically loaded in version 7.1.0-SNAPSHOT.

To make Tigase XMPP Server 7.0.4 to load your component from custom jar when Tigase is started using wrapper you need to modify wrapper.conf config file and add your jar to list of loaded jars (look for wrapper.java.classpath. entries).

Added by pranathi venkatayogi almost 2 years ago

Thank you Andrzej. That worked.

Now I simulated a chat and my component receives it (see log statement from tigase.log). But i am not seeing the log statement by my component, starting with : "My Packet is..."

The following the last statement in the log file.

MessageRouter.processPacket() FINEST: 1. Packet will be processed by: translate@lab91100.cyracom.com, from=sess-man@lab91100.cyracom.com, to=null, DATA=baba translate, SIZE=228, XMLNS=jabber:client, PRIORITY=NORMAL, PERMISSION=AUTH, TYPE=chat

Should I be doing something more/different than defining the log as below for logging to work?

private static final Logger log = Logger.getLogger(TranslateComponent.class.getName());

Added by pranathi venkatayogi almost 2 years ago

Any clue please. Do i need to set some packet filters etc? I am just following the sample given in the development guide, but does not work. My Jar file is attached above.

Added by Wojciech Kapcia TigaseTeam almost 2 years ago

--debug = server
…
--comp-class-5 = tigase.translate.TranslateComponent
--debug=server,cluster,xml

Frist of all - you have two debug configurations - you should use only one. Please also take a look at --debug which explains it.

In your code, only Leve.INFO will be logged by default.

Added by Gib Rod about 1 year ago

I have same issue... using the version 7.1.0

I have placed the jar file and class where the documentation says and my config looks like this:

jars/test-component.jar

target/classes/tigase/xmpp/impl/TestComponent.class

config-type=--gen-config-def
--admins=admin@localhost
--virt-hosts = localhost
--debug=server,cluster,xml

--user-db-uri=mongodb://localhost/db
--user-db=tigase.mongodb.MongoRepository
--auth-db=tigase.mongodb.MongoRepository

muc/history-db-uri=mongodb://localhost/db
pubsub/pubsub-repo-url=mongodb://localhost/db

message-archive/archive-repo-uri=mongodb://localhost/db
ess-man/plugins-conf/message-archive-xep-0136/default-store-method=message
sess-man/plugins-conf/message-archive-xep-0136/required-store-method=message

sess-man/plugins-conf/presence/auto-authorize=true
sess-man/plugins-conf/jabber\:iq\:roster/auto-authorize=true
sess-man/plugins-conf/auto-authorize=true

--sm-plugins = +message-archive-xep-0136,+urn:xmpp:blocking,+msgoffline,+http://jabber.org/protocol/address

# The Components which are enabled
--comp-name-1=message-archive
--comp-class-1=tigase.archive.MessageArchiveComponent
--comp-name-2 = address
--comp-class-2 = tigase.address.ExtendedAddressing
--comp-name-3 = test
--comp-class-3 = tigase.test.TestComponent

Added by Wojciech Kapcia TigaseTeam about 1 year ago

Gib Rod wrote:

I have same issue... using the version 7.1.0

I have placed the jar file and class where the documentation says and my config looks like this:

jars/test-component.jar

target/classes/tigase/xmpp/impl/TestComponent.class

Why have you placed TestComponent.class to the target? Which part of the documentation were you following.

Having the jars/test-component.jar and

--comp-name-3 = test
--comp-class-3 = tigase.test.TestComponent

Should be enough - you should be able to see component loading in the @logs/tigase-console.log@, component should be visible in service discovery of your client and packets addressed to your component should be processed by it.

Added by Gib Rod about 1 year ago

Gib Rod wrote:

I have same issue... using the version 7.1.0

I have placed the jar file and class where the documentation says and my config looks like this:

jars/test-component.jar

target/classes/tigase/xmpp/impl/TestComponent.class

config-type=--gen-config-def

--admins=admin@localhost

--virt-hosts = localhost

--debug=server,cluster,xml

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

--user-db=tigase.mongodb.MongoRepository

--auth-db=tigase.mongodb.MongoRepository

muc/history-db-uri=mongodb://localhost/db

pubsub/pubsub-repo-url=mongodb://localhost/db

message-archive/archive-repo-uri=mongodb://localhost/db

ess-man/plugins-conf/message-archive-xep-0136/default-store-method=message

sess-man/plugins-conf/message-archive-xep-0136/required-store-method=message

sess-man/plugins-conf/presence/auto-authorize=true

sess-man/plugins-conf/jabber:iq:roster/auto-authorize=true

sess-man/plugins-conf/auto-authorize=true

--sm-plugins = +message-archive-xep-0136,+urn:xmpp:blocking,+msgoffline,+http://jabber.org/protocol/address

The Components which are enabled

--comp-name-1=message-archive

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

--comp-name-2 = address

--comp-class-2 = tigase.address.ExtendedAddressing

--comp-name-3 = test

--comp-class-3 = tigase.test.TestComponent

Added by Gib Rod about 1 year ago

Ok. Managed to get it work. thanks

Added by Wojciech Kapcia TigaseTeam about 1 year ago

Please share your solution so the community can benefit and if anyone would run into the topic they will have the answer/hint how to solve it.

    (1-9/9)