I think it's a class loader problem.
The vCO server doesn't use the same class loader during plug-in initialization (IPluginAdaptor) and when calling methods on the plug-in (IPluginFactory).
Your plug-in seems to want to find a resource from the class loader (typically a call to this.getClass().getResourceAsStream()), but because when the call is made it's not the class loader used in initialization, the resource is unavailable.
To solve this issue, before making the call that needs to load the resource, you will have to switch the current class loader to the "plug-in" one in order to find the resource.
You'll first have to store the "plug-in" class loader. To do so, you'll need to change your Adaptor (the class implementing IPluginAdaptor) constructor to something like this:
public class YourAdaptor implements IPluginAdaptor
{
private static ClassLoader pluginClassLoader;
.
.
.
public YourAdaptor( ClassLoader aPluginClassLoader ) {
pluginClassLoader = aPluginClassLoader;
}
.
.
.
public static ClassLoader getPluginClassLoader() {
return pluginClassLoader;
}
}
You can store the plug-in class loader as a static variable or in any other way (a map by adaptor, etc).
Then in the method(s) that load resources, you'll need to switch the current class loader to the "plug-in" one.
Here's a quick example:
public void methodLoadingTheResource() {
ClassLoader originalClassLoader = Thread.currentThread().getContextClassLoader();
try {
// Switch to the ‘pluginClassLoader’ class loader previously stored
Thread.currentThread().setContextClassLoader( YourAdaptor.getPluginClassLoader() );
// The piece of code that needs the resource
.
.
.
}
finally {
Thread.currentThread().setContextClassLoader( originalClassLoader );
}
// Rest of the code
.
.
.
}
Hope this helps.
Regards,
Vincent.