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

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

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

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

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

Hi Ricardo,

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

Suggest an answer

Log in or Join to answer
Community showcase
Sarah Schuster
Posted Jan 29, 2018 in Jira

What are common themes you've seen across successful & failed Jira Software implementations?

Hey everyone! My name is Sarah Schuster, and I'm a Customer Success Manager in Atlassian specializing in Jira Software Cloud. Over the next few weeks I will be posting discussion topics (8 total) to ...

2,968 views 12 18
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot