配置 WebLogic 9.2
安裝 WebLogic 比較容易,在這里就不再累述了,大家可以參閱相關文檔?,F在著重講一下 WebLogic 的配置,因為后面在配置 MyEclipse 時將用到這里的配置信息。
①運行開始 -> 程序 -> BEA Products -> Tools -> Configuration Wizard。
②選擇 Create a new WebLogic domain,Next。
③在 Select Domain Source 界面保持默認,Next。
④在 User name 處輸入 user,兩個 password 都輸入 12345678(密碼要求 8 位),Next。
⑤ 在 Configure Server Start Mode and JDK 界面中保持默認,即 JDK 選擇的是“Sun SDK 1.5.0_04 @ C:\BEA\jdk150_04”,注意這里若選擇“Other JDK”配置比 SDK 1.5.0_04 更高的版本,服務器啟動時將會出現異常,所以最好保持默認,然后 Next。
⑥在 Customize Environment and Services Settings 界面中默認為 No,Next。
⑦在 Domain name 處輸入 mydomain,點擊 Create。
⑧完成后點擊 Done 關閉 Configuration Wizard 對話框。
⑨ 運行開始 -> 程序 -> BEA Products -> User Projects -> mydomain -> Start Admin Server for Weblogic Server Domain,檢查服務器是否啟動成功。
配置 MyEclipse 的 WebLogic 9 服務器
啟動 Eclipse,選擇“Window -> Preferences”菜單,打開首選項對話框。展開 MyEclipse 下的 Application Servers 節點,點擊 WebLogic 9,選中右邊的 Enable 單選按鈕,啟用 WebLogic 服務器。配置如下:
①BEA home directory:C:\BEA(假定 WebLogic 安裝在 C:\BEA 目錄中)
②WebLogic installation directory:C:\BEA\WebLogic92
③Admin username:user(來自 WebLogic 中的配置)
④Admin password:12345678(來自 WebLogic 中的配置)
⑤Execution domain root:C:\BEA\user_projects\domains\mydomain
⑥Execution server name:AdminServer
⑦Security policy file:C:\BEA\WebLogic92\server\lib\weblogic.policy
⑧JAAS login configuration file:(Null)
接著展開 WebLogic 9 節點,點擊 JDK,在右邊的 WLS JDK name 處選擇 WebLogic 9 的默認 JDK。這里組合框中缺省為單獨安裝的 JRE。單擊 Add 按鈕,彈出 WebLogic -> Add JVM 對話框,在 JRE 主目錄處選擇 WebLogic 安裝文件夾中的 JDK 文件夾,我的版本為 C:\BEA\jdk150_04,程序會自動填充其他選項。單擊確定按鈕關閉對話框。這時候就可以在 WLS JDK name 組合框中選擇 jdk150_04 了。
至此,MyEclipse 中 WebLogic 9 的配置工作就算完成了。下面可以看看在 Eclipse 中能否啟動 WebLogic 服務器了?安裝了 MyEclipse 之后,Eclipse 工具欄中就會有一個“Run/Stop/Restart MyEclipse Application Servers”下拉按鈕。點擊該按鈕的下拉部分,選擇“WebLogic 9 -> Start”菜單,即開始啟動 WebLogic 了。通過查看控制臺的消息,就可以檢查啟動是否成功,或發生什么異常。
對常見啟動問題
出現 The WebLogic Server did not start up properly. 提示和 java.io.InvalidClassException 異常的問題,通常是因為 JDK 選擇不當引起的,在 MyEclipse 的配置中選擇的 JDK 應該必須與配置 WebLogic 時選擇的 JDK 相同。當選擇默認 JDK 時,也可以在 MyEclipse 中配置 BEA 的 jrockit90_150_04 這個 JDK。