準備工做要搞好,對吧!(以下:)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.
緣由: