Working with GlassFish & Payara Server Dotted Names

Uncategorized

Many of you will know of some of the common asadmin commands, such as start-domain, create-cluster, and change-admin-password, some of which I covered in a previous blog written for GlassFish (which still holds true for Payara Server).

Unfortunately, there is not a specific asadmin command for every configurable attribute in GlassFish or Payara Server. This is where dotted names, and the get, set, and list commands come in. 

Every attribute that can be defined in the domain.xml also has a corresponding dotted name attribute, which can be viewed and configured with the get, set, and list commands. This provides a safer method of configuring a domain over manually editing the domain.xml thanks to the validation it provides. Configuring domains using asadmin commands is also preferred due to the ability to include the commands in a script.

 

I’ve found that the get, set, and list commands are often ignored from online tutorials, and are rarely mentioned besides that. So in this blog, I’ll give a quick overview of the commands, and how you can use them to configure a domain. First though, a quick description of dotted names.

 

Dotted Names

Dotted names in Payara Server and GlassFish refer to the attributes of a domain, taking a form commonly seen in properties files. The dotted names form a tree structure of attributes, with each dot acting as a node. For those of a certain mindset, this provides an easy to understand means of viewing and configuring the values of each attribute.

 

As an example, in the default domain template there is an HTTP listener named http-listener-1.  This listener has two attributes: name and security-enabled, determining the name of the listener and whether it has security (HTTPS) enabled or not. These attributes would respectively be represented in dotted name format by:

configs.config.default-config.network-config.protocols.protocol.http-listener-1.name
configs.config.default-config.network-config.protocols.protocol.http-listener-1.security-enabled 

It’s sometimes easier to envision the dotted names as the tree structure they actually represent. For the example given above, it would look like this:

 

Dotted_names.jpg

 

The Get Command

This commands retrieves the dotted name and current value of an attribute, particularly useful if you’re not a maverick – configuring attributes blindly. Helpfully, this command accepts wildcards, so you can use it to get the values of multiple attributes at once.

 

As an example, to get the values of the http-listener-1 attributes (see the diagram above), you can run:

asadmin get configs.config.default-config.network-config.protocols.protocol.http-listener-1

The output of this command looks like this:

configs.config.default-config.network-config.protocols.protocol.http-listener-1.name=http-listener-1
configs.config.default-config.network-config.protocols.protocol.http-listener-1.security-enabled=false

Alternatively, if you’re having trouble finding an attribute, you can simply list every single attribute and their values by using an asterisk as a wildcard:

asadmin get "*"

The List Command

This command serves the same function as the ls command from the Linux/PowerShell terminal, listing the tree nodes (or directories) that have attributes or further child nodes (subdirectories). Differing from the get command, this command is more suitable for navigating the tree as it returns the names of nodes, allowing you to more easily navigate the dotted name tree.

 

For example, to list the children of the http-listener-1 HTTP listener:

asadmin list configs.config.default-config.network-config.protocols.protocol.http-listener-1

This returns:

configs.config.default-config.network-config.protocols.protocol.http-listener-1
configs.config.default-config.network-config.protocols.protocol.http-listener-1.http
configs.config.default-config.network-config.protocols.protocol.http-listener-1.ssl

This lets us know that this listener has two child nodes, http and ssl, as well as its own attributes (signified by the command returning itself as a result). We can then follow this up and navigate further into the tree by running list in one of the child nodes, or using the get command to list the attributes and their values of the http-listener-1 node.

 

As a bonus, this command also accepts wildcards, making searching and navigation easier.

 

The Set Command

As you can probably gather from the name, this is the command that sets the value of an attribute. Once you know the dotted name of the attribute that you intend to alter, you can use this command to set its value, provided your supplied value passes any validation checks.

 

As an example, to enable security on the http-listener-1 HTTP listener, you would run this:

asadmin set configs.config.default-config.network-config.protocols.protocol.http-listener-1.security-enabled=true 

