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.

Preparation

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 (wls1211_dev.zip) in /wls12c (yes in the root file system!) .

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

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

# STILL AS ROOT
export JAVA_HOME=<path to your JAVA JDK install>
export MW_HOME=/wls12c
cd /wls12c
./configure.sh
. $MW_HOME/wlserver/server/bin/setWLSEnv.sh
mkdir /wls12c/mydomain
cd /wls12c/mydomain
$JAVA_HOME/bin/java $JAVA_OPTIONS -Xmx1024m -Dweblogic.management.allowPasswordEcho=true 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 wlsvePackage.zip which includes the jrockit virtual edition. Unpack it somewhere, let’s say in /tmp/wlsve

# AS ROOT
mkdir /tmp/wlsve
cd /tmp/wlsve
unzip <path to the zip>/wlsvePackage.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 wlsvePackage.zip 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 “startWeblogic.sh” bash script. We need to “reverse engineer” the Java command to start Weblogic. Basically just see which java command startWeblogic.sh 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="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="jrockitve-imagetool-config.xsd" version="5.1">
  <jrockitve-config memory="1024" cpus="1">
    <storage>
      <disks>
        <disk id="root" size="1024 MB"/>
      </disks>
      <mounts>
        <mount>
          <mount-point>/</mount-point>
          <disk>root</disk>
        </mount>
      </mounts>
    </storage>
    <vm-name>wlsve_12c</vm-name>
    <working-dir>/wls12c/mydomain</working-dir>
    <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.security.policy=/wls12c/wlserver/server/lib/weblogic.policy  -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   -Dweblogic.management.discover=true  -Dwlw.iterativeDev= -Dwlw.testConsole= -Dwlw.logErrorsToConsole=  weblogic.Server</java-arguments>
    <network>
      <nics>
        <nic type="bridged"/>
      </nics>
    </network>
    <locale-data>
      <locale>en_US</locale>
      <timezone>Europe/Amsterdam</timezone>
      <encoding>ISO-8859-1</encoding>
    </locale-data>
  </jrockitve-config>
</jrockitve-imagetool-config>

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:

cd
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

Ratings:
VN:F [1.9.22_1171]
Rating: 5.0/5 (2 votes cast)

3 comments on “Running Weblogic 12c as it is meant to be: in the Cloud

  1. 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?

    VA:F [1.9.22_1171]
    Rating: 0 (from 0 votes)
    • Laurens van der Starre on said:

      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!

      VN:F [1.9.22_1171]
      Rating: 0 (from 0 votes)
      • 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.

        VA:F [1.9.22_1171]
        Rating: 0 (from 0 votes)

Leave a Reply

Your email address will not be published. Required fields are marked *

*

* Copy This Password *

* Type Or Paste Password Here *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

 

Previous post:

Next post:

About Whitehorses
Company profile
Services
Technology

Whitehorses website

Home page
Whitebooks
Jobs

Follow us
Blog post RSS
Comment RSS
Twitter