Blog Archives

Glassfish version 3.1.2: Secure Admin must be enabled to access the DAS remotely.

Overview

Firstly, I only install the new Glassfish 3.1.2 only in my laptop and access the administration module locally by using “localhost:4048”. When I install it on the development server and try to access it remotely, by using “http:/my_host:port”. It shows me an error as cannot login with the message as

Secure Admin must be enabled to access the DAS remotely.

The Investigation

I’ve found the nice solution form stack overflow here.

The solution

It’s simple by activate the secure admin by using the following command line: –

asadmin --host [host] --port [port] enable-secure-admin

The host is the host name or IP address for the Glassfish Server which we need to enable the secure admin.

The port is the target Glassfish Server port which wee need to enable the secure admin.

Caution

Please take a big note as the following: –

  1. The target Glassfish Server which is the port owner is started before executing the above command.
  2. After executing, the target Glassfish Server need to be restarted for taking effect.

Rollback

If we would like to disable the secure admin, it can be done easily as the following: –

asadmin --host [host] --port [port] disable-secure-admin

org.glassfish.embeddable.GlassFishException: PlainTextActionReporterFAILURENo configuration found for server.network-config.network-listeners.network-listener.http-listener

Overview

When I upgrade the Glassfish Server to be a version 3.1.2 from  here, the Glassfish Embedded Server should be upgraded as well. Anyhow when I perform the unit test, it is failed as

org.glassfish.embeddable.GlassFishException: PlainTextActionReporterFAILURENo configuration found for server.network-config.network-listeners.network-listener.http-listener

Investigation

I’ve put the whole exception mentioned above to sear via Google and found the useful information at Glassfish Jira issue #18452 . They mention about the configuration at the domain.xml is not completed. I’ve been noticed that the Glassfish Embeded Server has some limitation about the HTTP listener port and need to be applied the additional configuration as it is mentioned here.

The Root Cause

The root cause is I’ve configured the HTTP port explicitly as

props.put("org.glassfish.ejb.embedded.glassfish.web.http.port", 14080);
ejbContainer = EJBContainer.createEJBContainer(props);

The Solution

It is a very easy step by removing the explicitly configured HTTP port. Anyhow, the domain.xml should be configured for all related ports properly. We can download the starter domain.xml from here and start configure all related ports and/or further jdbc/datasource resources as well.