jueves, marzo 11, 2010

WebLogic Server 11g on Mac OS X

The purpose of this article is to describe the process by which a user can have Oracle WebLogic Server 11g installed and running on a Mac OS X Snow Leopard. First disclaimer: The installation explained bellow is not officially supported by Oracle.

Apple nowadays ships Snow Leopard with Java 6 as the only JVM on Snow Leopard. Fortunately, this is the JVM version supported by Oracle WebLogic Server 11g. But most (if not all) of the native enhancements that WebLogic has for the supported UNIX systems will be lost when installed on an Mac due to lack of the same native libraries.

I have managed to configure a cluster with two nodes and one server instance per node plus the admin server. I have also managed to configure Node Manager so I can start and stop servers from the admin server (or any wlst client). Second disclaimer: this installation is only intended to be a demonstrative exercise and it is not intended as a recommended installation in case of production systems.

Downloading

In order to download WebLogic, go to the next page: Download. Accept the license and select "Oracle WebLogic Server 11gR1 (10.3.2) - Package Installer" Generic (under the Additional Platforms).

Preparing Apple's JVM

By default, WebLogic's installer will not recognize the Java Virtual Machine provided by Apple. As a workaround for this problem, you can create the following resources on your system:

$ cd /System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Home
$ sudo mkdir jre
$ sudo mkdir jre/lib
$ sudo mkdir jre/lib
$ sudo touch jre/lib/rt.jar
$ sudo touch jre/lib/core.jar

Executing Installer

For a successful execution of the installer, you must open the Terminal, go to the directory where the installer is and execute the following command:

java -Dos.name=unix -jar wls1032_generic.jar

Note: If you double click the jar file you have just downloaded, it will complain about the Insufficient disk space! independently of the available space there really is on your system.

The rest of the installation is business as usual, so please refer to other documentation in case of need.

Running the servers

Running the servers should not involve any problems. WebLogic does complain with an error message because of not being able to load performance pack and states that it will be using Java I/O instead. That's just fine for us and our exercise of having it running on a development machine.

Running the Node Manager

The Node Manager as the rest of the components is also unable to use the native enhancements but in this case it does suppose a problem: it won't start. In order to make it work, it is needed to set the NativeVersionEnabled to false. This can be done in two ways, either create a nodemanager.properties file in the domain home directory or set it as an environment variable when starting the java virtual machine.

On the first case, just create the file and write NativeVersionEnabled=false on it as it's only content. Save the file and execute the following commands from the domain home directory:

/wlserver_10.3/server/bin/setWLSEnv.sh
java weblogic.NodeManager

On the second case, just execute:

/wlserver_10.3/server/bin/setWLSEnv.sh
java -DNativeVersionEnabled=false weblogic.NodeManager


I hope you have found this article useful. I personally enjoy very much being able to run J2EE Applications on my Mac laptop using Oracle WebLogic Server.

4 comentarios:

Anónimo dijo...

Hey, I was wondering... did you have any issues where Weblogic would not respond, and had to be killed manually (via Activity Monitor, for instance)? I followed your instructions, and everything seemed to go fine, but once I try to access http://127.0.0.1:7001/console, the server seems to hang.

Thanks in advance!

-Alexandros

eTux dijo...

I didn't have any issues regarding the admin server. The only issues I had had to do with the fact of trying to start 2 managed servers, the admin server and the node manager all together on my mac book (it started swapping due to lack of RAM).

what do the logs say? What JVM version are you using? What are your hardware settings?

SNKR dijo...

I run into issues with starting my servers with nodemanager. It complains of a missing security policy. Have you ever run into this?

eTux dijo...

I don't remember running into this particular problem, can you post your nodemanager logs?