Skip to main content

Thunderbird extension : accessing filesystem and security policies

No replies
Joined: 2010-03-08
Points: 0


I am developing a thunderbird / firefox extension using LiveConnect and I have a two different problems in general ...

From the javaScript overlay file I use classloader to launch a .jar file ... The launched application furthermore uses another class loader to intiate another classes - all those classes are in the corresponding .jar file, but I get "unknow" exception, which can be traced back through, and java.lang.ClassLoader ...

source codes are:
for the JS Classloader (standard way i guess):
Components.utils['import']('resource://test/LiveConnectUtils.js', this.LiveConnect);
var jars = ['URLSetPolicy.jar', 'app.jar'];
var [loader,urls] = this.LiveConnect.initWithPrivs(java, 'test', jars);

var aClass = java.lang.Class.forName(app.Frontend', true, loader);


function initWithPrivs (java, ext_id, jarFiles) {
var [loader, urls] = init(java, ext_id, jarFiles);
policyAdd(loader, urls);
return [loader, urls];

and for the app based classloader:
Class<?> cl = ClassLoader.getSystemClassLoader().loadClass(
"app.test." + packageName + "." + name);
InterF mi = (InterF) cl.newInstance();

I am not sure, if this is a policy problem, or classpath problem ... maybe it relates to my other problem:

Default path in launched java application points to Thunderbird installation path (ie C:\Program Files\Mozilla Thunderbid). I need to load huge file with JSGF grammars stored alongisde with the from path where Extension data is stored ( C:\Users\ ... \extensions\test) ...

Thank you for any help or suggestions