Skip to main content

Glassfish 4.0 create-domain with --savemasterpassword=true does not work

Please note these java.net forums are being decommissioned and use the new and improved forums at https://community.oracle.com/community/java.
1 reply [Last post]
heq
Offline
Joined: 2013-09-12

I am using ant to create a domain in glassfish 4.0 build 89 then try to start the domain. Here is my domain creation part of the command options.

<exec executable="${glassfish.asadmin}" errorproperty="create.error" resultproperty="create.result" failonerror="true">
      <arg value="--user=admin" />
      <arg value="--passwordfile=../shared/admin_password.txt" />
      <arg value="create-domain" />
      <arg value="--savemasterpassword=true" />
      <arg value="--savelogin=true" />
      <arg value="--portbase=${port.base}" />
      <arg value="--domaindir=${domains.dir}" />
      <arg value="${domain.name}" />
</exec>

This creates the domain successfully and there is a file master-password in the domain's config directory. However, when I try to use the following ant target to start the domain, it complains
"The Master Password is required to start the domain. No console, no prompting possible. You should either create the domain with --savemasterpassword=true or provide a password file with the --passwordfile option.Command start-domain failed."

<exec executable="${glassfish.asadmin}" failonerror="true">
  <arg value="start-domain" />
  <arg value="--domaindir" />
  <arg value="${domains.dir}" />
  <arg value="${domain.name}" />
</exec>

I have tested the same ant stuff works under glassfish 3.1.1.2 and 2.1.1, meaning without asking for master password. Has anybody else experienced the same in glassfish 4.0?

Thank you.

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
heq
Offline
Joined: 2013-09-12

I have found this is a bug. In class LocalServerCommand.java method getMasterPasswordFile, the following line is wrong:

File mp = new File(serverDirs.getServerDir(), "master-password");

It should be serverDirs.getConfigDir() instead, because that is where master-password is saved during domain-creation.

I verified that by copying the master-password file from the config folder to one level up. It worked.

How do I report this bug?