title: How to deploy EAR application twice on WebLogic server?
body: <p>What I have to do in order to deploy the same EAR application twice on single WebLogic server?</p>
  
  <p>What I have in my application:</p>
  
  <ul>
  <li>EJB layer (EJB 2.0)</li>
  <li>WEB layer (Struts, jsp)</li>
  <li>logging layer (log4j)</li>
  <li>DB layer (Oracle, data source created in WLS)</li>
  <li>WLS 10.3.0</li>
  </ul>
  
  <p>What I need:</p>
  
  <ul>
  <li>two instances of the same application on WLS (unique URL (context-root) per application), each instance should use other data source and should have different configuration</li>
  </ul>
  
  <p>What is my problem? I don't know which things I will have to change in my application to achieve my goals:</p>
  
  <ul>
  <li>configuration of the application bases on many properties files, these files are in one directory which is added to WLS classpath (they are not in EAR file)</li>
  <li>many classes are static (all methods in class are static)</li>
  <li>static logger instance in each class</li>
  <li>what about JNDI object - should I have different names for data sources, session/entity beans, etc?</li>
  <li>what about context-root and hyperlinks in jsp files?</li>
  </ul>
  
  <p><strong>EDIT</strong></p>
  
  <p>I need to have two different EAR files with unique names and unique context-roots. Each application will be connected to unique data source and will have unique configuration.</p>
  
  <p>I have some questions regarding changes in my application:</p>
  
  <ul>
  <li>what about static methods in my classes? WLS documentation says that each application receives its own classloader hierarchy. Should I be afraid of conflicts? I have statics in client part and in server (EJB) part.</li>
  <li>what about EJB names? Should I have unique names per each application? Should I be afraid of conflicts in JNDI tree? I use <code>lookup</code> methods.</li>
  <li>what about static loggers in my classes? Can I use <code>prefer-application-packages</code> tag in <code>weblogic-application.xml</code> to avoid conflicts?</li>
  </ul>
  
  <p>Really thanks for help.</p>