[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

This widget could not be displayed.

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

This widget could not be displayed.

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

This widget could not be displayed.

Hi Ricardo,

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

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted Tuesday in Jira

What modern development practices are at the heart of how your team delivers software?

Hey Community mates! Claire here from the Software Product Marketing team. We all know software development changes rapidly, and it's often tough to keep up. But from our research, we've found the h...

241 views 1 3
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