Follow Us on Twitter

Running Weblogic 12c as it is meant to be: in the Cloud

by Laurens van der Starre on December 10, 2011 · 3 comments

So this Friday the 9th of December we saw the release of Oracle’s next generation application server: Weblogic 12c. Well, at least the development version. It has slimmed down a lot, which is good, and has some nice new features. Installing it is super easy, just follow the instructions from the included README.txt, or read some of the bazillion blog posts about installing this version of Weblogic.

However, do we notice the “c”? Doesn’t this “c” stand for cloud? So let’s do something interesting with it. In this post I’ll show you how to run Weblogic 12c directly on your hypervisor in Oracle VM.


Now let’s create the base package for WLS 12c. For sake of simplicity, we will just create a basic domain. In my examples I assume a Linux system.

Unpack the downloaded ZIP ( in /wls12c (yes in the root file system!) .

#as root
su -
mkdir /wls12
cd /wls12c
unzip <path to your zip>/

Now create a basic domain (“mydomain”). Just follow the included instructions in the README.txt that is included. Basically it boils down to:

export JAVA_HOME=<path to your JAVA JDK install>
export MW_HOME=/wls12c

cd /wls12c
. $MW_HOME/wlserver/server/bin/

mkdir /wls12c/mydomain
cd /wls12c/mydomain

$JAVA_HOME/bin/java $JAVA_OPTIONS -Xmx1024m weblogic.Server

# Follow the instructions and CTRL-C when the server starts

So, now we have a basic domain. Let’s continue with JRockit VE. The following instructions will look a lot like a previous blog post by yours truly.

Get the which includes the jrockit virtual edition. Unpack it somewhere, let’s say in /tmp/wlsve

mkdir /tmp/wlsve
cd /tmp/wlsve
unzip <path to the zip>/

Now get the config of this JRockitVE image, we will need it later:

# In /tmp/wlsve
$JAVA_HOME/bin/java -jar wlsveimagetool.jar -r ./wlsve/vm.cfg get config config.xml

The comes with the Weblogic 11g (10.3.2). We don’t what that version, so we are going to remove it. We are only interested in the Jrockit virtual edition. Therefore, we will first mount the image:

# If the mount directory doesn't exist:
mkdir /mnt/sysimg

mount -o loop=/dev/loop0 /tmp/wlsve/wlsve/system.img /mnt/sysimg

Get rid of the “old” version of Weblogic by removing the application directory:

rm -rf /mnt/sysimg/application

Now copy the fresh and new 12c version to the VM’s root:

mkdir /mnt/sysimg/wls12c
cd /mnt/sysimg/wls12c
cp -R /wls12c/* .

And this is why we created the domain in de root “/” directory: it will become the root in the VM image. Basically I’m just lazy here 😉

Now for the hardest part. the Jrockit VE will not start the WLS domain by running the well known “” bash script. We need to “reverse engineer” the Java command to start Weblogic. Basically just see which java command creates and add the classpath (-cp) to it. We have to put this command in the config.xml we’ve created earlier with the wlsveimagetool.jar.

With this, the config.xml will be:

<?xml version="1.0" encoding="UTF-8"?>
<jrockitve-imagetool-config xmlns:xsi="" xsi:noNamespaceSchemaLocation="jrockitve-imagetool-config.xsd" version="5.1">
  <jrockitve-config memory="1024" cpus="1">
        <disk id="root" size="1024 MB"/>
    <java-arguments> -cp $JAVA_HOME/lib/tools.jar:/wls12c/wlserver/server/lib/weblogic_sp.jar:/wls12c/wlserver/server/lib/weblogic.jar:/wls12c/modules/features/weblogic.server.modules_12.1.1.0.jar:/wls12c/wlserver/server/lib/webservices.jar:/wls12c/modules/org.apache.ant_1.7.1/lib/ant-all.jar:/wls12c/modules/net.sf.antcontrib_1.1.0.0_1-0b2/lib/ant-contrib.jar -Xms512m -Xmx512m -Dweblogic.Name=myserver  -Djava.endorsed.dirs=/root/oracle/jrockit/jre/lib/endorsed:/wls12c/wlserver/endorsed -Xverify:none -Djava.endorsed.dirs=$JAVA_HOME/jre/lib/endorsed:/wls12c/wlserver/endorsed  -da -Dplatform.home=/wls12c/wlserver -Dwls.home=/wls12c/wlserver/server -Dweblogic.home=/wls12c/wlserver/server  -Dwlw.iterativeDev= -Dwlw.testConsole= -Dwlw.logErrorsToConsole=  weblogic.Server</java-arguments>
        <nic type="bridged"/>

Note that the working-dir has to be the domain directory. “/wls12c/mydomain” in our case. Also note the memory settings of the jrockitve-config/@memory: make this memory setting at least 256MB higher as the -Xmx you’ve set in the Java options. (In my example I’m being generous 😉 ). If you give it less, the garbase collector will crash with an out of memory error.

Ok, now we’re done with the image. Unmount it:

umount /mnt/sysimg

Let’s insert the config we’ve created earlier.

cd /tmp/wlsve
$JAVA_HOME/bin/java -jar wlsveimagetool.jar -r ./wlsve/vm.cfg set config config.xml

Et voila! Now we have our base VM image for in the cloud. Copy the vm.cfg and the system.img to your Oracle VM Server. Remember to edit the vm.cfg to reflect the actual path on the /OVS !

You can run the VM by issuing the following command as root on dom0:

xm create -c vm.cfg

So now what?

By packaging this base (or some other more elaborate) domain we have just created, and maybe scripting the config settings using the wlsveimagetool, you can supply your organisation with an application server within minutes, all running on your own Oracle VM cloud clusters. I guess this is what Oracle themselves do with their Java Public Cloud service.

Running Weblogic 12c as it is meant to be: in the Cloud, 5.0 out of 5 based on 2 ratings
VN:F [1.9.22_1171]
Rating: 5.0/5 (2 votes cast)

{ 3 comments… read them below or add one }

Jacco H. Landlust December 11, 2011 at 9:28 pm

Didn’t you notice that Oracle makes absolutely no noise about VE anymore? No VE in any exa product and no updates in the last year or two. Why would that be?


Laurens van der Starre December 11, 2011 at 9:40 pm

I know. It’s a shame. It is a great way to run your Java applications on the Hypervisor. It has little to no overhead memory wise, and is fast as lightning… But I still like it though!


Jacco H. Landlust December 11, 2011 at 9:59 pm

I heard that there are zero paying customers for VE, which would explain why Oracle is stopping development on the product. Also AFAIK no updated (Java 7) version. If the new version of OVAB doesn’t support VE it’s done.


Leave a Comment


Previous post:

Next post:

About Whitehorses
Company profile

Whitehorses website

Home page

Follow us
Blog post RSS
Comment RSS