I've got the sources, fired up my debugger and have now more details. This is the code fragment from org.jibx.runtime.BindingDirectory that throws this error:
Code:
try {
Class factory = loader.loadClass(name);
Method method = factory.getMethod(FACTORY_INSTMETHOD, EMPTY_ARGS);
result = method.invoke(null, (Object[])null);
} catch (SecurityException e) {
ex = e;
} catch (ClassNotFoundException e) {
ex = e;
} catch (NoSuchMethodException e) {
ex = e;
} catch (IllegalAccessException e) {
ex = e;
} catch (InvocationTargetException e) {
ex = e;
incompat = true;
} finally {
if (ex == null) {
if (result instanceof IBindingFactory) {
// ommited
} else {
throw new JiBXException
("Classloader conflict for binding factory '" + name +
"' - factory does not implement required interface");
}
// ommited
the 'name' variable is 'foo.test.JiBX_bindingFactory' the classloader is my bundle's classloader (foo.test) so it must see this class without problems
however there is some exception thrown because after this line
Code:
Class factory = loader.loadClass(name);
execution falls directly into the finally block with ex == null and result == null. That is strange because there are a lot of exception types to be caught and it seems that this exception is not one of them.
I tried to evaluate
Code:
loader.loadClass(name)
in 'Expressions' view in STS to view the exception it gets but strangely it doesn't evaluate anything at all (even something like 2+2 - just shows blank result).
P.S. I use Virgo 2.1.1 if that is to be mentioned
=== update ===
OK, I finally found the source of problem when I faced it again. The problem is that JiBX instrumented classes are extending some classes from org.jibx.runtime.impl package which I thought was private, so I did neither export or import it. Hope that helps someone =)