Closed GoogleCodeExporter closed 8 years ago
Hi,
Thanks for your help! And sorry for the delay.
In all your solutions you have used the name of the class-loader class. Is
there no
need to set a specific class-loader instance, or at least provide a parameter /
parameters to the class-loader?
Regards,
Thomas
Original comment by thomas.t...@gmail.com
on 26 Aug 2009 at 5:07
Fair call. It probably makes more sense to specify a method that will give us
the class loader instance. e.g.
CREATE ALIAS MY_STORED_PROC FOR "org.windyroad.Procs.MY_STORED_PROC";
SET CLASSLOADER "org.windyroad.MyClassLoader.getInstance" FOR
"org.windyroad.Procs";
SET CLASSLOADER "com.tibco.pe.plugin.SharedClassLoader.getInstance" FOR
"org.windyroad.MyClassLoader";
I was admittedly working from memory on this as I had to solve a very similar
issue for a completely unrelated
library. Having a look back at that code, I'm using
com.tibco.pe.plugin.SharedClassLoader, which has a public
static getInstance() method that takes no args.
Let's now say we have a class loader that either doesn't have a getInstance or
similar method, or the method
expects some arguments. In that case, I can create one as follows
public class MyClassLoaderFactory {
private static MyClassLoader mcl = null;
public static ClassLoader getInstance() {
if( mcl == null ) {
// throw exception
}
return mcl;
}
public static ClassLoader getInstance(/*some args*/) {
if( mcl == null ) {
// do what I need here to create a MyClassLoader instance and assign it to mlc
}
return mcl;
}
};
Then, all I would need to do is make sure I call the second
MyClassLoaderFactory.getInstance() method,
before I called any h2 code.
thoughts?
Original comment by t...@windyroad.org
on 30 Aug 2009 at 10:05
Hi,
Have been playing with h2 inside NetKernel and encountered a similar
ClassLoader issue (see
http://www.1060.org/forum/topic/569/1). However the fix for this one is a lot
simpler than the discussed
options. If h2 used the context class loader to load trigger classes then the
problem goes away. I've attached an
h2 patch which achieves what I need, it is effectively a one-liner.
Cheers,
Chris
Original comment by christop...@deltaxml.com
on 11 Sep 2009 at 6:08
I like the getContextClassLoader solution and will implement
it in the next release.
Original comment by thomas.t...@gmail.com
on 11 Sep 2009 at 6:51
The getContextClassLoader solution is implemented in version 1.1.119
Original comment by thomas.t...@gmail.com
on 26 Sep 2009 at 11:32
Original issue reported on code.google.com by
t...@windyroad.org
on 20 Aug 2009 at 12:48