Wednesday, February 27, 2008

Installing BEA WebLogic on Mac OS X

WebLogic Server is not supported on Mac OS X, but you can still run WebLogic on Mac OS X and here is how. (Of course I wouldn't doing this in production, but doing this in development should be fine.)

  1. Download WebLogic Server listed in the Package Installer section. In the Select OS drop-down, choose IBM AIX. This will give you the WebLogic generic package.
  2. From the command line, run: java -Dos.name=unix -jar server922_generic.jar. Follow the wizard to complete the installation.
  3. Edit the file ~/bea/weblogic92/samples/domains/wl_server/bin/setDomainEnv.sh look for the line where the MEM_ARGS environment variable is set. Add this declaration: -XX:MaxPermSize=128m.
  4. Start WebLogic: ~/bea/weblogic92/samples/domains/wl_server/bin/startWebLogic.sh. Once the server is started you will see the following message on the console: Server started in RUNNING mode.
  5. Access your instance of WebLogic at http://localhost:7001/. You should see the WebLogic "getting started" page.
To deploy a web application (war file):
  1. Uncompress the war file in the directory where you would like the application to be deployed.
  2. Go to the WebLogic Administration Console from http://localhost:7001/console/. The default login/password is weblogic/weblogic.
  3. Click the Lock & Edit button (top left).
  4. Under Deployments select Install.
  5. Select the directory you created in #1. Two screens later, under Source accessibility, make sure you select the radio button I will make the deployment accessible from the following location. This way WebLogic won't copy your web application to its own private directory but will instead use directly the files in the directory you mentioned.
  6. Finish the deployment, save. Under Deployments, start the application.
  7. Access your application from http://localhost:7001/orbeon/, if orbeon was the name the directory you choose in step #5.
Once your application is running, you might want to monitor the following log files:
  • ~bea/weblogic92/samples/domains/wl_server/servers/examplesServer/logs/examplesServer.log - The main WebLogic log file.
  • bea/weblogic92/samples/domains/logs/orbeon.log - If the application you are deploying is Orbeon Forms, then this will be the location of the Orbeon Forms log file.
References:

20 comments:

Javier said...

Hi,

I am trying to deploy in weblogic 9.1 orbeon and our webapp, which uses orbeon.

It works in tomcat, but I dont really know how to set this in weblogic:
< Context path="..." docBase="..." crossContext="..."/ >

Any ideas?

Best regards, and thank you.

Alessandro Vernet said...

Javier,

Have you checked the section of the installation documentation dedicated to WebLogic 9? See:

http://www.orbeon.com/ops/doc/intro-install

I hope that helps,

Alex

Javier said...

Hi Alessandro,

that URL helped me pass the first problem.


However, now when I deploy the orbeon.war, either the nightly build or the 3.6 release I get this exception:


2008-06-09 19:02:50,483 INFO EXistServlet - EXistServlet: exist.home=null
2008-06-09 19:02:50,484 INFO EXistServlet - reading configuration from C:\bea\weblogic91\samples\domains\wl_server\null\exist-conf.xml
2008-06-09 19:02:50,492 DEBUG ConfigurationHelper - Could not retieve instance of brokerpool: database instance 'exist' is not available



I´ve looking at the code (https://exist.svn.sourceforge.net/svnroot/exist/trunk/eXist/src/org/exist/http/servlets/EXistServlet.java) that throws the exception and bizarrily in the init method of the servlet "dbHome" is null.

String dbHome = config.getInitParameter("basedir");


< servlet>
< servlet-name>exist-rest-servlet< / servlet-name>
< servlet-class>org.exist.http.servlets.EXistServlet< /servlet-class>
< init-param>
< param-name>configuration< / param-name>
< param-value>exist-conf.xml< / param-value>
< / init-param>
< init-param>
< param-name>basedir< / param-name>
< param-value>WEB-INF< / param-value>
< / init-param>
< init-param>
< param-name>start< / param-name>
< param-value>true< / param-value>
< / init-param>
< load-on-startup>2< / load-on-startup>
< / servlet>

I wonder if this has happen to you before.

Also, I have read that exist needs to write into WEB-INF/exists, is there any special way of deployment to achieve this under weblogic?


I know this is not a forum and I am very sorry if I am being annoying.

Alessandro Vernet said...

Javier,

Deploying Orbeon Forms the way it is described in the documentation should allow eXist to write in that directory. I suggest you post this question in the ops-users mailing list. To subscribe, see:

http://www.orbeon.com/ops/doc/home-faq#mailing-list

I hope to see you there,

Alex

Anonymous said...

I followed instructions from elsewhere to do the following so the installer (10.3) recognized the apple jvm as valid for use....

You will need to "fix" your JDK under Mac OS X by doing the following commands:

sudo su -
mkdir -p /Library/Java/Home/jre/bin
mkdir /Library/Java/Home/jre/lib
cd /Library/Java/Home/jre/bin
ln -s ../../bin/java
cd ../lib
ln -s ../../../Classes/classes.jar rt.jar

These are necessary otherwise Workshop won't know that /Library/Java/Home is a valid java home.

Good luck,
Tarun

Petr Jiricka said...

For 10.3, the download URL has changed, here is the 10.3 download (choose the HP platform).

Also, if you have JDK 6 on your Mac and want to use it with 10.3, do the following to "fix" your JDK and make the installer happy:

sudo su -
mkdir -p /System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Home/jre/bin
mkdir /System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Home/jre/lib
cd /System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Home/jre/bin
ln -s ../../bin/java
cd ../lib
ln -s ../../../Classes/classes.jar rt.jar

Then /System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Home/ will be a suitable Java home.

Petr

Alessandro Vernet said...

Petr, thank you for the great comment.

Matt Barfoot said...

Does anyone have the server922_generic.jar. I've hunted high and low for this everywhere!

I've tried every possible way to hunt it down through the Oracle website, but just can't get hold of it.

If anyone has a copy please please please can I have a copy. I can provide ftp details.
Many thanks,
Matt

Alessandro Vernet said...

Matt,

Oracle has a link to download Oracle WebLogic Server 9.2 MP3 on this page. Is this what you are looking for?

Alex

Matt Barfoot said...

I've tried that link before, but it is just to the binary. I can't install on Mac using this. I believe what I require is the server_922_generic.jar.

Alessandro Vernet said...

Matt,

Good point: somehow they don't have the link the generic version anymore. You can't use a newer version of WebLogic for this? In fact, as a matter of coincidence, I just installed WebLogic 11 on my Mac today.

Alex

Matt Barfoot said...

Well the issue I have is supporting different versions of an application. One that uses 1.4 and the next version that uses 1.5.

To develop the application in exploded mode I need to add several jars into the weblogic startup scripts. In weblogic 10 these cause RMI to freak out.

I suspect I maybe able to workaround this with 9.2 and if it is too much trouble could try and run weblogic with the 1.4 JVM (I may get variable success, but potentially I could run a managed server with 1.4 and run an admin server with 1.5 or something so I can tweak the config.) Once I got the config worked out I probably won't need to make any changes so as long as it starts up ok then I'm not too worried. )

I suppose I could try the samething with 10 and run it with 1.5 (though 10 seems quite a departure from 9) so I'm thinking there might be more dependencies on 1.6.

At the moment I've got the app server running off windows on a vmware instance, but it would be nice to run everything off my mac instead.

Alessandro Vernet said...

Matt,

Have you tried contacting Oracle support about this? If your company buys WebLogic licenses from them, I assume they should be willing to help you on this, and at least provide you with that generic version of WLS 9, even if they don't offer support for it.

Alex

Matt Barfoot said...

Hello Alex,
The weblogic licenses are provided by the software vendor and they only support Solaris and Windows for these versions. I keep a lot of different versions of software I've collected over the years. I was hoping someone might have a copy of the the installer still.
Thanks,
Matt

Anonymous said...

Everything seems to work here (I can use the Console window with no problem) but localhost:7001 shows me an Error 404--Not Found page. And this is about Oracle WebLogic 10g (wls1032_generic.jar). Any ideas what might be wrong?

Alessandro Vernet said...

I recently reinstalled WebLogic 11g on OS X, and found the information provided by Erwin Morales on his blog quite helpful. I hope this will help as well with issue you are encountering.

Chuck said...

Is there a way to get the WebLogic Apache HTTP plugin to work with Mac OS? I have tried all of the LInux flavors of the plugin, both 32 and 64 bit, with the same results:

httpd: Syntax error on line 413 of /apps/apache2.2/conf/httpd.conf: Cannot load /apps/apache2.2/modules/mod_wl.so into server: dlopen(/apps/apache2.2/modules/mod_wl.so, 10): no suitable image found. Did find:\n\t/apps/apache2.2/modules/mod_wl.so: unknown file type, first eight bytes: 0x7F 0x45 0x4C 0x46 0x01 0x01 0x01 0x00

I have already gone through the process of making sure of the proper permissions and that the lib directory, in which the shared object file is located, is in the LD_LIBRARY_PATH.

Alessandro Vernet said...

I never used the WebLogic Apache HTTP server on OS X, and instead send HTTP request to the WebLogic application server directly, but I imagine that you'd like to replicate an environment you have in production. Unless someone else can help you here, I would recommend you ask this question on a WebLogic forum.

Arjun Thorat said...

I am getting this error on mac while starting apache server. can someone please help

httpd: Syntax error on line 173 of /private/etc/apache2/httpd.conf: Cannot load libexec/apache2/mod_wl_24.so into server: dlopen(/usr/libexec/apache2/mod_wl_24.so, 10): no suitable image found. Did find:\n\t/usr/libexec/apache2/mod_wl_24.so: unknown file type, first eight bytes: 0x7F 0x45 0x4C 0x46 0x02 0x01 0x01 0x00


Alessandro Vernet said...

Arjun, I'm sorry but it's been a while since I did this (the post is from 2008), so I don't have much insight in this anymore. I'd suggest you post about the issue you're seeing on Stack Overflow.