Glassfish V2 installation in Windows

Source: Internet
Author: User
Tags glassfish

1. What is glassfish?

Glassfish is a robust and commercially compatible open-source Java ee 5 Application Server that delivers product-level quality and can be used for development, deployment, and redistribution for free, it is also a server developed by Sun to support EJB.

Glassfish is the name of an Open Source Development Project used to build a Java ee 5 Application Server. It is based on the source code of Sun Java System Application Server PE 9 provided by Sun Microsystems and the toplink persistent code contributed by Oracle. This project provides a structured process for developing high-quality application servers, providing new functions at an unprecedented speed. This is to contribute to the hope to get the source code and develop Sun's next-generation Application Server (based on glassfish)
A response from a Java developer. This project aims to promote communication between Sun and Oracle engineers and the Community. It will allow all developers to participate in the development process of the application server.

Ii. environment required to install glassfish

1. Operating System:Windows XP or Windows 7;

2. JDK 5 or later:This is usually done before Java Development, when setting up the JDK development environment. If not, you can refer to my previous blog "Java basic development environment setup;

3. Download The glassfish V2 Server:Glassfish V2 version http://glassfish.java.net/downloads/v2.1.1-final.html#download the Windows version in the others binary builds list, such as the file name: glassfish-installer-v2.1.1-b31g-windows-ml.jar;

4. Install the ant tool:After extracting the jar package of glassfish, you need to use it to configure glassfish on the command line. In addition, the glassfish contains ant, which is under the "glassfish \ Lib \ ant" directory. Therefore, it is recommended that you do not need to re-download and install it. After the jar package of glassfish is decompressed, configure the ant tool that comes with glassfish in the system environment. The detailed processing will be introduced later.

3. install and configure the glassfish server through command line

After the above work is ready, we can install and configure the glassfish server through the command line.

1. decompress the JAR file of glassfish: Because the downloaded glassfish-installer-v2.1.1-b31g-windows-ml.jar is a jar file, we need to decompress it, unzip the command: Java-xmx256m-jar
+ Name of the file to be decompressed. After the command is successfully executed, a glassfish folder is generated in the directory where the decompressed JAR file, such as the glassfish-installer-v2.1.1-b31g-windows-ml.jar, is located to store the glassfish server. The procedure is as follows:

1)Run the command line to enter the directory of the downloaded glassfish JAR file. I put it on the E drive, open "Start> Run", and enter "cmd ";

2)After entering the command line window, switch to the glassfish-installer-v2.1.1-b31g-windows-ml.jar directory, such as E on the disk, enter "E:" enter,

3)Run the unzip command: Java-xmx256m-jar glassfish-installer-v2.1.1-b31g-windows-ml.jar;

4)Accept Protocol: If the JDK environment configuration mentioned above is successful, the glassfish agreement "License Agreement" will pop up. You can browse the protocol and accept "accept ", start to unzip and install the package as follows:

5)The installation is complete, as shown below. You can go to the E drive to check whether there is an extra "glassfish" folder. If yes, the installation is successful;

2. Configure the glassfish Server

1) Configure ant tool:

After the installation is complete, you can also configure it for use. As mentioned above, ant is required for configuration. glassfish has its own ant tool. Now you can find ant in the installed "glassfish" directory. Assume that the "glassfish" directory is glassfish_home, then the ant directory is: glassfish_home \ Lib \ ant. After I find it: e: \ glassfish \ Lib \ ant, we need to add it to our system variables. The specific settings are as follows:

My computer --> right-click and choose "properties" --> "Advanced System settings" --> "environment variables" --> "new" variable ant_home "in" system variables "--> ant_home = glassfish_home \ Lib \ ant, for me, it is ant_home = E: \ glassfish \ Lib \ ant --> set path, keep the original content of path, and add % ant_home % \ bin --> Save and confirm the application.

2) Configure glassfish using ant:

First look at the configuration file, in the glassfish directory, there is a setup. xml file and a setup-cluster.xml file, both of which are glassfish configuration files, the cluster represents the cluster, that is, the setup-cluster.xml configuration with cluster support. Therefore, we select the latter for configuration. Open the file in notepad and we can see some configuration information (including the port, management username and password ):

<Property name = "domain. name "value =" domain1 "/> domain name <property name =" instance. name "value =" server "/> <property name =" Admin. user "value =" admin "/> administrator username <property name =" Admin. password "value =" adminadmin "/> administrator password <property name =" Admin. port "value =" 4848 "/> management platform port <property name =" instance. port "value =" 8080 "/> instance port, which is used to access the Web application <property name =" orb. port "value =" 3700 "/> <property name =" imq. port "value =" 7676 "/> <property name =" HTTPS. port "value =" 8181 "/> HTTPS Port

Command line configuration, then in the previous command line window, go to the glassfish directory (command: CD glassfish), then execute the following command: ant-F setup-cluster.xml, and press enter to start the Configuration:




Build successful. The configuration is successful.


Iv. Test the glassfish Server

After the configuration command is executed, run the "asadmin start-domain domain1" command to start the glassfish server. Note that there is no space between "start-domain.



Enter http: // localhost: 8080 in the browser to go to the default homepage. Enter http: // localhost: 4848 To Go To The Management page. Username: Admin, default password: adminadmin, logon Management page:


Call!

I think it's good. Please try again. If you have any questions, please leave a message to discuss them and study and make progress together.

Related Article

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.