title: Duplicate class in two modules in an application - which will be referred to by an instantiating class?
body: <p>There is an EAR(<code>myApp.ear</code>) of a web application in which there are two modules - a web module (<code>myWeb.war</code>) and an EJB module (<code>myModel.jar</code>). Now there is a class <code>myDuplicate.class</code> which is present in both the modules in the same package <code>myPackage</code>. The implementation of the class is different in both modules.</p>
  
  <p>If a class in the web module creates an object of the class <code>myDuplicate</code> then the object will be of from the one in <code>myWeb</code> or the one in <code>myModel</code>?</p>
  
  <p>Does this depend on classloading mechanisam of the server? If yes, is there a parameter in <code>OC4J</code> server configuration to control this classloading? If no, then what controls it?</p>
  
  <hr>
  
  <p>The above may have seemed too generic but that it is a practical problem that I am facing. In different environments different classes are being loaded but I am unable to find out what is controlling it. I tried searching and came to classloaders which might be the answer. But even after that I was unable to find how to control it to behave in a consistent manner in both environments.</p>
  
  <p>If anything is not clear please share what is not and I will try to clarify.</p>