plugin does not find the png files

Hello,
I am trying to modift/improve an existing plugin ( open source plugin )

I have set up my project environment and the SDK and managed to debug my project but for some reason the png files which are located in a resource folder in my project are not being loaded.

I get an exception :
[  13486]  ERROR - tellij.openapi.util.IconLoader - Icon cannot be found in '/reviewBoardLogo.png', aClass='class com.intellij.openapi.wm.impl.ToolWindowManagerImpl'
java.lang.Throwable
at com.intellij.openapi.diagnostic.Logger.error(Logger.java:115)
 at com.intellij.openapi.util.IconLoader.getIcon(IconLoader.java:178)
 at com.intellij.openapi.util.IconLoader.getIcon(IconLoader.java:146)
 at com.intellij.openapi.wm.impl.ToolWindowManagerImpl.initToolWindow(ToolWindowManagerImpl.java:539)
 at com.intellij.openapi.wm.impl.ToolWindowManagerImpl.registerToolWindowsFromBeans(ToolWindowManagerImpl.java:490)
 at com.intellij.openapi.wm.impl.ToolWindowManagerImpl.access$1800(ToolWindowManagerImpl.java:92)
 at com.intellij.openapi.wm.impl.ToolWindowManagerImpl$9.run(ToolWindowManagerImpl.java:446)
 at com.intellij.ide.startup.impl.StartupManagerImpl.runActivity(StartupManagerImpl.java:342)
 at com.intellij.ide.startup.impl.StartupManagerImpl.runActivities(StartupManagerImpl.java:334)
 at com.intellij.ide.startup.impl.StartupManagerImpl.runPostStartupActivities(StartupManagerImpl.java:182)
 at com.intellij.openapi.project.impl.ProjectManagerImpl$5$2.run(ProjectManagerImpl.java:392)
 at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:312)
 at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:745)
 at java.awt.EventQueue.access$300(EventQueue.java:103)
 at java.awt.EventQueue$3.run(EventQueue.java:706)
 at java.awt.EventQueue$3.run(EventQueue.java:704)
 at java.security.AccessController.doPrivileged(Native Method)
 at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
 at java.awt.EventQueue.dispatchEvent(EventQueue.java:715)
 at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:866)
 at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:654)
 at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:381)
 at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:242)
 at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:161)
 at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:150)
 at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:146)
 at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:138)
 at java.awt.EventDispatchThread.run(EventDispatchThread.java:91)



any help would be appriciated.

9 comments
Comment actions Permalink
> Icon cannot be found in '/reviewBoardLogo.png'

try putting a breakpoint where you call IconLoader.getIcon(...)

and evaluate this expression:
new java.io.File( "." ).getCanonicalPath();

it may help you adjust the path to something like 
cwd1/reviewBoardLogo.png

where cwd1 is the current working directory
0
Comment actions Permalink

Make sure compiler copies *.png files and/or your deployment process includes your resources folder

0
Comment actions Permalink

how can I verify that?

0
Comment actions Permalink

the Icom.loader function is not called from my code so I don'y know ehere to put the breakpoint.

0
Comment actions Permalink

put a breakpoint at
com.intellij.openapi.util.IconLoader.getIcon(IconLoader.java:178)

when searching for file, tick "include non-project files"

0
Comment actions Permalink

is your resources folder marked as such (resource folder)?

0
Comment actions Permalink

yes :

review.PNG

is it o.k. like this ?

0
Comment actions Permalink

looks like it is not marked.

try:

right click
Mark Directory As
Resources Root

.. and redeploy

0
Comment actions Permalink

is solved it.

thanks a lot for your help

0

Please sign in to leave a comment.