I've successfully mavenized api, xs and js. All tests are ran by maven
and pass. I am now mavenizing jm and I am facing a class loading problem
with the chain generator. If I use it as-is (not from ant, from maven),
then there is a npe because
Thread.currentThread().getContextClassLoader() is null. I tried using
getClass().getClassLoader() but it then fails with
java.lang.ClassCastException: The controller must be an interface
If I do a JavaSource.toString it is not an interface so what I am
thinking is that maybe there is a bug in CompiledClassReflector.
If in CompildeClassReflector#getJavaSource(JavaSourceFactory)
we do the following:
Class c = getCompiledClass();
JavaSource js = new
JavaSourceFactory().newJavaSource(JavaQNameImpl.getInstance(c.getName(),
true));
+ if (c.isInterface()) {
+ js.setType(JavaSource.INTERFACE);
+ }
Method[] methods = c.getMethods();
for (int i = 0; i < methods.length; i++) {
Method m = methods[i];
getMethod(js, m);
}
it works. Maybe more checks might be needed to get it correct. What do
you think?
nacho
PD: I think there might be an error in ChainGenerator on method
loadSources(ClassLoader pClassLoader, JavaQName pQName,
JavaSourceFactory pFactory,
List pSources, Set pNames)
In this method it then calls loadSource like this:
JavaSource js = loadSource(Thread.currentThread().getContextClassLoader(),
pQName.toString(), pFactory);
using a (possibly) different class loader.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]