Practice: Configure multiple domain (multiple domains) under GlassFish

Source: Internet
Author: User
Tags create domain glassfish

Company work server is GlassFish, but there is no need for multiple domains. The thing is that you want to configure a domain to do a variety of technical testing. Originally wanted to copy a copy of GlassFish, but it turns out that there are multiple glassfish on a machine that can have a variety of port conflict problems. Later thought of GlassFish not can configure multiple domain, hurriedly go online looking for information. In fact, configuring multiple domain is very simple and requires only a few commands.


Create domain

GlassFish the command to create domain is: create-domain create-domain

Into the GlassFish bin directory, you can see the GlassFish asadmin tool.

Executing the./asadmin command in the current bin directory allows you to enter the asadmin command mode:


Here you can execute the create-domain command to create domain, we create a default domain, the process will require you to enter a username, password and Confirm password.


See command Create-domain executed successfully created successfully, in the process of creating, GlassFish will default to specify some ports, because there is already a domain in existence, if you have not modified the configuration, Two domain started together, there may be problems with port conflicts.

This article resolves, no free port problem: no free port

Java.net.BindException:No free port within range:7676=com.sun.enterprise.v3.se
Rvices.impl.serviceinitializerhandler@69ed60dd.

This article resolves: server up issue: is the server up?
Remote server does not listen to requests on [localhost:4848].
Is the server up?

Deployment Test

Deploying and Undeploying applications

1. Download the example provided by GlassFish,

Https://glassfish.dev.java.net/downloads/quickstart/hello.war.


2. Deploy using the command line:

Asadmin Deploy Sample-dir/hello.war

The result of two domains on my machine at the same time:



Domain is done here, Create-domain has many configuration items, the default port can be specified with configuration items, details refer to GlassFish's official documentation: Create-domain.


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.