ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Larry Meadors <lmead...@apache.org>
Subject Re: classLoaders
Date Mon, 24 Oct 2005 17:55:11 GMT
That is an interesting problem. I wonder why the custom class loader
is not set as the thread class loader. Hm..oh well. :-)

If we use the Resources.java class loader, everything breaks when
people share the iBATIS jar files (i.e., in common/lib or shared/lib
with tomcat..which IMO, is a bad idea anyway).

You may want to try using Resources.setClassLoader(yourEjbClassLoader)
to see if it makes things work. You will need to do that before the
rest of iBATIS loads, so it may take some digging on your part to
figure out WHERE to do that, but it is worth a try.

Just curious, what environment is this in?

Larry

On 10/24/05, Ravi Krishnamurthy <ravik@savvion.com> wrote:
> Hello:
> I have a custom classloader that has the ejbclassloader as the parent.
> The custom classloader loads all the ibatis classes but the thread
> context classloader is the ejbclassloader. So when the ibatis is trying
> to load the resource, I get resource not found for the sql...dtd files.
> On lookig at the source code looks like in the Resources.java of ibatis,
> the getClassLoader first check the default Classloader and then the
> Thread.contextClassloader. Looks like in my case, the defaultClassLoader
> is null and so the context classloader (ejbclassloader) is used to
> search for the resources and so things file.
>
> Could someone give me some pointers on how to resolve this problem.
>
> But wondering why the getClassLoader does not use the classloader that
> loaded the Resources.java to search for the resources.
>
> Please note that the ibatis classes are only visible to the
> cutomclassloader and not to the ejbclassloader.
>
> Thanks for your time,
>
> Regards,
> Ravi
>
>

Mime
View raw message