there's more and more development being done on top of Mac OS X. and PowerBooks (esp. the new 15" model) are rapidly becoming the laptop of choice for alpha-geeks everywhere. so i thought i'd take advantage of the trailblazing work done by Sam Pullara here at BEA, who has been doing his dev work on a PowerBook for over a year now. he had to write some code to support this, but using what he's built you should be able to run WLS on your Mac. i've taken his binaries and some rather terse notes <g>, along with many IM sessions, and turned them into this post
i've only verified that this works under the latest version of Mac OS X, codename Panther. while i haven't verified it myself, Sam tells me that it runs just as well under the previous version, codename Jaguar
next, a disclaimer: running WLS on Mac OS X is not supported by BEA. Sam, myself and others using Apple hardware here at BEA will try and support you (answer questions, potentially patch things, etc) but this is would be totally ad-hoc. if you want BEA to make this a supported (at least for development) platform, please let Andrew Littlefield or myself know. since the decision would really start with Andrew, he's the guy you should contact. don't be shy <g>
all right, let's do this. the first thing you need to do is check and make sure your Java environment is working properly. for example, after upgrading to Panther, mine wasn't. it turns out that the Panther upgrade process can hose your Java environment depending whether you've installed a particular patch. since i had this patch on my machine, i got nailed
to test your system, open a terminal window and type "java -version". if you see "HotSpot not at correct virtual address. Sharing disabled.", your system has been hosed. to fix your system, follow the instructions in this Technical Note from Apple
once you know the Java environment is running properly on your machine it's time to go get WLS. start at the following link. it gets you most of the way through BEA's dev2dev site, but there are still a few things you need to do manually:
IBM AIX (5.1, 5.2, 32 bit)" and then
click on the "Select >>" button to the right of the drop-downnow you need to download this ZIP file, which contains several files to automate the rest of the install and setup process. save the ZIP alongside the JAR you downloaded from BEA, then do the following:
unzip wls4mac.zip cd wls4mac
./wlsInstall
cd /bea/user_projects/domains/wls/ ./startWebLogic.sh
but that's not the end of our little journey here. there's a few things we can do to make things better. first off, notice that WLS is listening for HTTP requests on port 7001. that's ok if all you're doing is development, but if you want someone within your workgroup or department to access your content, it sure would be nice if they could hit WLS on port 80. and there's a way to make that work, using the version of Apache that's built into Mac OS X by default. essentially, Apache can be made to forward a subset of its URI space. if you want to do this, here's the recipe:
sudo cp lib/mod_weblogic.so /usr/libexec/httpd sudo cp weblogic.conf /etc/httpd/users
sudo apachectl restart
at some point down the road if/when Mac OS X becomes a supported platform for WebLogic Server, you'll be able to run it on port 80 without going through Apache. but as Sam pointed out to me in an IM session the other day, this may not actually be an improvement, since one of the key reasons Apache is in Mac OS X is to support user file sharing. so it helps to have Apache on port 80 and just forward when you want it too. oh well, these details can be worked out later. but if you have an opinion about this, please let us know
now that we're up and running, and available via port 80, how about we try to make things a bit faster, hmmmm? if this is interesting to you, it turns out that Sam has just the thing. he ported some of the native-io and terminal-io code that WLS has for optimizing performance on different platforms. it's not required, and if all you're doing is development, you might not want to bother with this. but if you want to squeeze a little more out of WLS on Mac OS X, add the JNI libraries in the ZIP file to your library path
the JNI libraries are the files in the lib directory of the ZIP file with the file extension '.jnilib'. so first, decide where you want these files to live. we'll call that directory $WLS_JNI. then add that directory to your library path by running one of the following commands. if you're using csh, then do this:
setenv DYLD_LIBRARY_PATH $DYLD_LIBRARY_PATH:$WLS_JNIif you're using bash, do this:
export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:$WLS_JNIit should go without saying, but i'll say it anyway <g>, you need to replace the $WLS_JNI in the above commands with the full path to wherever you decided to put the JNI libraries
well, that about wraps things up, with one remaining issue, which is browser support. unfortunately, the WLS console does not do well with the browsers that ship on Mac OS X. on Safari, things don't work at all. on IE, it's useable, but the left-hand-pane where a java-applet is supposed to be just shows an error. all the functionality is available in the main area, but navigation is clunky. again, i'm just talking about the WLS management console. your app and its content will be just peachy
my focus in this post has been WebLogic Server 8.1, but i've been asked by several people about running WebLogic Workshop 8.1 on Mac OS X. there are a couple of developers who've run it here at BEA, and think things should be ok. but since i haven't done that myself, i can't verify it. if you have any problems with WLW, please let us know. again, since Mac OS X isn't a supported platform, turnaround on issues will be longer. but we'll do what we can
Rod Chavez has been building systems software for more then 15 years. He spent the first half of the 90's working for Borland, and the last half for Microsoft, before leaving gainful employment to start Crossgain (co-founded with Adam Bosworth) in 2000, which was then purchased by BEA Systems in in the summer of 2001.
oreillynet.com Copyright © 2006 O'Reilly Media, Inc.