The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Script Runner does not seem to find external .jar properties

Guilherme Peres
January 22, 2019

Hello!

I'm using Jira v6.3.13 (WAR, with Apache Tomcat 7 and Java 8) and Script Runner v3.1.4. I wanted to use Jollyday (v0.5.7) with some scripted fields, and downloaded its .jar into Jira's WEB-INF/lib folder. After restarting, it seems to load the jar's classes just fine, but the script is having some trouble finding the jar's internal .properties. When this is executed inside the Script Console:

import de.jollyday.Holiday;
import de.jollyday.HolidayCalendar;
import de.jollyday.HolidayManager;

HolidayManager m = HolidayManager.getInstance(HolidayCalendar.BRAZIL);

Set<Holiday> holidays = m.getHolidays(2019, "br");
return holidays

It returns:

groovy.lang.GroovyRuntimeException: null at org.codehaus.groovy.runtime.InvokerHelper.formatList(InvokerHelper.java:689) at org.codehaus.groovy.runtime.InvokerHelper.toListString(InvokerHelper.java:776) at org.codehaus.groovy.runtime.InvokerHelper.toListString(InvokerHelper.java:764) at org.codehaus.groovy.runtime.InvokerHelper.toListString(InvokerHelper.java:753) at org.codehaus.groovy.runtime.InvokerHelper.toString(InvokerHelper.java:124) at org.codehaus.groovy.runtime.DefaultGroovyMethods.toString(DefaultGroovyMethods.java:13686) at com.onresolve.scriptrunner.runner.rest.common.UserScriptEndpoint.exec(UserScriptEndpoint.groovy:95) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at com.sun.jersey.spi.container.JavaMethodInvokerFactory$1.invoke(JavaMethodInvokerFactory.java:60)
[...]
Caused by: java.util.MissingResourceException: Can't find bundle for base name descriptions.holiday_descriptions, locale pt_BR at java.util.ResourceBundle.throwMissingResourceException(ResourceBundle.java:1573) at java.util.ResourceBundle.getBundleImpl(ResourceBundle.java:1396) at java.util.ResourceBundle.getBundle(ResourceBundle.java:1091) at de.jollyday.util.ResourceUtil.getResourceBundle(ResourceUtil.java:174) at de.jollyday.util.ResourceUtil.getHolidayDescriptions(ResourceUtil.java:152) at de.jollyday.util.ResourceUtil.getHolidayDescription(ResourceUtil.java:83) at de.jollyday.Holiday.getDescription(Holiday.java:99) at de.jollyday.Holiday.toString(Holiday.java:140) at org.codehaus.groovy.runtime.InvokerHelper.format(InvokerHelper.java:629) at org.codehaus.groovy.runtime.InvokerHelper.formatList(InvokerHelper.java:687) ... 191 more

It's worth noting that descriptions.holiday_descriptions is a .properties file located inside the .jar (inside the descriptions folder). The locale does not seem to be the problem, since the problem persists if the locale is en_US. I tried adding the properties files inside the WEB-INF/classes as well, to no avail.

Is there some incompatibility with this jar, or with Script Runner trying to import properties into the console? Is there a different approach that could be tried?

0 answers

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

TAGS
AUG Leaders

Atlassian Community Events