The Source for Java Technology Collaboration


This page just provides some quick info on how to run GlassFish on Mac OS X.

Note: this is purely a page about running GlassFish, I haven't built it on Mac OS X (10.4).

How to deploy and setup GF on Mac OS X

  • Get Mac OS X Tiger (10.4.x). You need this because GF requires J2SE? 5.0, and Apple's JVM requires 10.4.x. To get Tiger, you will need to buy it somewhere, like at Apple's online store, and then you may want to use their software upgrade to get the latest versions of their components.
  • Get the latest J2SE? 5.0 from apple. The latest is release 3. The documentation (javadocs) is a separate download
  • Make the J2SE? 5.0 be the default JVM. The simplest way is to change a symlink: follow these instructions.
  • Download the latest build: currently that is build 28, take the darwin build. The downloaded file is a self-extracting JAR file.
  • Open a terminal window, go to wherever you want to install GlassFish, and move the self-extracting JAR file there. Note that the extractor currently creates a wired-in dependency on the path to the install directory, so if you move the direction you will have to adjust the scripts. IMO, that is a bug, but, for now, plan ahead where to place the directory.
  • Run the Jar file a java -Xmx256m -jar glassfish-installer-9.0-b28.jar, accept the license, and a glassfish directory will be created.
  • Change directory: cd glassfish.
  • Run the setup script. This uses Ant. It is recommended to use the ant that is part of the build; if you want to do that, you would type sh lib/ant/bin/ant -f setup.xml.

That should complete the installation and setup

To start and deploy a simple hello world.

There is a document that briefly describes how to get it started, but, extracting from there:

  • Arrange your PATH to have glassfish-dir/bin. You will use the asadmin command.
  • Start the application server as asadmin start-domain domain1. You will see the message: Domain domain1 is ready to receive client requests. Additional services are being started in the background.
  • Confirm the application server is up by pointing your browser to http://localhost:8080. This page may take a bit to present as it requires more services to be available.
  • Optionally, you can log into the admin console. The console is available at http://localhost:4848/; login as admin with password adminadmin. The admin console takes a few seconds to come-up; I assume the JSP compiler is initializing and some JSP pages are being compiled.
  • GlassFish provides autodeploy of applications. To do this, you need to drop the application WAR into the proper directory. A sample hello world app is at https://glassfish.dev.java.net/downloads/quickstart/hello.war. Download the WAR file and then copy it into glassfish-dir/domains/domain1/autodeploy/.
  • Once the application is auto-deployed - this may take a few seconds - you can visit the simple hello world at: http://localhost:8080/hello.
  • To shutdown the application, you can use again the asadmin command as asadmin stop-domain domain1.

-- EduardoPelegri - 27 Nov 2005

Can't deploy app on Mac OS X Tiger: invalid stream header

I couldn't deploy my webapp using asadmin deploy on Mac OSX Tiger. Jeanfrancois suggested the following remedy:

JA> See bug 6296095. This error is the result of the connection being close,
JA> reaching the maximum allowed keep-alive requests. As a workaround, edit,
JA> in domain.xml:

JA> <keep-alive max-connections="256" thread-count="1"
JA> timeout-in-seconds="500"/>

I had to add this after the last virtual-server entry in the domain.xml.

-- Ed Burns 13 July 2005

NoSuchAlgorithmException: DESede

If you receive this error, you're experiencing Bug number 6. Please see the bug report for a workaround.

-- Ed Burns 14 July 2005

OutOfMemoryError: PermGenSpace

If you see this error, please add the following to the end of the jvm-options element in domain.xml

<jvm-options>-XXPermSize=128m</jvm-options>

-- Ed Burns 18 July 2005

Topic GlassFishOnMacOSX . { Edit | Ref-By | Printable | Diffs r5 < r4 < r3 < r2 < r1 | More }
 XML java.net RSS

Revision r5 - 27 Nov 2005 - 01:04:23 - Main.pelegri
Parents: GlassFish