1) 下载zip文件 Download the gfv3-preview2.zip
http://download.java.net/glassfish/v3-tp2/promoted/gfv3-preview2.zip
2)解压zip文件 Unzip the gfv3-preview2.zip file.
unzip gfv3-preview2.zip
3)(可选Optional) The Update Tool enables the extension of the Application Server's basic functionality through addition of modules
安装命令glassfishv3-tp2/bin/pkg
Type pkg --help to display online help for the utility
安装命令glassfishv3-tp2/bin/updatetool
4)Starting and Stopping the Default Domain
启动服务器To Start the Default Domain
asadmin start-domain
打开web控制台Open the Admin Console URL in a browser window http://localhost:8080/admin
用户名:anonymous
密码:空
关闭服务器To Stop the Default Domain
asadmin stop-domain
5)Starting and Stopping the GlassFish Java DB Server Implementation
To Start the GlassFish Java DB Server
asadmin start-database --dbhome as-install/javadb
To Stop the Java DB Server
asadmin stop-database
6)GlassFish将分为3个版本,嵌入式,web服务器,JEE服务器,详细见下
GlassFish V3 Distributions
Nucleus | Minimal distribution without any containers | Developer | HK2, Grizzly, Logging, Configuration, Deployment, Security, Basic CLI, Update Center? | OEM | GlassFish maven repository | Nov/Dec 2007 |
Web | Distribution targeted to Web Application Developers | Developer | Nucleus, Web Container, JPA, jRuby, FastCGI, php support, REST?, JDBC, Clustering, Admin Console and CLI, IPS, Installer | Web Developers and Deployers | glassfish.java.net java.sun.com www.sun.com |
Jan/Feb 2008 Apr/May 2008 Apr/May 2008 |
AppServer | Full Java EE distribution | Developer | Web, All Java EE | Java EE developers and small/medium deployers | glassfish.java.net java.sun.com www.sun.com |
May/Jun 2008 Oct/Nov 2008 Oct/Nov 2008 |
7)将Glassfish V3嵌入到你的JAVA应用中
GlassFish glassfish = new GlassFish();
glassfish.minimallyConfigure(8080);
GFApplication app = glassfish.deploy(new File("mon_appli.war"));
//代码
...
app.undeploy();
glassfish.stop();