Masoud Kalali's Blog

My thoughts on software engineering and beyond…

By

Using GlassFish domain templates to easily create several customized domains

It might have happened to you to require some customization the GlassFish behavior after you create the domain in order to make the domain fit the  basic requirements that you have in your organization or for your development purpose. Some of the files that we usually manipulate to customize GlassFish includes logging.properties, keystore.jks, cacert.jks, default-web.xml, server.policy and domain.xml. These files can be customized through different asadmin commands, or JDK commands like keytool, policytool or manually using a text editor after you created the domain in the config directory of the domain itself.  But repeating the steps for multiple domains is a laborious task which can be prevented by changing the template files that GlassFish domains are created using them. The templates are located atAnd we can simply open them and edit the properties to make them more fit to our needs.

The benefit of modifying the templates rather than copy pasting the config directory of one domain to another is the domain specific behaviors like port numbers which have placeholders in the domain.xml to be filled by asadmin command. An example of a placeholder is %%%JMS_PROVIDER_PORT%%% which will be replaced by JMS provider port by asadmin command.

3 Responses to Using GlassFish domain templates to easily create several customized domains

  1. Pingback: Tab Sweep: Arquillian, Power Mac, PowerPC, JSP Performance, JMX Connection, … « oracle fusion identity

  2. Good day,

    Thanks for the information on the templates directory in the Glassfish distribution. Is it possible to have more than 1 domain template and then choose at deployment time, for example when asadmin create-domain is issued?

    Regards,
    Mark P Ashworth

Leave a Reply

Your email address will not be published. Required fields are marked *


five + 2 =

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">