whoover
Posts:
2
Registered:
Mar 10, 2009
|
|
|
whoover
Posts:
2
Registered:
Mar 10, 2009
|
|
Re: Plugin.JAR.getPath()
Posted:
Mar 17, 2009 12:56 PM
|
|
No one knows the answer to this?
|
|
dlouwers
Posts:
3
From:
Utrecht, Netherlands
Registered:
Apr 21, 2010
|
|
Re: Plugin.JAR.getPath()
Posted:
Apr 21, 2010 1:15 PM
|
|
I am having similar issues. I want to load a resource from the root of the plugin jar. The API documentation suggests that the following should work to retrieve a usable classloader:
myPluginInstance.getJAR().getClassLoader()
Unfortunately no such method is available. However it seems that myPluginInstance.getJAR().Z() returns a classloader. I am using 6.2 Lite. Will let you know how this works out for me.
|
|
dlouwers
Posts:
3
From:
Utrecht, Netherlands
Registered:
Apr 21, 2010
|
|
Re: Plugin.JAR.getPath()
Posted:
Apr 21, 2010 2:33 PM
|
|
Ok, using the #Z() method didn't work out and caused a NoSuchMethodError exception. This seems to indicate that IDEA has trouble with the opinio.jar or I am just using the wrong one. Will try again with a fresh copy.
|
|
dlouwers
Posts:
3
From:
Utrecht, Netherlands
Registered:
Apr 21, 2010
|
|
Re: Plugin.JAR.getPath()
Posted:
Apr 21, 2010 3:06 PM
|
|
Ok, I have to come to the conclusion that Plugin.JAR#getClassLoader can and in my case will throw a NullPointerException. See following block that will throw the NPE:
if (plugin == null) throw new Exception("Plugin is null"); if (plugin.getJAR() == null) throw new Exception("JAR is null"); ClassLoader cl = plugin.getJAR().getClassLoader(); if (cl == null) thow new Exception("ClassLoader is null");
Unfortunately this is taking too many resources from my development effort so I will stop investigating now. Any input would still be welcome but I will have to try and work around this.
Best,
Dirk Louwers
|
|
|
|
Re: Plugin.JAR.getPath()
Posted:
Jul 18, 2010 8:40 AM
|
|
thanx
|
|
|
|
|