[IllegalPropertyException] How to increase JIRA Custom Mail Handler Plugin 255 character limit when saving to DB

Ricardo Joseph
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 20, 2013

Hi,

I have developed a custom mail handler plugin and am currently unable to save its configuration due to the below error.

Error adding service: com.opensymphony.module.propertyset.IllegalPropertyException: String exceeds 255 characters..

Step by Step example:

1. Administration > Incoming Mail > Mail Handlers - Add incoming mail handler

2. I complete the first page of the form that pops up (e.g. Name, Handler etc...) and then click the Next button

3. I enter all additional configuration into the second page's form, however upon clicking the "Save" button I receive the aforementioned error...

Please advise as to how I go about increasing the 255 character limit or another viable solution.

3 answers

1 accepted

0 votes
Answer accepted
Tiago Comasseto
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 20, 2013

Hi Ricardo,

Judging by your description, it seems to me that this limitation is on the database. Mail handlers are stored into the tables propertyentry and it has the character limiti restriction as follow:

mysql> desc propertyentry;
+--------------+---------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+--------------+---------------+------+-----+---------+-------+
| ID | decimal(18,0) | NO | PRI | NULL | |
| ENTITY_NAME | varchar(255) | YES | MUL | NULL | |
| ENTITY_ID | decimal(18,0) | YES | MUL | NULL | |
| PROPERTY_KEY | varchar(255) | YES | MUL | NULL | |
| propertytype | decimal(9,0) | YES | | NULL | |
+--------------+---------------+------+-----+---------+-------+
5 rows in set (0.00 sec)

You may change the datatype, but honestly I'm not sure if it's a good idea as it's difficult to know if it's going to affect other functionalities in JIRA.

Cheers

Ricardo Joseph
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 20, 2013

This answer is indeed the solution, however I have decided to significantly reduce the amount of configuration being offered (for the time being) to circumvent the frequent occurence of this message. I may revisit this in the future :)

Thank you for the information

1 vote
Hangsu Ma
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 19, 2015

I had exactly same problem, It was the class mail handler use to save settings.
By default, mail handler is using a specific implementation of PropertySet to persist the settings, if I recall correctly is OFBizPropertySet, this one has a hard limit of 255 chars.
If you want to save longer config, you need to consider switch to PlugingSettings:
https://developer.atlassian.com/docs/common-coding-tasks/storing-plugin-settings
or Active Object:
https://developer.atlassian.com/docs/atlassian-platform-common-components/active-objects

0 votes
Luca Andreatta
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 2, 2016

Hi Ricardo,

did you find a solution to this problem without reducing parameters?

Suggest an answer

Log in or Sign up to answer