Thursday Jan 23, 2014

Future-Proof Your Applications

Ever wonder why it makes sense to consolidate your application infrastructure on WebLogic?

The reasons are many. Firstly, WebLogic is Oracle’s strategic application server. Consolidating on the latest release provides better runtime capabilities and increased efficiency. WebLogic has one of the industry's best [if not the best] backward compatibility. Because thousands of customers have done it and they have been successful and in the process the kinks in the process have been ironed out......

Packed with customer success stories, this e-book provides insights, proof points, and best practices for you to drive the transition. Learn from many other WebLogic and Oracle iAS customers why it makes sense to consolidate on the latest WebLogic release, whether you are operating a traditional data center or transforming it to the cloud.

Register and download this ebook now!

Friday Aug 30, 2013

Introducing Elastic JMS

In WebLogic 12.1.2, we enhanced the way that you can configure JMS servers, stores, and subdeployments so that the JMS subsystem can automatically scale with the Managed Servers in a cluster. We call this Elastic JMS. My friend Maciej Gruszka calls it Magic JMS!

 Here are some details:

JMS Servers: In releases before WebLogic Server 12.1.2, each JMS Server was individually configured and targeted at a single Managed Server. It didn’t matter whether or not that Managed Server was part of a cluster. Starting in WebLogic Server 12.1.2, you can target a JMS Server at a cluster. Under the covers, WebLogic spins up a JMS Server on each managed server in the cluster. If you add or remove servers from the cluster, JMS Servers are added or removed automatically.

WebLogic Persistent Stores: Like JMS Servers, in releases before WebLogic Server 12.1.2, each WebLogic Persistent Store (file store or JDBC store) was individually configured and targeted to a single Managed Server, clustered or not. In WebLogic Server 12.1.2, you can target a WebLogic Persistent Store at a cluster. Under the covers, WebLogic creates a store instance on each Managed Server in the cluster. Each instance of a file store uses the same path to either a shared file system or to a local file. Each instance of a JDBC store uses the same JDBC data source, but gets its own underlying tables.

Subdeployments: A subdeployment defines the list of JMS Servers that will host a queue or topic. In releases before WebLogic Server 12.1.2, when you defined a subdeployment for a distributed queue or topic, you listed each JMS Server in the cluster. When you scaled up the cluster by adding a Managed Server and a corresponding JMS Server, you also needed to update the subdeployment with the new JMS Server. Starting in WebLogic Server 12.1.2, subdeployments are much simpler. You can list a single JMS Server that is targeted at the cluster. When you scale up the cluster, the distributed queue is automatically extended to the new JMS Server instance without any changes to the subdeployment.

