准备工做要搞好,对吧!(以下:)java
ps:配置环境变量已在其余博文中描述。git
①文件(F)--->打开项目(E)github
②选择你下载的firstcup解压后的路径:web
③此时会看到“项目”栏中有了"firstcup"项目:sql
④鼠标右击 “firstcup” 项目--->清理并构建 :数据库
⑤build 成功信息:apache
⑥此时项目文件里多了target子文件夹,而且target文件夹里面多了 firstcup-war.war 文件windows
⑦启动GlassFish服务器:服务器
⑧能够看到输出栏中的Java DB数据库进程信息和GlassFish服务器启动的加载信息:oracle
⑨打开管理员界面,部署刚才已build的firstcup-war.war文件:
⑩启动部署到GlassFish服务器上的项目:
最后运行结果以下:
2.经过NetBeans IDE 8.2实现firstcup 项目部署:
命令:asadmin deploy 你的war项目文件所在的父目录\firstcup-war.war
可是出现以下错误:
remote failure: Error occurred during deployment: Exception while deploying the app [firstcup-war] : Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.7.0.v20170811-d680af5): org.eclipse.persistence.exceptions.DatabaseException
Internal Exception: java.sql.SQLException: Error in allocating a connection. Cause: Connection could not allocated because: java.net.ConnectionException: 链接到端口 1,527 上的服务器 localhost 时出错,消息为 Connection refused: connect。
Error Code: 0. Please see server.log for more details.
缘由: