By Brian Leonard on Feb 11, 2009
Yes, GlassFish is in the IPS repository. However, getting it up and running leaves a lot to be desired. It's generally easier to get it from java.net. But for those of you that want to go the IPS route, here are the steps that worked for me.
Step 1: Get GlassFish
bleonard@opensolaris:~$ pfexec pkg install glassfishv2 DOWNLOAD PKGS FILES XFER (MB) Completed 12/12 6363/6363 142.44/142.44 PHASE ACTIONS Install Phase 7404/7404 PHASE ITEMS Reading Existing Index 9/9 Indexing Packages 12/12
Step 2: Create a Domain
This is one step that I wish the IPS installer did for us. There are a couple of quirks here. The default domain directory of /var is not writable by my user. I'm not sure what the best practice is here (setting permissions, user/group ownership, etc.), so I'm going to change the configuration to use a different directory. You can do this by changing the AS_DEF_DOMAINS_PATH variable in /usr/appserver/config/asenv.conf to something else. For example:
Also, since this is my development workstation, I'm going to save the master password. Therefore, my command to create the domain looks like the following:
bleonard@opensolaris:~$ asadmin create-domain --user admin --adminport 4848 --savemasterpassword=true domain1 Please enter the admin password> Please enter the admin password again> Please enter the master password [Enter to accept the default]:> Please enter the master password again [Enter to accept the default]:> Using port 4848 for Admin. Using default port 8080 for HTTP Instance. Using default port 7676 for JMS. Using default port 3700 for IIOP. Using default port 8181 for HTTP_SSL. Using default port 3820 for IIOP_SSL. Using default port 3920 for IIOP_MUTUALAUTH. Using default port 8686 for JMX_ADMIN. Domain being created with profile:developer, as specified by variable AS_ADMIN_PROFILE in configuration file. Security Store uses: JKS Domain domain1 created.
Step 3: Start the Domain
bleonard@opensolaris:~$ asadmin start-domain domain1 Starting Domain domain1, please wait. Log redirected to /export/home/bleonard/appserver/domains/domain1/logs/server.log. Redirecting output to /export/home/bleonard/appserver/domains/domain1/logs/server.log Domain domain1 is ready to receive client requests. Additional services are being started in background. Domain [domain1] is running [Sun Java System Application Server 9.1_01 (build b09d-fcs)] with its configuration and logs at: [/export/home/bleonard/appserver/domains]. Admin Console is available at [http://localhost:4848]. Use the same port  for "asadmin" commands. User web applications are available at these URLs: [http://localhost:8080 https://localhost:8181 ]. Following web-contexts are available: [/web1 /__wstx-services ]. Standard JMX Clients (like JConsole) can connect to JMXServiceURL: [service:jmx:rmi:///jndi/rmi://opensolaris:8686/jmxrmi] for domain management purposes. Domain listens on at least following ports for connections: [8080 8181 4848 3700 3820 3920 8686 ]. Domain does not support application server clusters and other standalone instances.
Step 4: Create a SMF Service for the Domain
This is optional, but certainly a nice way to manage the domain. Ideally, the IPS installer would have also handled this for us.
Before we can create the service, we need to store the password information in a file. I created a file called glassfish_password.txt in my home directory containing the following:
AS_ADMIN_USER=admin AS_ADMIN_PASSWORD=adminadmin AS_ADMIN_MASTERPASSWORD=changeit
Then I ran the following asadmin command:
Now you can start the the domain using:bleonard@opensolaris:~$ pfexec asadmin create-service --type das --passwordfile glassfish_password.txt /export/home/bleonard/appserver/domains/domain1/ The Service was created successfully. Here are the details: Name of the service:application/SUNWappserver/domain1 Type of the service:Domain Configuration location of the service:/export/home/bleonard/appserver/domains Manifest file location on the system:/var/svc/manifest/application/SUNWappserver/domain1_export_home_bleonard_appserver_domains/Domain-service-smf.xml. The service could be enabled using svcadm command. Command create-service executed successfully.
svcadm enable domain1
You can see its status with:
bleonard@opensolaris:~$ svcs -x domain1 svc:/application/SUNWappserver/domain1:default (Appserver Domain Administration Server) State: online since Wed Feb 11 15:12:46 2009 See: Appserver(1) See: /var/svc/log/application-SUNWappserver-domain1:default.log Impact: None.