Project

General

Profile

Illegal character exception with space in room name

Khaleel Shaik
Added over 4 years ago

Hi,

When I try to show a group name with space, the server throws illegal character exception as shown below.

How do I fix it. Can I use any encryption (for example in the URL we use %20) value that I can use for space character.

(Note: The list of room names are received from a database where its manually created as a list.)

Error:

tigase.util.TigaseStringprepException: Illegal characters in string.

    at tigase.util.XMPPStringPrepSimple.nodeprep(XMPPStringPrepSimple.java:78)

    at tigase.xmpp.BareJID.bareJIDInstance(BareJID.java:130)

    at tigase.xmpp.BareJID.bareJIDInstance(BareJID.java:101)

    at tigase.muc.repository.inmemory.InMemoryMucRepository.getPublicVisibleRoomsIdList(InMemoryMucRepository.java:254)

    at tigase.muc.modules.DiscoveryModule.processDiscoItems(DiscoveryModule.java:131)

    at tigase.component.modules.impl.DiscoveryModule.process(DiscoveryModule.java:73)

    at tigase.component.modules.ModulesManager.process(ModulesManager.java:119)

    at tigase.component.AbstractComponent.processPacket(AbstractComponent.java:375)

    at tigase.muc.MUCComponent.processPacket(MUCComponent.java:399)

    at tigase.server.AbstractMessageReceiver$QueueListener.run(AbstractMessageReceiver.java:1475)

Note: I am getting this error when I get the list of group names from the database (a prelist) and need to show them as rooms. Not really created in Tigase/MUC, but directly created.


Replies (4)

(1)
Avatar?id=6023&size=32x32

Added by Artur Hefczyc TigaseTeam over 4 years ago

You have to use only valid characters for the JID in XMPP protocol. Room name is part of the JID, therefore if you put an incorrect character it will be rejected by Tigase.

Please check the RFC: Address Format for exact details about characters that can be used for JID.

(1)

Added by Khaleel Shaik over 4 years ago

Hi Artur Hefczyc,

If i use the property in the init.properties --stringprep-processor=empty, will I be able to use the spaces in the names?

Note: based on the https://projects.tigase.org/boards/4/topics/3251?r=3256 ?

Regards

Khaleel

(1)
Avatar?id=6023&size=32x32

Added by Artur Hefczyc TigaseTeam over 4 years ago

Most likely yes, but, if you use characters not allowed by the standard I cannot guarantee that everything will work correctly, even inside the Tigase XMPP Server. It may also affect and/or break other XMPP clients which connect to the service.

The empty stringprep processor has been made available not to break standards but to improve performance on systems which can guarantee that JID will always be correct anyway, such as systems where JIDs are automatically generated by algorithm which uses only correct characters,

(1)

Added by Khaleel Shaik over 4 years ago

Hi,

Thanks, its working for the group names.

However, I am not sure what else to test to make sure that its working perfection without any issues at any other places.

I will wait and see if I hit any issue in future. For time being I would say its working.

Thanks a lot.

Regards

Khaleel

    (1-4/4)