Jetty and WebLogic JNDI sitting in a tree...

Posted by Steve Longdo Thu, 17 May 2007 04:26:00 GMT

I am a huge fan of Jetty for Java web application development. Love how fast it loads, reloads, and generally kicks the crap out of Tomcat. The Jetty team seems to follow the JEE specifications that they do implement (not all of them) much more strictly than Tomcat. This makes it a very good testbed for developing applications that will be eventually hosted on WebLogic Server .

Until you need to do something like run Message Driven Beans with WLS special performance enhancing sauce. Jetty has it’s jetty-plus configuration which supports JNDI and some other JEE niceties. If you really want to use the full on BEA JMS/MDB combo though you have a problem.

Including the weblogic.jar in Jetty’s classpath is not the answer. This will cause all sorts of confusion about which implementations of java. * and javax. * packages to use. Within the WebLogic Server distribution’s server/lib directory there is a wlclient.jar. Again this won’t work right in your overall classpath, but it will work if you put the wlclient.jar inside of a webapp’s WEB-INF/lib directory. Your code will just need to make a small accommodation for connecting to WLS JNDI constructing the InitialContext with the WebLogic specific properties:

    Properties props = new Properties();
    props.put(Context.INITIAL_CONTEXT_FACTORY,"weblogic.jndi.WLInitialContextFactory");
    props.put(Context.PROVIDER_URL, "t3://localhost:7001");
    InitialContext ctx = null;
  try{
      InitialContext ctx = new InitialContext(props);
       (...Lookup JMS Queues, place Messages, etc...)
  } catch (Exception e) {
     (do something!)
  } finally {
       try{ ctx.close() } catch (Exception e) { (eek! just have to eat this one!)}
  }
This gives you the flexibility of using Jetty configured JNDI objects as well as leveraging WebLogic JNDI objects without having to eat huge WebLogic redeployment startup times for your web application.

Running BEA WebLogic Server on OS X...

Posted by Steve Longdo Sun, 29 Apr 2007 19:31:00 GMT

People have trying installs of BEA WLS on OS X out for awhile. I remember installing WLS 9.2 back in 2005. I recently ran across a blog entry about installing WLS 10.0. I’m still using a PPC Mac with not nearly enough RAM, so I thought I would try to see how the 10.0 performance would be compared to my 9.2 experience.

Surprisingly 10.0 is much slower to start up. I appreciate that OS X and Apple’s JVM aren’t a supported platform, but still it took almost 7 minutes for the MedRec sample domain to start up! Under 9.2 it was only 2 minutes. Back when I installed 9.2 Apple’s JVM was 1.5 and I have 1.6 running now.

I wanted to do a fair comparison, but apparently installing 10.0 with Apple’s 1.6 JVM overwrites the PointBase configuration such that 9.2 won’t even start up the MedRec sample domain (incompatible serial uids for javax.xml.namespace.QName if anyone cares). Also Apple says that uninstalling their 1.6 beta is a bad idea?!? I’m sure I could probably clean it up and get it running, but that would exceed my ten minute or so attention span for working on Java stuff at home.