Extending WebLogic Virtual Edition for ADF

WebLogic virtual edition, or rather, WebLogic on top of JRockit VE is an amazing technology. It makes operating system in virtualized environment obsolete.

Forget about setting up latest OS version, patches, drivers, packages, firewall, anti-virus. Forget about configuring OS for application server. In short, forget about managing OS all together.

With JRockit VE, managing OS is the thing of the past.

How is it used

You deploy a file based file system onto Oracle VM server, type
xm create -c vm.cfg
and you are good to go.

How to get it running – step by step

  1.  Download and install Oracle VM
    Don’t worry, If you don’t have a server available, you can actually install Oracle VM inside VirtualBox! I’m not sure which settings are required, but I have:
    - System/Motherboard/Enable IO APIC = yes
    - System/Processor/Enable PAE/NX = no
    - System/Acceleration/Enable VT-x/AMD-V = yes
    - System/Acceleration/Enable Enable Nested Paging = yes
    There’s nothing special regarding Oracle VM installation, you can use default settings.
    OracleVM inside Oracle VirtualBox
  2. Download WebLogic with JRockit VE
    Unpack the zip somewhere on your disk. You’ll find a folder wlsvePackage with a wlsveimagetool.jar tool and wlsve folder with the actual disk image and  config file for the virtual machine.
  3. If you don’t have it, also download and install Java runtime
  4. Prepare machine to run with default domain
    - Open command line / terminal and go to the wlsvePackage folder where you unpacked the WebLogic VE and run
    java -jar wlsveimagetool.jar -r ./wlsve/vm.cfg get config wlsve.xml
    to extract default WebLogic configuration from the system.img file
    - open the wlsve.xml file with your favorite editor and change the java-arguments element to -cp $JAVA_HOME/lib/tools.jar:/jrockitve/lib/common.jar:/application/patch_wls1032/profiles/default/sys_manifest_classpath/weblogic_patch.jar:/application/wlserver_10.3/server/lib/weblogic.jar -Dweblogic.Name=WlsveAdmin -Dweblogic.Domain=wlsve_domain -Dweblogic.management.username=weblogic -Dweblogic.management.password=weblogic1 -Dweblogic.management.GenerateDefaultConfig=true weblogic.Server This config will create the default wlsve_domain. Without the Dweblogic.management.GenerateDefaultConfig=true option, the domain isn’t found and it won’t work.
  5. Write the config back to the virtual machine with java -jar wlsveimagetool.jar -r ./wlsve/vm.cfg set config wlsve.xml
  6. Transfer server.img and vm.cfg from ./wlsve folder to the Oracle VM
    You can either use ssh file transfer or copy the image to USB drive and connect and mount usb drive to the virtual machine.
    - Make sure you copy system.img and vm.cfg to the /OVS/seed_pool/wlsve_domain_WlsveAdmin/ folder on the Oracle VM server as this is the location specified in vm.cfg by default.
  7. Start virtual machine with xm create -c vm.cfg
Booting JRockit VE

With this configuration you will create a new weblogic domain and run it. You can connect to console and deploy standard Java EE applications, but not ADF, since the bundled WebLogic is not extended for ADF.

Extending WebLogic Virtual Edition for ADF

For this step you absolutely need linux. If you don’t have it, I suggest downloading Ubuntu and installing it into VirtualBox virtual machine.

