Forums

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

Getting resource from plugin only works after restart

kim May 12, 2019

Hi,

In my Jira-plugin I'm trying to load a resource. When the plugin is installed it doesn't work, but after a restart of Jira everthing works fine. I have tried the following methods with various getClass-methods. All with the same result.

String resource = "/resource.tmp"; // Located in /src/resources
InputStream in = getClass().getClassLoader().getResourceAsStream(resource);

InputStream in = com.atlassian.core.util.ClassLoaderUtils.getResourceAsStream(resource, this.getClass());

InputStream in = ComponentAccessor.getPluginAccessor().getDynamicResourceAsStream(resource);

InputStream in = webwork.util.ClassLoaderUtils.getResourceAsStream(resource, MailSender.class);

I'm using Spring Scanner version 2.1.8

 

Moved to Developer Community:

https://community.developer.atlassian.com/t/getting-resource-from-plugin-only-works-after-restart/29226

1 answer

0 votes
Andrew
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 12, 2019

Hi @kim ,

I think better ask in dev community https://community.developer.atlassian.com/

B.R.

Suggest an answer

Log in or Sign up to answer