The value entered here would have to be either true or false, else the validation check would reject it. This is something that raises configuring the domain in this way above altering the domain.xml; it helps to reduce user error.

 

Wrapping Up

While most of us use, and will continue to use, the bespoke asadmin commands to do our domain configuration (myself included!), it’s always good to let people know that they aren’t all encompassing and that there is a backup to fall back on before we resort to hacking around in the domain.xml. 

 

 

Comments (3)

Post a comment

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

Payara needs the contact information you provide to us to contact you about our products and services. You may unsubscribe from these communications at any time. For information on how to unsubscribe, as well as our privacy practices and commitment to protecting your privacy, please review our Legal & Privacy Policy.

  1. Andrew Grabovetskyi

    Thank you for the post!

    Quick question: what if I need to set the dotted property, something like:
    some.system.property=127.0.0.1

    I was not able to make this command work properly:
    ./asadmin set configs.config.some-cluster-config.system-property.some.system.property=127.0.0.1

    and like this:
    ./asadmin set configs.config.some-cluster-config.system-property[“some.system.property”]=127.0.0.1

    and even like this:
    ./asadmin set configs.config.some-cluster-config.system-property.some.system.property=127.0.0.1

    Any ideas hot to set dotted properties? )

    Thanks!

  2. Andrew Pielage

    Hi Andrew,

    The dotted name and value of a system property is represented a little differently to other configuration options – the name and value are separate.

    So, for example, a system property called HTTP_LISTENER_PORT is represented as:

    configs.config.default-config.system-property.HTTP_LISTENER_PORT.name=HTTP_LISTENER_PORT
    configs.config.default-config.system-property.HTTP_LISTENER_PORT.value=28080

    Dotted system properties follow the same structure, and are represented (a little unintuitively I think) like this:

    configs.config.default-config.system-property.DOTTED.SYSTEM.PROPERTY.name=DOTTED.SYSTEM.PROPERTY
    configs.config.default-config.system-property.DOTTED.SYSTEM.PROPERTY.value=127.0.0.1

    Worth bearing in mind is that if you change the property name value, the dotted path also changes:

    configs.config.default-config.system-property.DOTTED.SYSTEM.PROPERTY.name=DOTTED.SYSTEM.PROPERTY
    set configs.config.default-config.system-property.DOTTED.SYSTEM.PROPERTY.name=TESTY.TEST
    configs.config.default-config.system-property.TESTY.TEST.name=TESTY.TEST

    Finally, just in case you didn’t know, you can’t create system properties with the set command – if you want to create a system property you’ll need to use:

    create-system-properties WIBBLY.WOBBLY=TIMEY.WIMEY

    Hope that helps 🙂

  3. Andrew Grabovetskyi

    Hi Andrew,

    thank you so much for your response!

    I very appreciate your comment, I was able to utilize the practice you have mentioned and everything worked fine! 🙂

    Also, thank you for mentioning about ‘create-system-properties’ – indeed I was not aware about this command. For googlers who reached this blog post, below the list of the related commands for working with system properties in Payara / GlassFish that I have discovered as well:
    – create-system-properties
    – list-system-properties
    – delete-system-property

    Thanks!

Related Posts

Community_Announcement 4 minutes
Uncategorized

Leading the Way: Payara Platform Community 7 Beta Now Fully Jakarta EE 11 Certified

We’re excited to announce that Payara Platform Community 7 Beta application server is now fully certified as Jakarta EE 11 […]

What Is a Java Application Server? A Short Guide 6 minutes
Jakarta EE

What Is a Java Application Server? A Short Guide

Enterprise Java applications power global commerce, healthcare, government and countless other industries. These systems must be scalable, secure and […]

10 minutes
Uncategorized

Java’s 30th Anniversary: A Celebration of Legacy, Evolution and Community

May 2025 marks a monumental milestone in software development: Java turns 30. The impact of this language on the […]