JDK版本:1.7update67
Eclipse版本:4.2.2(Juno Service Release 2)
GlassFish版本:4.1
在Eclipse中添加服务器时,默认情况下是没有GlassFish服务器这个选项的,此时选则窗口右上角的“Download additional server adapters”添加GlassFish服务器适配器
安装完成后,在Eclipse中创建服务器时,可选的服务器类型中就会多一个GlassFish
然后配置GlassFish的运行环境
在GlassFish中部署的应用默认将运行在domain1中(管理员密码默认为空)
最后选择好部署在GlassFish上的应用,就可以启动服务器了
GlassFish安装成功的同时也会安装一个GlassFish小插件,通过这个插件可以看到GlassFish的运行日志:
启动信息如下
......
Info: Security Service(s) started successfully.
Info: Created HTTP listener http-listener-1 on host/port 0.0.0.0:8080
Info: Created HTTP listener http-listener-2 on host/port 0.0.0.0:8181
Info: Created HTTP listener admin-listener on host/port 0.0.0.0:4848
Info: Created virtual server server
Info: Created virtual server __asadmin
Info: Setting JAAS app name glassfish-web
Info: Virtual server server loaded default web module
Info: visiting unvisited references
Info: visiting unvisited references
Info: Loading application [WebTest] at [/WebTest]
Info: WebTest was successfully deployed in 6,325 milliseconds.
访问http://127.0.0.1:8080/可以看到GlassFish服务已经启动,路径后加上部署应用的路径可访问部署的应用