GlassFish的另外一個(gè)秘密武器,就是Grizzly,Grizzly是一個(gè)基于Java NIO(New IO)技術(shù),并完全以Java實(shí)現的一個(gè)HTTP的Listener,有了Grizzly,GlassFish在靜態(tài)文件傳輸方面的性能比Tomcat要 強得多,而且可以支持更多的并發(fā)訪(fǎng)問(wèn)。我們可以?huà)仐塉Boss+Tomcat和Apache+Tomcat這樣的組合了。
GlassFish社團正在開(kāi)發(fā)一個(gè)免費,開(kāi)源的Java EE5(下一版本的J2EE)應用服務(wù)器。這個(gè)服務(wù)器實(shí)現了Java EE5平臺中的最新特性。Java EE5平臺包括一些技術(shù)的最新版本如:
*.Enterprise JavaBeans (EJB) 3.0,
*.JavaServer Faces (JSF) 1.2,
*.Servlet 2.5,
*.JavaServer Pages (JSP) 2.1,
*.Java API for Web Services (JAX-WS) 2.0,
*.Java Architecture for XML Binding (JAXB) 2.0,
*.Java Persistence 1.0,
*.Common Annotations 1.0,
*.Streaming API for XML (StAX) 1.0和其它一些新的技術(shù)。
相關(guān)站點(diǎn)/下載地址:http://java.sun.com/developer/community/askxprt/2005/jl1114.html
一、安裝GlassFish
從以下地址:https://glassfish.dev.java.net/public/downloadsindex.html
下載 Milestone binary builds Linux 版本: b32g-glassfish-linux.jar size 77M
在安裝GlassFish之前請需事先安裝設置好以下環(huán)境 /etc/profile
#config java
系統需要安裝J2SE 5.0
export JAVA_HOME=/usr/local/jdk1.5.0_06
export PATH=/usr/local/jdk1.5.0_06/bin:$PATH
#config ant
export ANT_HOME=/usr/local/apache-ant-1.6.2
export PATH=/usr/local/apache-ant-1.6.2/bin:$PATH
然后運行 java -Xmx256m -jar glassfish-installer-9.0-b32g.jar
cd glassfish
運行 ant -f setup.xml
將系統安裝在: /usr/local/glassfish/
系統默認的 administration 屬性值有:
domain.name="domain1"
instance.name="server"
admin.user="admin"
admin.password="adminadmin"
admin.port="4848"
instance.port"="8080"
orb.port="3700"
imq.port="7676"
https.port="8181"
二、運行GlassFish
cd /usr/local/glassfish/bin
[root@fc3-3 bin]# ./asadmin start-domain domain1
打開(kāi)瀏覽器,輸入
http://192.168.1.3:8080/

Logon to the Administration Console
http://192.168.1.3:4848/
user name: admin
password: adminadmin


三、構建您的第一個(gè) GlassFish 應用程序
下載 hello.war
cp hello.war domains/domain1/autodeploy/
或用 asadmin deploy 的方式部署應用, 另外 asadmin updeploy 卸載應用
通過(guò)asadmin deploy --help 和 asadmin undeploy --help 獲得更多幫助
http://192.168.1.3:8080/hello

運行 asadmin stop-domain domain1 可關(guān)閉服務(wù)器
四、Java BluePrints Solutions Catalog for GlassFish
下載 blueprints ,包含Ajax & JSF的組件和代碼
運行java -jar bpcatalog-ee5-ea-v0.4-installer.jar進(jìn)行安裝
文件安裝在 bpcatalog-ee5-ea-v0.4 目錄下
cp bpcatalog.war 和 apps/webtier/目錄下的文件到 domains/domain1/autodeploy/ 目錄
http://192.168.1.3:8080/bpcatalog


五、在線(xiàn)學(xué)習
* Introducing Java EE 5 SDK Preview
http://download.java.net/javaee5/screencasts/sdk-intro/index.html
* Admin Console Overview
http://download.java.net/javaee5/screencasts/admin-console/index.html
* Deploying and Launching Applications using Admin Console
http://download.java.net/javaee5/screencasts/deployment/index.html
[來(lái)源:http://www.huihoo.com]
Trackback: http://tb.blog.csdn.net/TrackBack.aspx?PostId=1783188
聯(lián)系客服