How To Install Oracle Weblogic On Mac And Creating Weblogic Domain

Oracle Weblogic is one of the most widely used application servers. Recently I have installed it on Mac OS system and created a domain. This article is intended to provide the steps for installation and creating a domain and then starting and stopping domain with Terminal. I have set up Oracle Weblogic 10.3.3.0 on my system but I am sure that the setup instructions will work for other versions also.

Prerequisite for Oracle Weblogic Server Installation

  1. Oracle Weblogic setup – You can download it from Oracle website for development purpose.
  2. JDK 6 – Oracle Weblogic 10.3 requires Java 6 and it comes with the default Mac OS system. You can check whether its installed or not. It will be in “/System/Library/Frameworks/JavaVM.framework/Versions/1.6/Home” directory.

Install Oracle Weblogic on Mac OS

Unzip the WebLogic installer in the hard drive. For my installation, I have unzipped it in “/weblogic/wls1033_dev” directory.

Steps to install Weblogic Server and creating a domain

Open Terminal and run the below commands in the sequence mentioned.

$ export JAVA_HOME=/System/Library/Frameworks/JavaVM.framework/Versions/1.6/Home$ export MW_HOME=/weblogic/wls1033_dev$ cd $MW_HOME$ ./configure.sh$ export USER_MEM_ARGS="-Xmx1024m -XX:PermSize=1024m"$ . $MW_HOME/wlserver/server/bin/setWLSEnv.sh (Note that there is a space between . and $)$ mkdir /weblogic/domain1$ cd /weblogic/domain1$ JAVA_HOME/bin/java -Xmx1024m -XX:MaxPermSize=1024m weblogic.Server

The last command will create the domain and then start it with the default configuration. While setup, it will ask for the user and password to login to your domain admin console. After executing all the commands successfully, you can log in to WebLogic server admin console at http://localhost:7001/console with the same user and password.

Your Weblogic server and domain is up and running now. ��

How to install Oracle WebLogic on Mac and Creating WebLogic domain

After that you can start and stop your domain from Terminal with startWebLogic.sh and stopWebLogic.sh scripts found in domain bin directory. But if you will close the Terminal session and then try to execute the commands, it will throw below exception:

Starting WLS with line:/System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Home/bin/java -Xms512m -Xmx512m -Dweblogic.Name=myserver -Djava.security.policy=/wlserver/server/lib/weblogic.policy -da -Dplatform.home=/wlserver -Dwls.home=/wlserver/server -Dweblogic.home=/wlserver/server -Dweblogic.management.discover=true -Dwlw.iterativeDev= -Dwlw.testConsole= -Dwlw.logErrorsToConsole= weblogic.ServerException in thread "main" java.lang.NoClassDefFoundError: weblogic/ServerCaused by: java.lang.ClassNotFoundException: weblogic.Server at java.net.URLClassLoader$1.run(URLClassLoader.java:200) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:188) at java.lang.ClassLoader.loadClass(ClassLoader.java:319) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:330) at java.lang.ClassLoader.loadClass(ClassLoader.java:254) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:399)

Above exception comes because the export command was only for the current Terminal session. To avoid these issues, you can include these in .bash_profile file in your home directory. If you don’t have this file then you can create it and then add below lines.

export JAVA_HOME=/System/Library/Frameworks/JavaVM.framework/Versions/1.6/Homeexport MW_HOME=/weblogic/wls1033_devexport USER_MEM_ARGS="-Xmx1024m -XX:PermSize=1024m"

After that save it and run command source ~/.bash_profile to set these variables. Since these are added in bash profile, it will get exported as system variable as soon as you launch your terminal.

If you found the article useful, please comment and share with others.

  • 61