Review of Weblogic scripting languages wlst (Jython based) vs wlsh ( WLS shell)

Both are tools to programmatically and easily configure Weblogic domains and servers. Why these tools?

  • to automate Weblogic servers and domain creation for large scale production environment. Configuring a Weblogic domain through the administration console is tedious and slow in a multiserver environment.
  • Repeat a complex configuration from server to server.

Well, you could use Java and JMX or do some reverse engineeringon some Weblogic class (like domain creation) but it would reallybe a waste of time, when tools exist to make domain administration easier.

wlst

Pros:

  • Jython (Python Implementation in Java) based powerful Object Oriented scripting language. You can create your own classes like creating a Security classes to add a user,a group return all the users of a domain…
  • Offline capabilites to create and configure domains.
  • Has functions for Weblogic Workshop.

    Cons:

  • Learning curve of Jython/Python for more advanced coding logic.( But I have to admit that Python is easy to learn).
  • type conversion between Java and python which can be annoying. Example:

objs = jarray.array([appname,None,None],java.lang.Object)

  • Some MBeans are hidden. Example: can not invoke methods on the DeployerRuntime MBean like the invoke method. Maybe authors want users to use the dedicated deployment functions like deploy() undeploy() instead.
  • Can only use a property file to pass parameters to the script (but you could import the wlst jython module and process jython command line arguments the traditionnal way)

wlsh

Pros

  • Easy to learn very much like Unix SHELL.
  • Aditionnal tools: provide a graphical MBean (and cli) explorer + a graphical monitoring tool.
  • Can pass any kind of parameter to the script from the command line.

    Cons:

  • Not officially supported by BEA. Some bugs exist “it returns null when trying to get some MBean”. But the author said a new version will be released for Weblogic server 9.
  • Limited scripting capabilities. Language is limited (with limited control structures)

To conclude, both are not really mature tools and have some light bugs but they greatly help in Weblogic configuration tasks. I don’t know if Websphere or Oracle9iAS have this kind of tool but they represent a great advantage for Weblogic. Especially for ISVs who want to help clients to configure a Weblogic server to run their application.

Both tools can also convert an existing domain configuration (config.xml) to a script which is a very helpful feature. I think that for advanced Weblogic administration scripting wlst looks better (I chose to use it now). On the other side some features of wlsh like the MBean explorer, the graphical MBean attributes monitoring are really great. Porting wlst to Groovy scripting language ( Java based scripting language with a JSR) would also have been a great idea since it would avoid to learn another language (i.e python) but just the syntax of Groovy.

Boost Eclipse performance under Windows

There’s an excellent Eclipse plug-in to prevent Windows from swapping to disk the memoryallocated to the Eclipse’s JVM.

The keepresident plug-in really improved Eclipse overall performance.

Sometimes Eclipse3 used to freeze for 10-20 seconds.Even after tweaking the JVM options (-XX:+UseParallelGC -Xms512m -Xmx512m -XX:MaxPermSize=96M on a 1Gbytes machine), it was still freezing randomly. I thought it was the GC on my mono-processor machine which was causing a “stop the world “ for all other threads (i didn’t trace it with the -verbose:gc). But actually, it seems that Windows was involved and deeply deteriorated the performance of Garbage Collection by swapping to disk even when there was still free physical memory ( like when the Eclipse Window is minimized). Now Eclipse is really fast !

Congratulations to the plug-in’s author

Weblogic ant tasks

For having worked with many of the Weblogic ant tasks,it's really a pain to make them work with a standard ant(i.e: not the one bundled with Weblogic).

I work under Eclipse 3 with ant 1.6 and do some integration work of J2EE applications. Some of the Weblogic ant tasks like source2wsdd or wlappc just don't work without Weblogic's ant. wlappc was supposed to be fixed with sp3 but it still doesn't work properly. The workarounds to make these tasks work are:

  • find the matching administration class and load the class with the “java” task
  • create dynamically a command/shell script that will invoke the task withWeblogic's ant !
    Also, I tried the WLST scripting tool based on Jython. Of course calling itfrom the Weblogic 's ant works fine but with a standard one it doesn't(even with Classpath set properly :-) ).

That's why I decided to stick to wlsh( Weblogic shell: http://www.wlshell.com)which worked pretty well for me but is not officially supported by BEA (and have limited scripting capabilites compared to Jython).

Update: actually wlst can be invoked from ant when the fork option of the “java” task is set to true. But my complaints about the Weblogic ant tasks just remain.

I think BEA guys should really test these ant tasks and administration tools with a vanilla ant. And generally, they should improve the quality of them, some have very limited features compared to the CLI tools and even some of the implementedfeatures are broken !

P.S: Next time I'll try to post technical stuff instead of complaining …