ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ravi Krishnamurthy <ra...@savvion.com>
Subject Re: classLoaders
Date Mon, 24 Oct 2005 18:31:59 GMT
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
<body bgcolor="#ffffff" text="#000000">
Thanks Jeff for your reply.<br>
The custom classloader cannot be avoided :(<br>
Yes as you have suggested, I have tried the setDefaultClassLoader
approach and it worked fine.<br>
But as I have asked in my previous email, why is the classloader that
is used to load the resources.java is not used as the defaultLoader
before using the Thread.contextClassLoader. <br>
Jeff Butler wrote:
  <div>Simple solution - get rid of the custom classloader.&nbsp; The custom
classloader is likely to&nbsp;end up introducing hidden application server
dependencies into your code - because it is not safe to assume that all
application servers structure their classloaders the same way.
  <div>If there is some compelling reason to have a custom classloader
(do tell), then maybe this would help:</div>
  <div>Jeff Butler</div>
  <div><span class="gmail_quote">On 10/24/05, <b
 class="gmail_sendername">Ravi Krishnamurthy</b> &lt;<a
 href="mailto:ravik@savvion.com">ravik@savvion.com</a>&gt; wrote:</span>
  <blockquote class="gmail_quote"
 style="border-left: 1px solid rgb(204, 204, 204); margin: 0px 0px 0px 0.8ex; padding-left:
I have a custom classloader that has the ejbclassloader as the parent.<br>
The custom classloader loads all the ibatis classes but the thread
context classloader is the ejbclassloader. So when the ibatis is trying<br>
to load the resource, I get resource not found for the sql...dtd files.<br>
On lookig at the source code looks like in the Resources.java of
the getClassLoader first check the default Classloader and then the<br>
Thread.contextClassloader. Looks like in my case, the defaultClassLoader<br>
is null and so the context classloader (ejbclassloader) is used to<br>
search for the resources and so things file.<br>
Could someone give me some pointers on how to resolve this problem.<br>
But wondering why the getClassLoader does not use the classloader that<br>
loaded the Resources.java to search for the resources.<br>
Please note that the ibatis classes are only visible to the<br>
cutomclassloader and not to the ejbclassloader.<br>
Thanks for your time,<br>

View raw message