Why linux? It turns out that system.img is file-based file system, and that’s what we are going to exploit*.

  1. Start with a fresh system.img and wlsve.xml. Unpack the system.img again if you made the above changes
  2. Open command line / terminal and go to the wlsvePackage folder where you unpacked the WebLogic VE and run java -jar wlsveimagetool.jar -r ./wlsve/vm.cfg get config wlsve.xml
  3. Replace wlsve.xml with

    /
    root

    wlsve
    /application/user_projects/domains/wlsve_domain
    -cp /application/patch_wls1032/profiles/default/sys_manifest_classpath/weblogic_patch.jar:/jrockitve/jrockit/jre/lib/tools.jar:/application/utils/config/10.3/config-launch.jar:/application/wlserver_10.3/server/lib/weblogic_sp.jar:/application/wlserver_10.3/server/lib/weblogic.jar:/application/modules/features/weblogic.server.modules_10.3.2.0.jar:/application/wlserver_10.3/server/lib/webservices.jar:/application/modules/org.apache.ant_1.7.0/lib/ant-all.jar:/application/modules/net.sf.antcontrib_1.0.0.0_1-0b2/lib/ant-contrib.jar:/application/oracle_common/modules/oracle.jrf_11.1.1/jrf.jar:/application/wlserver_10.3/common/eval/pointbase/lib/pbclient57.jar:/application/wlserver_10.3/server/lib/xqrl.jar -Dweblogic.Name=AdminServer -Djava.security.policy=/application/wlserver_10.3/server/lib/weblogic.policy -Xverify:none -da -Dplatform.home=/application/wlserver_10.3 -Dwls.home=/application/wlserver_10.3/server -Dweblogic.home=/application/wlserver_10.3/server -Ddomain.home=/application/user_projects/domains/wlsve_domain -Dcommon.components.home=/application/oracle_common -Djrf.version=11.1.1 -Dorg.apache.commons.logging.Log=org.apache.commons.logging.impl.Jdk14Logger -Djrockit.optfile=/application/oracle_common/modules/oracle.jrf_11.1.1/jrocket_optfile.txt -Doracle.domain.config.dir=/application/user_projects/domains/wlsve_domain/config/fmwconfig -Doracle.server.config.dir=/application/user_projects/domains/wlsve_domain/config/fmwconfig/servers/AdminServer -Doracle.security.jps.config=/application/user_projects/domains/wlsve_domain/config/fmwconfig/jps-config.xml -Djava.protocol.handler.pkgs=oracle.mds.net.protocol -Digf.arisidbeans.carmlloc=/application/user_projects/domains/wlsve_domain/config/fmwconfig/carml -Digf.arisidstack.home=/application/user_projects/domains/wlsve_domain/config/fmwconfig/arisidprovider -Dweblogic.alternateTypesDirectory=/modules/oracle.ossoiap_11.1.1,/modules/oracle.oamprovider_11.1.1 -Dweblogic.jdbc.remoteEnabled=false -Dweblogic.management.discover=true -Dwlw.iterativeDev= -Dwlw.testConsole= -Dwlw.logErrorsToConsole= -Dweblogic.ext.dirs=/application/patch_wls1032/profiles/default/sysext_manifest_classpath weblogic.Server

    en_US
    America/New_York
    ISO-8859-1

  4. run java -jar wlsveimagetool.jar -r ./wlsve/vm.cfg set config wlsve.xmlto write the changes to the system.img. This will:
    - enlarge the disk size to 3GB
    - run WebLogic with all the ADF libraries once we install them
  5. If you use linux on VirtualBox, I suggest sharing your windows folder where you unpacked WebLogic with shared folders feature. You need to install vbox additions for it to work properly.
    - Share the folder, open terminal and mount it withsudo mount -w -t vboxsf share_name /media/oracle/ where share_name is the name of your vbox shared folder and oracle is your mount point inside /media
  6. cd to wlsve folder with system.img file and check and resize the filesystem in the image file sudo e2fsck -f ./system.img
    sudo resize2fs ./system.img
  7. Mount the file system with sudo mount -o loop=/dev/loop0 ./system.img /media/wlsve.img/ where wlsve.img is your mount point
  8. Since we can only extend the domain as non-root user, we need to change permissions on the filesystem sudo chown -R jernej /media/wlsve.img/ jernej is your linux username. To my knowledge this is harmless, as it seems permissions are not used by JRockitVM at all (of course, there is no OS to handle security, remember).
  9. I found no easy way of extending the mounted WebLogic home. Symbolic link doesn’t work since installer writes the whole path with /media/wlsve.img. The easiest seem to be copying home to the /, extend it, create domain and copy it back
    - Copy weblogic home to root folder sudo cp -R /media/wlsve.img/application /application
    sudo chown -R user /application 

    - Copy jrockit home to root folder to simulate runtime environment sudo cp -R /media/wlsve.img/jrockitve /jrockitve
    sudo chown -R user /jrockitve
  10. Now download and run Application Development Runtime (11.1.1.2.0) . Note that the bundled WebLogic does not support 11.1.1.3 runtime.
    - When installing the runtime, make sure you chose /application as your WebLogic home
  11. Execute the domain configuration wizard sudo chmod +x /application/wlserver_10.3/common/bin/config.sh
    /application/wlserver_10.3/common/bin/config.sh

    - Create a new domain called wlsve_domain inside /application/user_projects/domains
    - When choosig JRE, make sure you select the one under /jrockitve
  12. Move your local copy of the domain back to the system.img rm -rf /media/wlsve.img/application
    cp -R /application /media/wlsve.img/application
  13. Unmount the image file sudo umount /media/wlsve.img
  14. Copy system.img to Oracle VM, and start the domain
If everything is OK, your ADF-extended domain should be up and running inside JRockitVM! How cool is that!

*The documentation suggests a bit different approach, but I found this the easiest way of doing it.

One Response to “Extending WebLogic Virtual Edition for ADF”

  1. asmol says:

    Hi Jernej

    I liked your post very much.
    I am ex_Oracle consultant with IDM experience and found it very useful.
    It is lighting fast, I was able to
    create machine, use external LDAP for auth/authz and many other things.
    Its fantastic.
    my next POC create cluster of 3 virtual machines and try to install latest 11g SOA

    Thank you and keep up the good posts

    Cheers

    Toly

Click on a tab to select how you'd like to leave your comment

Leave a Reply

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