沒有IE的日子現在真是不方便,看看Mouse&Window給我們帶來的便利。不扯蛋了,說正題。
WebLogic為我們提供了weblogic.Deployer這個Class來進行deploy的工作,即使在我們沒有browser的情況下也可以發布程序,當然我上一篇BLOG中有講text browser--Lynx,發現還真的不是很好用,有些功能還不知道怎么用,比如核對框就不知道怎么選中。
先來看個實例,我發布時用到的具體命令如下:
wlslib=/export/home/bea/weblogic/weblogic81/server/lib
export wlslib
java -cp $wlslib/weblogic.jar:$wlslib/wlepool.jar:$wlslib/wleorb.jar weblogic.Deployer -adminurl iiop://localhost:7001/ -username weblogic -password weblogic -targets CMSServer -deploy /export/home/bea/weblogic/user_projects/domains/mydomain/cms
當然你也可以不像我這樣,只要確保weblogic.jar,wlepool.jar,wleorb.jar在classpath中即可。
看到了吧,其實很簡單,下面來看看這個命令的參數:
Usage: java weblogic.Deployer [options] [actions] [File(s)]
where options include:
??? -adminurl <<protocol>://<server>:<port>> Administration server URL:
????????????????????? default iiop://localhost:7001
??? -username <username> user name
??? -password <password> password for the user
??? -examples???????? Displays example usage of this tool.
??? -name <application name> Defaults to the basename of the deployment
????????????????????? file or directory.
??? -targets <<target(s)>> A comma separated list of targets for the
????????????????????? current operation. If not specified, all
????????????????????? configured targets are used. For a new
????????????????????? application, the default target is the
????????????????????? administration server.
??? -deploy?????????? Make an application available for service.
??? -redeploy???????? Replace a running application partially or
????????????????????? entirely.
??? -undeploy???????? Take an application out of service.
再來看看一些官方的examples吧:
(執行如下命令可得:java -cp $wlslib/weblogic.jar:$wlslib/wlepool.jar:$wlslib/wleorb.jar weblogic.Deployer -examples)
Deploy application on admin server:
java weblogic.Deployer -adminurl url -username username -password password
-name myapp -deploy c:/myapps/myapp.ear
Deploy individual modules in application to different targets:
java weblogic.Deployer -adminurl url -username username -password password
-name myapp -targets mywar@webserver,myjar@ejbserver -deploy
c:/myapps/myapp.ear
Undeploy application from specified targets:
java weblogic.Deployer -adminurl url -username username -password password
-name myapp -undeploy -targets server1,server2..
Redeploy application on current targets:
java weblogic.Deployer -adminurl url -username username -password password
-name myapp -redeploy
Redeploy individual module in an application:
java weblogic.Deployer -adminurl url -username username -password password
-name myapp -redeploy -targets moduleA@serverA,moduleA@serverB
Partially redeploy, for example, to update a JSP in a exploded webapp:
java weblogic.Deployer -adminurl url -username username -password password
-name myapp -redeploy mywar/index.jsp
??????? The path of JSP to be updated is relative to the root of the
??????? application. If a directory is specified the entire subtree is updated.
Multiple servers sharing the same physical deployment:
java weblogic.Deployer -adminurl url -username username -password password
-name myapp -targets server1,server2 -nostage -deploy c:/myapps/myapp.ear
??????? The -nostage option indicates that the application is available
??????? on all target servers at the same path and hence server should not copy
??????? files to the managed servers.???
這些英文都很簡單,相信不用再多說了。
附:
1、你可能在發布時遇到這個問題:
?<Error> <Management> <BEA-141150> <An error occurred while preparing application component of application Adquira:Location=ServerDC1,Name=adquira,Type=ApplicationConfig with HTTP response 500: Internal Server Error ).>
出現此問題的原因是因為發布的對象超過了200M.
2、這幾天用Solaris的命令行用太多了,沒辦法,現在在Windows下BackSpace鍵都習慣性的去按Delete鍵了。嘻嘻??:)
以上所用版本為WLS8.1SP5。