文章出處為我的Java筆記 Blog,網址為http://myjavanote.blogspot.com/2008/05/eclipse33local-websphere-ap-server.html
以下為全文
即使網路上的消息是eclipse預計在2007Q3新增對Websphere AP server 6.1的支援 , 但直到現在在Eclipse中新增server時websphere都還是只有6.0可選擇。
經過Google神廟九十叩一百八十拜的努力後, 發現了下列連結文章:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=160220
https://bugs.eclipse.org/bugs/attachment.cgi?id=95764&action=diff
這裡將使用eclipse 3.3(2007Q4版,eclipse-jee-europa-winter-win32)作修改, 使之能支援publish 至WAS 6.1。
1. 首先打開 [eclipse目錄] \plugins\org.eclipse.jst.server.websphere.core_1.0.201.v20070608 目錄。
2. 將plugin.xml , plugin.properties, webspherecore.jar 三個檔案覆蓋到 該目錄中。(建議覆蓋前原本的三個檔案先作備份)
3. 將websphere.6.1.serverdef 放到該目錄下serverdef目錄, 將websphere.6.1.xml放到該目錄下serverdef \ scripts 目錄。
4. 開啟eclipse。
5.點選功能選單 window – preference , 點選 Server—installed Runtimes項目,如下圖:

6. 按下Add.. 按鈕 , 展開IBM項目, 你就會看到IBM WhebSphere V6.1
(如果沒看到IBM Websphere V6.1項目,而你確定你相關檔案都已經放了,那麼請關閉eclipse , 使用指令 eclipse –clean 來開啟就可以看到了)

,先不要按Finish,我們要設一下JRE,按下installed JRE preferencess。





12. Server type一樣選IBM WebSphere V6.1,下面的 server runtime選我們剛新增好的IBM WebSphere V6.1 ,點Next..



Buildfile: C:\Users\Dolph\Desktop\eclipse\plugins\org.eclipse.jst.server.websphere.core_1.0.201.v20070608\serverdef\scripts\websphere.6.1.xml
deploy.j2ee.ear:
[jar] Building jar: C:\Users\Dolph\Desktop\eclipse\ws\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\xxxxEAR.ear
[wsadmin] WASX7209I: 已利用 SOAP 連接器來連接 PCNode01 節點中的 "server1" 程序;程序類型是:UnManagedProcess
[wsadmin] ADMA5017I: 已開始解除安裝 xxxxEAR
[wsadmin] ADMA5104I: 已順利更新 WebSphere:cell=xx-PCNode01Cell,node=xx-PCNode01 的伺服器索引項目。
[wsadmin] ADMA5102I: 已順利從配置儲存庫中刪除xxxxEAR的配置資料。
[wsadmin] ADMA5011I: xxxxEAR應用程式的 temp 目錄清理完成。
[wsadmin] ADMA5106I: 已順利解除安裝應用程式 xxxxEAR
[wsadmin] WASX7209I: 已利用 SOAP 連接器來連接 xx-PCNode01 節點中的 "server1" 程序;程序類型是:UnManagedProcess
[wsadmin] ADMA5016I: 已開始安裝 xxxxEAR
[wsadmin] ADMA5058I: 用部署目標的版本來驗證應用程式和模組版本。
[wsadmin] ADMA5018I: 正在執行 EJBDeploy 指令來處理企業保存檔 (EAR) C:\Users\Dolph\AppData\Local\Temp\app7121.ear。
[wsadmin] Starting workbench.
最後, 經過測試可正常發佈EAR project ,沒辦法直接發佈dynamic web project, 所以記得新增enterprise application project把相關的dynamic web project加入成web module後再發佈…………………….
15. 對了, 還有件重要的事, 記得把專案內容Java Compiler中的compiler compliance level設為5.0(因為websphere內帶使用的JDK是1.5版的), 否則就算成功拋上server, 程式run 時還是會出錯喔。

16. 另外, 除了上列設定外, 在專案內容的Java Build Path中也要記得將IBM Websphere v6.1 server runtime加入libraries頁中喔, 不然也會導致編譯錯誤的問題喔。
沒有留言:
張貼留言