Pulling it all together: By using cluster targeted JMS Servers and Persistent Stores, you get some nice benefits:

  • Simplified configuration – Even initial JMS configuration is much simpler than it was in the past: no need for individually configured JMS Servers and related items.
  • Elastic scalability – As you scale the cluster, the JMS services automatically scale with it. 
  • Support for Dynamic Clusters – Because Dynamic Clusters require homogenous targeting of services, the new configuration options make it possible to run JMS on Dynamic Clusters. 

  • Check out the documentation at or see my video at for more details.

    Friday May 17, 2013

    Troubleshooting Tools Part 3 - Heap Dumps

    A Heap Dump is a snapshot of the Java process heap memory at a given time.  It's a useful tool to troubleshoot memory leaks and other memory related issues.  Heap dumps are to memory what thread dumps are to java threads.

    There are different ways to dump the java heap used by a Java application such as WebLogic Server.  Heap dumps can be triggered automatically by JVMs such as HotSpot or JRockit when an OutOfMemory event occurs.


    java -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=D:\myApp\hprof-dumps myApp  

    This command will generate a heap dump file in the defined heap dump directory when an OOM is thrown.  

    The file will be in HPROF binary format (*.hprof).  If no path is defined the file will be created in the directory from which the java process was launched.  The format of the file with JRockit is jrockit_pid,hprof, pid being the process ID of this JVM instance.  With HotSpot the format of the file will be java_pidpid.hprof.


    java.lang.OutOfMemoryError: Java heap space

    Dumping heap to D:\java_pid4148.hprof ...

    Heap dump file created [24921731 bytes in 1.400 secs]

    For WebLogic Server these properties, HeapDumpOnOutOfMemoryError and HeapDumpPath (optional), can be added directly to the startup script that contain the Java command that launches WLS.  On Windows the script (with default name startWebLogic.cmd) lives in the domain bin directory and the parameters can be directly added to the existing JAVA_OPTIONS.

    With a JRockit VM process the following command can also be used to generate a heap dump.


    jrcmd pid hprofdump filename=name_of_dump_file

    However if you are using this command against a non JRockit process the following error will come up: Command failed in target VM

    You can also manually generate a heap dump with tools such as jmap or VisualVM.


    jmap -heap:live,format=b,file=filename pid

    This command will generate a heap dump file in binary format and will only count live objects (the live option is optional). Live objects are used by applications and generally reside in the Young Generation part of the heap.

    As illustrated in the screenshot below, generating a heap dump with VisualVM is very simple.  VisualVM is shipped as part of the HotSpot JVM  (/bin/jvisualvm.exe).  However, VisualVM can connect to java processes that started with other JVM such as JRockit.

    Once generated, the heap dump will be parsed as shown below:

    VisualVM enables you to browse heap dumps as shown above with the Classes view where you can easily identify the number and percentage of instances referred by each class.

    jhat can also be used to analyze heap dump files.


    jhat dumpfile

    Reading from dumpfile...
    Dump file created Fri May 17 15:25:41 PDT 2013
    Snapshot read, resolving...
    Resolving 580390 objects...
    Chasing references, expect 116 dots.............................................
    Eliminating duplicate references................................................
    Snapshot resolved.
    Started HTTP server on port 7000
    Server is ready.

    Then you can open http://localhost:7000/ to navigate through the content of the dump file to identify objects with high number of occurrences.

    Finally, as shown below, the OpenSource Eclipse MAT offers a very rich GUI that includes histograms and leak hunter actions, overview and leak suspect reports and much more.

    Previous posts on troubleshooting tools:

    Troubleshooting Tools Part 1 - VisualVM

    Troubleshooting Tools Part 2 - jstack

    Tuesday Feb 05, 2013

    Troubleshooting Tools Part 2 - jstack

    In my latest blog post I talked about VisualVM, a very effective monitoring and troubleshooting tool.  Many other easy-to-use and free tools can be used while working with Java SE.  First of all, and since there is no need to re-invent the wheel, you can access documentation of such tools for Windows at Quick Troubleshooting Tips on Windows for Java SE 6 and for Solaris and Linux at Troubleshooting Tools on Solaris OS and Linux for Java SE 6

    These tools include jstack, jinfo, jconsole, jmap, jstat, jhat and a few others.

    jstack can be use to dump the java threads.  While working with WebLogic Server, you can dump the java threads with various tools such as WLST.  jstack can do just that but differs from <ctrl>+<break> or kill -3 since it doesn't dump a heap summary along with the threads.  

    In addition, jstack can print lock information with -l option and the list of synchronizers that may be exclusively owned by a thread.  Such information can be very useful while monitoring concurrent access by threads.

    jstack comes as part of the JDK installed with WebLogic Server.  With instances of WLS running, you can open a new shell, execute the setDomain script and run jstack or any tool that's part of the JDK package. Thread dumps taken by jstack can be redirected to files, e.g. jstack <pid> > myTD.txt.

    PIDs can be obtained on Solaris/Linux with the ps (report process status) command, e.g. ps -ef | grep java, and from the task managed on Windows.  In task manager you might need to go to View and Select Columns to add PID or process identifiers.

    Friday Jan 18, 2013

    Troubleshooting Tools Part 1 - VisualVM

    A variety of free troubleshooting and debugging tools exist but which ones are really useful when analyzing issues with WebLogic Server?  In this new blog post series, I will talk about some of the best tools that are available, easy to use, free, and very effective in identifying a bunch of issues.  In this first post I will cover VisualVM.

    VisualVM most recent version, or 1.3.5, was released on 11/13/2012.  This tool consists of an user-friendly visual interface for monitoring running JVMs.  Multiple instances of WLS or Java can be monitored at the same time by just connecting to running local or remote JVMs.  VisualVM needs to run on Oracle Sun JDK 6+, the JDK, not the JRE. VisualVM can be started as follow to specify the JDK to run it it on.

    visualvm --jdkhome "JDK_location", or visualvm --jdkhome "d:\jdk160_24"

    Alternatively, /etc/visualvm.conf can be modified to specify a desired JDK.  After launch, the list of local running Java instances will be displayed on the left panel under applications.  In Remote, you can define the host of other running Java instances.  By selecting a running server and clicking on open, you should get a screen similar to the following:

    In Start Page, online documentation of VisualVM can be easily accessed.  Tags next to Start Page are specific to open JVM instances.  In my case, you will find a Weblogic Server instance with its process id (pid).

    Underneath, Overview reports all JVM settings as well as many system properties including Weblogic specific properties.

    Monitor gives access to realtime monitoring of CPU, Heap, Classes and Threads.  You can also force a garbage collection (GC) or issue a heap dump for further analysis.

    Threads reports all threads activity in realtime but also allows to take thread dumps.  All thread dumps will be attached to the relevant application process on the left panel and saved in C:\Users\<user_name>\AppData\Local\Temp\visualvm.dat.  Example: C:\Users\lgoldszt\AppData\Local\Temp\visualvm.dat\localhost_6352\threaddump-1358534350679.tdump.  Thread dumps can be further diagnosed with ThreadLogic.

    In Samplers, you can record CPU or memory usage activity.  This is neat to debug potential memory leak and high CPU usage threads.

    Finally, Profiler allows to identify where most of the time is being spent and which objects consume most of the memory.

    Snapshots of memory can be taken and compared with others, see File - Compare Memory Snapshots.  

    Also VisualVM comes with a bunch of easy to install plugins as you can see below:

    VisualVM doesn't have an MBeans tab like JConsole.  However, this can be very easily changed by installing the available VisualVM-MBeans plugin.  

    With its extensive features, especially including those offered by individual plugin, VisualVM is the tool of choice and combine characteristics of tools such as JConsole, jstat, jmap, or jstack.

    Among other choices, the download page gives you the opportunity to use the VisualVM Eclipse launcher plugin.

    For further information and demos please visit VisualVM demo and features

    Thursday Dec 22, 2011

    WebLogic Server Midweek Update December 22, 2011

    Hi Everyone. A few WebLogic Server notes and events that you don't want to miss! Happy Reading and Happy Holidays!

    Unveiling Oracle WebLogic Server 12c

    Oracle WebLogic Server 12c is cloud-ready and optimized for modern, lightweight Java EE 6 Full Profile Development. Download and unzip the 168mb distro and go, no installer! Check out the launch event replay, which includes a developer-focused deep-dive session, for details.


    Launch Event Replay:

    Virtual Developer Day: Oracle WebLogic Suite 12c (Jan. 24, 2012)

    In this virtual workshop, Java developers and architects can learn how to use Java EE 6, Oracle WebLogic Server 12c, Oracle Coherence, Oracle Enterprise Pack for Eclipse, NetBeans, Maven and Hudson in hands-on labs and sessions while interacting with Oracle product experts in live moderated chats. Learn more about the event, or register now!

    Learn More:

    Register Now:

    WebLogic Devcast Webinar Series (Jan 12, 2012 10:00am PT)

    Introducing a new, monthly webinar series focused on Oracle WebLogic Server 12c and Java EE 6! The first webinar, "Developing a Data Access Layer with JPA" is now open for registration. The February webinar will be replaced with the OTN Virtual Developer Day: WebLogic Suite 12c, and then we will resume a monthly cadence in March.

    Learn More:


    The official blog for Oracle WebLogic Server fans and followers!

    Stay Connected


    « April 2014