Specific Issues
- 2 Specific Issues
- Cannot Access Local Server (
http://localhost:8080) - Cannot Access Remote Server
- Cannot Access the Administration Console
- Cannot Access a Server Application
- Administrator User Name or Password Not Known
- Experience Issues Related to the JDK
- Server Will Not Start on Windows (Port Conflict)
- Eclipse GlassFish Fails to Start in an OpenSolaris Zone
- Two Server Instances Bind to Same Port on Windows
- Cannot Produce a JVM Thread Dump After Server Crash
- Issues Related to Applications
- Issues Related to
asadmin - Issues Related to Installation
- Issues Related to Security
- Cannot Access Local Server (
2 Specific Issues
This chapter lists problems that you might encounter when using Eclipse GlassFish 8. The following topics are addressed:
Cannot Access Local Server (http://localhost:8080)
When this error occurs, check the following:
Did the Server Start?
Description
If the console window is still open, the expected message indicates that the default domain was started successfully.
If the console window is already closed, check for messages in the log file. This is the default location:
domain-dir/logs/server.log
If startup was successful, the expected message is similar to that on the console, and appears at the end of the log file.
For more information about starting a domain, see
"
Starting and Stopping a Domain"
in Eclipse GlassFish Administration Guide.
To easily determine if a domain is running, use the asadmin list-domains command.
Was the Server Started at the Expected Port?
Description
The server might be running at a different port number than expected, either because it was intentionally installed there, or because another server was already running on the default port when the server was installed.
To Determine Which Port Number the Server Is Using
Follow this procedure.
-
Examine the server’s configuration file:
domain-dir/config/domain.xml -
Find the
network-listenerelement. -
Inspect the value of the
portattribute.Be sure to enter the correct port number when invoking the server.
The server’s default port number is
8080, however, there are a number of ways in which the expected value can change:-
A different port number was specified during installation.
-
A previous installation exists.
-
Cannot Access Remote Server
When attempting to open the start page of Eclipse GlassFish, the initial screen does not appear.
When this error occurs, check the following:
Is the Server Available Locally?
Description
If the server cannot be accessed from the web, but it is running locally, then the server is actually running.
Solution
Verify that the server is running locally.
To Verify That the Server Is Running Locally
Follow this procedure.
-
Log on to the host where the server is running.
-
Go to the local web page. For example, if
8080is the default port, go to:http://localhost:8080/If the start page does appear, the web connection is encountering a problem that prevents accessing the server remotely. If the start page does not appear, see Did the Server Start?.
Is the Proxy Setting Causing a Problem?
Description
The server should be accessible directly from the host on which it is
running (localhost); for example, using the default port 8080:
http://localhost:8080/
Solution
A server instance running on localhost might not be accessible if the
server host machine is connected to the web through a proxy. To solve
this problem, do one of the following:
-
Set the browser to bypass the proxy server when accessing
localhost. Refer to the browser’s help system for information about how to do this. -
Use the fully-qualified host name or IP address of your system; for example:
http://myhost.mydomain.com:8080/ -
Create an entry in the system’s hosts file (for example, pointing
127.0.0.1tolocalhost;127.0.0.1is not proxied).
|
To determine the host name for the |
Cannot Access the Administration Console
The Administration Console provides a graphical interface for administrative functions. If the Administration Console is not accessible, check the following:
For more information about the Administration Console, see "Administration Console" in Eclipse GlassFish Administration Guide.
Is the Application Server Running?
Solution
Review the information in Did the Server Start? to determine if the server is running.
Is the Administration Console Running on the Expected Port?
Description
The default port number for the Administration Console is 4848.
However, it could be running on a different port number than expected,
either because it was intentionally installed there, or because that
port was in use when the server was started.
Solution
Refer to Was the Server Started at the Expected Port? for guidelines on verifying the port on which the Administration Console is running. Be sure to enter the correct port number and HTTP protocol when invoking the Administration Console.
Cannot Access a Server Application
If a particular application cannot be accessed through Eclipse GlassFish, check the following:
Is the Application Server Running?
Solution
Review the information in Did the Server Start? to determine if the server is running. The server must be running before a server application can be accessed.
Was Application Deployment Successful?
Solution
Verify that the application was successfully deployed. There are several ways to do this:
-
Check the server’s log file for related entries:
domain-dir/server.log -
Use the
asadmin list-applicationscommand to determine which applications are deployed. -
View the Applications page in the Administration Console, accessed by clicking the Applications node.
For more information about deploying applications, see "Deploying Applications" in Eclipse GlassFish Application Deployment Guide. Also see the Administration Console online help.
Administrator User Name or Password Not Known
If you have forgotten the administrator user name, you can find it by
inspecting the domain-dir`/config/admin-keyfile` file, where domain-dir
is the directory for the domain. In the default domain, domain1, the
file to inspect is domain-dir`/config/admin-keyfile`. For a different
domain, substitute its name in the path.
If you have forgotten the administrator password, one solution is to
create a new domain with the admin username and password that you want,
then copy the entry from the config/admin-keyfile file in that new
domain to the other domain.
Experience Issues Related to the JDK
Solution
Eclipse GlassFish 7.1 requires JDK 17, so check your system for that dependency.
Ensure that the required JDK software is installed and that the
JAVA_HOME environment variable points to the JDK installation
directory, not the Java Runtime Environment (JRE) software.
Set JAVA_HOME and $JAVA_HOME/bin in the PATH to point to the
supported JDK version.
Server Will Not Start on Windows (Port Conflict)
If a message similar to the following is displayed when starting Eclipse GlassFish on Microsoft Windows, a server port conflict has occurred:
Address already in use
This error occurs when another application is running on the Eclipse GlassFish port (default 8080), or because a previous instance of
Eclipse GlassFish did not shut down cleanly.
You might also check the following:
Eclipse GlassFish Fails to Start in an OpenSolaris Zone
Description
If Eclipse GlassFish is installed in an OpenSolaris zone, an attempt to start a domain might fail with the following error message:
Waiting for DAS to start ..Error starting domain: domain.
The server exited prematurely with exit code 6.
Before it died, it produced the following output:
UTF ERROR ["../../../src/solaris/instrument/EncodingSupport_md.c":66]:
Failed to complete iconv_open() setup
The failure occurs because, by default, an OpenSolaris zone is installed without language and encoding support, which Eclipse GlassFish requires.
Resolution: To Enable Eclipse GlassFish to Run in an OpenSolaris Zone
-
Install the package that provides language and encoding support for your locale.
$ pkg install package-name- package-name
-
The name of the package that provides language and encoding support for your locale. For example, the name of the package that provides language and encoding support for the US English locale is
SUNWlang-enUS.
-
Set the
LANGenvironment variable to the code for your locale.For example, if your locale is US English, set the
LANGenvironment variable toen_US.UTF-8.
Two Server Instances Bind to Same Port on Windows
Description
This problem occurs on Windows XP systems with Eclipse GlassFish software, and is due to a known Windows security flaw rather than a problem with Eclipse GlassFish itself.
The problem occurs when two or more instances of Eclipse GlassFish are
created using the same port number for the instanceport option; for
example:
asadmin create-domain -adminport 5001 options -instanceport 6001 domain
asadmin create-domain -adminport 5002 options -instanceport 6001 domain
When the two domains are started on a UNIX or Linux system, a port
conflict error is thrown and the second instance fails to start.
However, when the two domains are started on Windows XP, no error is
thrown, both server instances start, but only the first instance is
accessible at the specified port. When that first server instance is
subsequently shut down, the second instance then becomes accessible.
Moreover, when both instances are running, the Windows netstat command
only reports the first instance.
Cannot Produce a JVM Thread Dump After Server Crash
Description
If Eclipse GlassFish crashes, the server dumps a core file and, by
default, restarts with the -Xrs flag, which prevents the dump of a JVM
thread dump.
Issues Related to Applications
Cannot Undeploy or Redeploy Application With Open Streams to jar Files (Windows)
Description
On Windows systems, after running an application, subsequent attempts to undeploy it or redeploy it throw exceptions about the server being unable to delete a file or rename a directory.
On Windows systems, an application may use getClass().getResource or
getResourceAsStream methods to locate a resource inside the
application, particularly in jar files that are in the application or
accessible to it. If the streams remain open, subsequent attempts to
redeploy or undeploy the application can fail. In addition, the Java
runtime by default caches streams to jar files for performance
reasons.
Solution
Be sure to close streams opened by your applications. Also, if an
application needs to be redeployed or undeployed repeatedly, and also
needs to obtain a resource from a jar file using getResource or
getResourceAsStream, consider using getClass().getResource, which
returns a URL object, then invoke the url.setUseCaches method to turn
off caching for that jar file, and use url.getInputStream() to
obtain the stream.
Although turning off caching for access to the jar file can slow
performance, this approach does allow the application to be undeployed
or redeployed. Note also that if the getClass().getResourceAsStream
method is used instead, then the jar file in which the resource is
located is cached (this is the default Java runtime setting) and remains
open until the server is stopped.
MaxPermGen Exception
Description
Application servers such as Eclipse GlassFish allow you to redeploy an application without restarting the server. Simply make the change in your source code, compile the source, and redeploy the application.
Each application is loaded using its own classloader. When you undeploy an application, its classloader is discarded with all the classes it loaded and is garbage collected sooner or later. However, if there’s a reference from outside an application to an object in the application loaded by the application’s classloader, that object can’t be garbage collected. The reference holds the object in memory.
The memory in the Virtual Machine is divided into a number of regions.
One of these regions is PermGen. It’s an area of memory used to (among
other things) load class files. The size of this memory region is fixed;
it does not change when the VM is running. You can specify the size of
this region with a command line switch: -XX:MaxPermSize. Setting the
-Xmx parameter does not help: this parameter only specifies the total
heap size and does not affect the size of the PermGen region.
If you keep loading new classes that can’t be garbage collected because
of references to them from outside the application, the VM runs out of
space in the PermGen region, even if there’s plenty of memory
available. This is called a classloader leak. The resulting exception is
java.lang.OutOfMemoryError: PermGen space.
The java.lang.String.intern() method also allocates memory in the
PermGen region. If your application uses this method with strings and
holds references to these strings, thereby making garbage collection
impossible, your application may cause the same PermGen space
exception.
Solution
Classloader leaks are difficult to diagnose. Most profilers list leaked objects but don’t highlight the ones causing classloader leaks. Most profilers also stop tracing as soon as they reach a class object or classloader.
One diagnostic approach involves undeploying the application and
triggering a memory dump using the JDK 17 jcmd tool.
The simplest analysis is to list all instances of java.lang.Class
and look for class objects that have many instances.
This is a sign that the class has been loaded
multiple times without being garbage collected.
See https://www.eclipse.org/openj9/docs/tool_jcmd/ for more information.
Issues Related to asadmin
asadmin start-domain Command Fails
The command asadmin start-domain fails with the following error:
There is more than one domain...
Issues Related to Installation
Eclipse GlassFish Components Not Removed During Uninstallation
Description
Not all Eclipse GlassFish directories are automatically removed by the uninstallation program. Some directories and files remain after uninstalling.
Solution
Examine the remaining directories and remove any files or directories that you do not want, including hidden directories prefixed with a dot. It is safe to remove uninstallation and installation log files after you have examined them.
For information related to uninstallation, see "Uninstalling GlassFish" in Eclipse GlassFish Installation Guide.
Issues Related to Security
java.security.AccessControlException: Access Denied Error
Description
The following error occurs from an application client, or appears in the
server.log file:
java.security.AccessControlException: access denied
(java.util.PropertyPermission name write...)
There is a permissions issue in the policy files. Either the
client.policy file for the application client or the server.policy
file for server side components does not have permission to set the
property.
Solution
Add the permission in client.policy (for the application client), or
in server.policy (for web modules) for the application that needs to
set the property. By default, applications only have read permission for
properties.
For example, to grant read/write permission for all files in the
codebase directory, add or append the following to client.policy or
server.policy:
grant codeBase "file:/.../build/sparc_SunOS/sec/-" {
permission java.util.PropertyPermission "*", "read,write";
};
Mutual Authentication Not Working With the Application Client
Description
This failure can occur when the keystore and truststore properties are not set properly.
Solution
Set the following properties on the JVM:
javax.net.ssl.keyStore=
<keystore-file-path>;javax.net.ssl.trustStore=<truststore-file-path>
To use the application client, set the environment variable VMARGS to
the following value:
-Djavax.net.ssl.keyStore=${admin.domain.dir}/${admin.domain}/config/keystore.p12
-Djavax.net.ssl.trustStore=${admin.domain.dir}/${admin.domain}/config/cacerts.p12