Library(JollyDay)'s properties file cannot be found by WebAppClassLoader in Jenkins runtime.

23 views
Skip to first unread message

Jack Shen

unread,
Jul 17, 2019, 10:31:56 AM7/17/19
to Jenkins Developers

Link to the issue in Jira: https://issues.jenkins-ci.org/browse/JENKINS-58530


I'm trying to use [JollyDay |https://github.com/svendiedrichsen/jollyday]to provide ability to get holidays, but its day-calculate algorithm is based on some .porperties file(typically Jollyday.properties). These files can be found in running unit test, but when running it in jenkins, they're missed.

When looking at the stack trace, this lib is using current thread's context classloader ( WebappClassLoader)  to get resource, but the loader returned null.

However, using HolidayCalendar(one class of JollyDay).class.getClassLoader().getResource() works fine.( But the returned URL is from my system maven repo)

Are there anything I missed to do, like mvn install? I tryed that, but it's not the cause.

PS, are all the temp file in the "target" dir? I guess it's because there is no jollyday.properties in the dir.

Should I add some more config to include it? But I'm not quite clear about how to handle this.

 

Stack Trace:

Caused by: java.lang.NullPointerExceptionCaused by: java.lang.NullPointerException 

at de.jollyday.configuration.impl.DefaultConfigurationProvider.getProperties(DefaultConfigurationProvider.java:59) at de.jollyday.configuration.ConfigurationProviderManager.addInternalConfigurationProviderProperies(ConfigurationProviderManager.java:63) at de.jollyday.configuration.ConfigurationProviderManager.mergeConfigurationProperties(ConfigurationProviderManager.java:57) at de.jollyday.HolidayManager.createManager(HolidayManager.java:163) at de.jollyday.HolidayManager.getInstance(HolidayManager.java:148) at de.jollyday.HolidayManager.getInstance(HolidayManager.java:124) at org.jenkinsci.plugins.workinghours.WorkingHoursUI.getRegionHolidays(WorkingHoursUI.java:84) at org.jenkinsci.plugins.workinghours.WorkingHoursUI.doDynamic(WorkingHoursUI.java:64) at java.lang.invoke.MethodHandle.invokeWithArguments(MethodHandle.java:627) at org.kohsuke.stapler.Function$MethodFunction.invoke(Function.java:343) ... 64 more

Tim Jacomb

unread,
Jul 17, 2019, 12:33:23 PM7/17/19
to jenkin...@googlegroups.com
This should hopefully explain it for you:
Thanks
Tim

--
You received this message because you are subscribed to the Google Groups "Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-de...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/cb7405da-a1e5-447c-96fe-f5d5a7a4eb15%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages