分別用命令行、NetBeans IDE 8.2實現firstcup 項目部署

準備工做要搞好,對吧!(以下:)java

  • firstcup項目代碼文件下載連接:click me~
  • NetBeans IDE 8.2下載連接:點我~(ps:建議下載此版本,再安裝過程當中,要選擇安裝GlassFish服務器插件(至於Tomcat服務器插件要不要安裝,隨你);高版本的NetBeans IDE 9.x 或10.x 已默認不自帶安裝Glassfish 服務器插件。)
  • glassfish-5.0-web.zip
  • apache-maven-3.6.0-bin.zip

ps:配置環境變量已在其餘博文中描述。git

  1. 經過NetBeans IDE 8.2實現firstcup 項目部署

①文件(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.

 

緣由:

相關文章
相關標籤/搜索