This article describes how to deploy a Web application on GlassFish.
First, the choice of development tools
Java EE, or JSF application development, NetBeans and GlassFish are the best choice, and the former has very good support for the latter. But pay attention to the version of NetBeans, 5.5 is not support GlassFish v2. And NETBEANS6 is still very unstable, so the best version of the current stage is netbeans5.5.1.
About NetBeans Development Java EE applications, official documentation: Java EE application related tutorials, here is a brief introduction to the production environment of Web applications under the GlassFish deployment and configuration
Second, download and install GlassFish V2
1) Download GlassFish v2 and unzip it. When the download is complete, execute the following command:
Java-xmx256m-jar Glassfish_filename.jar
Click to accept the pop-up protocol (here sun is more boring ah, all software is, obviously a normal compression package, not pressure into a jar to let you look at the agreement just line), GlassFish will be extracted into a directory called GlassFish.
2) Modify the port
GlassFish is installed through ant, and the setup script is Setup.xml, where you can modify some configurations, such as ports and so on. The following settings are primarily available in Setup.xml:
XML code
﹤property name="domain.name" value="domain1"/﹥ 域名
﹤property name="instance.name" value="server"/﹥
﹤property name="admin.user" value="admin"/﹥ 管理员用户名
﹤property name="admin.password" value="adminadmin"/﹥ 管理员密码
﹤property name="admin.port" value="4848"/﹥ 管理平台端口
﹤property name="instance.port" value="8080"/﹥ 实例端口,也就是通过这个端口来访问web应用
﹤property name="orb.port" value="3700"/﹥
﹤property name="imq.port" value="7676"/﹥
﹤property name="https.port" value="8181"/﹥ https端口
Modify the above settings as needed, and execute: ant-f setup.xml, if the system does not have ant installed, there is a ant1.6 version under Glassfish\lib\ant. After the installation is complete, enter the Glassfish/bin and execute the following command on the console to start the GlassFish:
Asadmin start-domain domain1//Domain1 is the Domain.name set above, system default Domain1
At the end of startup, enter http://localhost:8080 test has started correctly
Asadmin stop-domain domain1/Stop Server