This should hopefully explain it for you: https://jenkins.io/doc/developer/plugin-development/dependencies-and-class-loading/
Thanks Tim On Wed, 17 Jul 2019 at 15:32, Jack Shen <[email protected]> wrote: > 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 > > -- > 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 [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/jenkinsci-dev/cb7405da-a1e5-447c-96fe-f5d5a7a4eb15%40googlegroups.com > <https://groups.google.com/d/msgid/jenkinsci-dev/cb7405da-a1e5-447c-96fe-f5d5a7a4eb15%40googlegroups.com?utm_medium=email&utm_source=footer> > . > For more options, visit https://groups.google.com/d/optout. > -- 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 [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/CAH-3BidEuJ4J%3D5qzydnMWFYZKJgNi4M6-p%3DD3dFwi1XtBG1cng%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
