Customer login  |   Contact us
Home Company Products Support Purchase
Forum Home » Survey software » Opinio plugins

Topic: Plugin.JAR.getPath()
Replies: 5   Pages: 1   Last Post: Jul 18, 2010 8:40 AM by: abernethyaccursius


Back to Topic List Back to Topic List Topics: [ Previous | Next ]
Replies: 5   Pages: 1  
whoover

Posts: 2
Registered: Mar 10, 2009
Plugin.JAR.getPath()
Posted: Mar 10, 2009 6:12 PM
  Reply

Isn't http://www.objectplanet.com/opinio/doc/plugin_api/com/objectplanet/survey/plugin/Plugin.JAR.html#getPath() supposed to be part of the public API? It has been obfuscated in the opinio.jar - how can I access this method?

whoover

Posts: 2
Registered: Mar 10, 2009
Re: Plugin.JAR.getPath()
Posted: Mar 17, 2009 12:56 PM
  Reply

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
  Reply

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
  Reply

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
  Reply

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

abernethyaccursius

Posts: 1
Registered: Jul 15, 2010
Re: Plugin.JAR.getPath()
Posted: Jul 18, 2010 8:40 AM
  Reply

thanx



© 1998-2017 ObjectPlanet, Inc. Øvre Slottsgate 5, 0157 Oslo, Norway Tel (+47) 2233 3360 | Fax (+47) 2233 3361