weblogic小記

weblogic整理java

這兩天研究了下weblogic部署web項目,固然瞭解的仍是皮毛不夠深刻,僅在此作下記錄,爲之後的工做和學習提供參考。web

首先我從oracle上下載了一個oracle的簡單的版原本作下簡單的學習(能夠在開發上用) fmw_12.2.1.0.0_wls_quick_Disk1_1of1.zip解壓以後實際上只有一個jar包和txt文件。固然這個測試版本要求的jdk是1.8以上,若是用低於1.8的版本的話,會有問題致使啓動不成功。所以在這裏若是使用jdk的版本較低,下載些低版本的壓縮包來進行測試。shell

在readme.txt文件中有相關的操做步驟,具體參考以下:api

 

Oracle WebLogic Server 12.2.1  Quick Installer瀏覽器

==========================================================================================oracle


The Oracle WebLogic Server 12.2.1 Quick Installer is a lightweight installer that contains all the necessary artifacts to develop and test applications on Oracle WebLogic Server 12.2.1.  The Quick Installer does not have a user interface and is run directly from command line. The Quick Installer is supported on Windows, Linux and Mac OS X systems. Installations performed with the Quick Installer can be patched using standard Oracle Patching tool, OPatch.app


An optional supplemental quick installer (fmw_12.2.1.0.0_wls_supplemental_quick.jar) is available as a separate download and contains additional, non essential components such as the sample set, the Http Pub-Sub server and L10N console help files.dom

This version of Oracle WebLogic Server and the Quick Installer require the use of JDK 1.8.  Ensure that you have the proper JDK version installed and ready for use before starting.jsp


QUICKSTARTide


1. Setup JAVA_HOME for the target platform.


2. If running on Windows you will need to run as Administrator.


3. Run the Quick Installer jar file and specify values are desired to define where the installation will be performed.  Some examples of running the Quick Installer are:


   $ java -jar fmw_12.2.1.0.0_wls_quick.jar


   This will use the current working directory as the ORACLE_HOME in which to install WebLogic Server. You must make sure that the current working directory (ORACLE_HOME) does not contain an existing wls12210 directory.


   $ java -jar fmw_12.2.1.0.0_wls_quick.jar ORACLE_HOME=<location>


  This will use the specified ORACLE_HOME as the directory in which to install WebLogic Server.

  

4. To see the full set of options available to run the Quick Installer specify the -help command when running it:


    $ java -jar fmw_12.2.1.0.0_wls_quick.jar -help


CONFIGURE AN ORACLE WEBLOGIC SERVER DOMAIN


Once the Quick Install has completed and installed Oracle WebLogic Server, a domain will need to be manually created. A domain can be created directly from the command line or it can be created using the Configuration Wizard.


CREATING A DOMAIN WITH THE CONFIGURATION WIZARD


Launch the Configuration Wizard


Linux $ . <ORACLE_HOME>/oracle_common/common/bin/config.sh


Mac $ . <ORACLE_HOME>/oracle_common/common/bin/config.sh


Windows > <ORACLE_HOME>\oracle_common\common\bin\config.cmd


CREATING A DOMAIN FROM THE COMMAND LINE


1. Setup WebLogic Server environment in the current shell.


Linux $ . <ORACLE_HOME>/wlserver/server/bin/setWLSEnv.sh


Mac $ . <ORACLE_HOME>/wlserver/server/bin/setWLSEnv.sh


Windows > <ORACLE_HOME>\wlserver\server\bin\setWLSEnv.cmd


2. Create a new directory to store the domain and start the server.


Linux  

$ mkdir domain

$ cd domain

$ JAVA_HOME/bin/java weblogic.Server


Mac

$ mkdir domain

$ cd domain

$ $JAVA_HOME/bin/java weblogic.Server


Windows

>  mkdir domain

>  cd domain

> %JAVA_HOME%\bin\java.exe  weblogic.Server


Once the domain is created, you should shutdown the server and restart it with the scripts provided in the newly created domain.  This will start the associated Derby database instance that is provided to make development easier with the Java EE 7 default datasource definition and operate as a default Job Repository for the Batch API.


REMOVE INSTALLATION


Delete the ORACLE_HOME directory.  If you have created domains or extracted Supplemental Quick Install, those files will be removed as well. 


WHAT IS NOT INCLUDED IN THE QUICK INSTALLER


- Native JNI libraries for unsupported platforms.

- Samples, non-english console help (can be added by using the WLS supplemental Quick Install)

- Oracle Configuration Manager (OCM) is not included in the Quick installer

- SCA is not included in the Quick Installer

 


作完一個簡單的安裝以後,咱們嘗試下來部署項目。由於咱們安裝的這個版本和真正的安裝到生產環境中的版本仍是有區別的,所以啓動的時候咱們只需找到啓動腳本就能夠。

找到安裝目錄下的startWebLogic.cmd來雙擊啓動。啓動過程當中會要求輸入用戶名/密碼(安裝的時候事先設置好的)。


 


以後在瀏覽器中輸入相關地址,出現登陸界面,輸入用戶名/密碼(同上一致)

 


這一次咱們在界面上部署一個web項目來測試一下

1)點擊部署,此時定製列表中沒有任何已經部署的項目

2)點擊鎖定並編輯,咱們來部署一個項目

 

3)點擊部署下面的"安裝"按鈕,來選擇war包的路徑,前提是咱們已經事先準備好了一個war包,而後點擊下一步

 

 

 

4)安裝完成

  

此時已經完成了部署,可是咱們要訪問咱們的項目還須要先將項目啓動

5)點擊控制一欄,出現已經部署完成的項目列表

6)選中項目而後,選擇相應的啓動項。

7)若是啓動成功,健康情況一欄會顯示「正常」。

 


8)此時咱們就能夠在瀏覽器中訪問咱們的項目了,如:訪問fileuploadanddownload

http://localhost:7001/fileuploadanddownload/jsp/multifile_upload.jsp

而後簡單的操做一下看下是否成功,就ok了。


 


備註:在啓動的時候可能遇到的問題及方案,若是遇不到最好。

java.lang.ClassCastException: com.sun.faces.application.WebAppLifecycleListener cannot be cast to java.util.EventListener

解決方案:

 Web工程的lib目錄下找到jsf-api.jar、jsf-impl.jar將其刪除,便可。

           如若還有問題再試着刪除jstl-1.2.jar文件。

     從新啓動weblogic成功。

相關文章
相關標籤/搜索