Monday, June 29, 2009

Weblogic Classloading configuration

Weblogic Server classloading manual
http://e-docs.bea.com/wls/docs103/programming/classloading.html

WebLogic Server provides a location within an EAR file where you can store shared utility classes. Place utility JAR files in the APP-INF/lib directory and individual classes in the APP-INF/classes directory.

  • Create test library to print classloader of class
System.out.println(clazz.getSimpleName() + " loaded by " + clazz.getClassLoader().getClass().getSimpleName());
  • Add test library into Web Project



  • Add library into EAR

  • Deploy with prefer-web-inf-classes = true
TestClassloader loaded by ChangeAwareClassLoader
TestServlet loaded by ChangeAwareClassLoader
TestClassloader loaded by GenericClassLoader
TestSessionBean_eb2d8g_Impl loaded by GenericClassLoader

  • Deploy with prefer-web-inf-classes = false ( default)
TestClassloader loaded by GenericClassLoader TestServlet loaded by ChangeAwareClassLoader TestClassloader loaded by GenericClassLoader TestSessionBean_eb2d8g_Impl loaded by GenericClassLoader

Sunday, June 28, 2009

Create JavaEE application using Eclipse Ganymede and Weblogic 10.3




  • Add WLS 10.3 as new server

  • Create new EJB project
  • Create new Dynamic Web Project
  • Run EAR project on WLS server