Error in logs Class or variable not found: org.apache.commons.lang.time.DateUtils

Marc Jason Mutuc
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.
February 23, 2015

My code is as follows :

<!-- @@Formula:

if (issue.get("customfield_13702")==null) return null;
org.apache.commons.lang.time.DateUtils.addDays(issue.get("customfield_13702"),30)

-->

It is working but it is throwing the following error message on my logs

2015-02-23 06:12:23,001 http-bio-8080-exec-67047 ERROR MALE0814 372x11861058x3 jdircw 10.71.108.112,127.0.0.1 /rest/api/latest/issue/OTS3-29385 [innovalog.jmcf.fields.CalculatedDateField] CalculatedDateField: error evaluating formula: Sourced file: inline evaluation of: ``   if (issue.get("customfield_13702")==null) return null; org.apache.commons.lan . . . '' : Class or variable not found: org.apache.commons.lang.time.DateUtils

Not sure what is wrong.

JIRA VERSION : 6.2.7

JMCF VERSION : 1.5.11

1 answer

1 accepted

1 vote
Answer accepted
David _old account_
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.
February 23, 2015

The formula cannot be working if it is throwing these errors. They mean that the org.apache.commons.lang.time.DateUtils class is not available from the BeanShell context, which is derived from the plugin classpath, which itself is driven by OSGi. This is a common issue, to which I initially implemented a solution which revealed another issue in JIRA that was worse than the initial issue.

I don't believe there is any easy solution to this problem. The only working solution is to manually edit the plugin JAR, which I would not recommend.

Marc Jason Mutuc
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.
March 3, 2015

It is working. It's just odd that there is still that error. :S

David _old account_
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.
March 3, 2015

Actually, I have built a workaround in the next version of JMCF. A test version is attached to the following issue: https://innovalog.atlassian.net/browse/JMCF-154. Does it solve your issue?

Marc Jason Mutuc
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 4, 2015

Hey! Sorry for not getting back to you. Got really busy with different projects. I'm currently installing it and will let you know how it goes.

Marc Jason Mutuc
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 6, 2015

Happy to say that the error messages are no longer being thrown! Thank you so much!

Suggest an answer

Log in or Sign up to answer