`
javafan_303
  • 浏览: 951018 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

weblogic9部署和将weblogic安装成windows服务

阅读更多
 

Weblogic9.2 部署<o:p></o:p>

要部署应用,请执行下列操作:<o:p></o:p>

1.           如果尚未执行此操作,请在管理控制台的更改中心中单击Lock&Edit<o:p></o:p>

2.           在控制台的左侧窗格中,单击Deployments文件夹。 <o:p></o:p>

3.           在右侧窗格中,单击Install <o:p></o:p>

4.           找到与希望安装的企业应用程序对应的 EAR 文件或展开的目录。如果指定展开的目录,则 WebLogic Server 会将找到的所有组件安装在指定目录中及目录下。单击应用程序左侧的圆。 <o:p></o:p>

5.           单击Next <o:p></o:p>

6.           选择Install this deployment as an application <o:p></o:p>

7.           单击Next <o:p></o:p>

8.           如果以前选定了该选项,将整个企业应用程序定位到同一个服务器,则会出现Select deployment targets窗口。。请执行下列操作: <o:p></o:p>

a.                  选择要对其部署的受管服务器。 <o:p></o:p>

b.                  单击Next <o:p></o:p>

9.           单击Next <o:p></o:p>

10.      检查已选择的配置设置,指定是否希望安装完后立即更新应用程序的配置,然后单击Finish完成安装。 <o:p></o:p>

11.      要激活这些更改,请在管理控制台的更改中心中单击Activate Changes
并非所有更改都立即生效。某些更改必须重新启动后才能生效<o:p></o:p>

<o:p> </o:p>

<o:p> </o:p>

Weblogic9.2 注册为windows服务<o:p></o:p>

    利用beasvc命令注册windows服务 <o:p></o:p>

在例如C:\bea\user_projects\domains\lng_7006\ 下建立installService.cmd文件<o:p></o:p>

<o:p> </o:p>

内容为:
    @rem *************************************************************************<o:p></o:p>

@rem This script is used to install WebLogic Server as a service for the <o:p></o:p>

@rem domain in the current working directory.  <o:p></o:p>

@rem<o:p></o:p>

@rem To create your own domain script, all you need to set is <o:p></o:p>

@rem SERVER_NAME, then call %WL_HOME%\server\bin\installSvc.cmd<o:p></o:p>

@rem<o:p></o:p>

@rem Other variables that installService takes are:<o:p></o:p>

@rem<o:p></o:p>

@rem WLS_USER     - cleartext user for server startup<o:p></o:p>

@rem WLS_PW       - cleartext password for server startup<o:p></o:p>

@rem PRODUCTION_MODE    - true for production mode servers, false for <o:p></o:p>

@rem                development mode<o:p></o:p>

@rem JAVA_OPTIONS - Java command-line options for running the server. (These<o:p></o:p>

@rem                will be tagged on to the end of the JAVA_VM and MEM_ARGS)<o:p></o:p>

@rem JAVA_VM      - The java arg specifying the VM to run.  (i.e. -server, <o:p></o:p>

@rem                -hotspot, etc.)<o:p></o:p>

@rem MEM_ARGS     - The variable to override the standard memory arguments<o:p></o:p>

@rem                passed to java<o:p></o:p>

@rem<o:p></o:p>

@rem For additional information, refer to the WebLogic Server Administration <o:p></o:p>

@rem Console Online Help(http://e-docs.bea.com/wls/docs81/ConsoleHelp/startstop.html)<o:p></o:p>

@rem *************************************************************************<o:p></o:p>

<o:p> </o:p>

echo off<o:p></o:p>

SETLOCAL<o:p></o:p>

<o:p> </o:p>

set WL_HOME=c:\bea\weblogic92<o:p></o:p>

<o:p> </o:p>

@rem Set Production Mode.  When this is set to true, the server starts up in<o:p></o:p>

@rem production mode.  When set to false, the server starts up in development<o:p></o:p>

@rem mode.  If it is not set, it will default to false.<o:p></o:p>

set PRODUCTION_MODE=<o:p></o:p>

<o:p> </o:p>

@rem Set JAVA_VENDOR to java virtual machine you want to run on server side.<o:p></o:p>

set JAVA_VENDOR=Sun<o:p></o:p>

<o:p> </o:p>

@rem Set JAVA_HOME to java virtual machine you want to run on server side.<o:p></o:p>

set JAVA_HOME=C:\Program Files\Java\jdk1.5.0_04<o:p></o:p>

<o:p> </o:p>

call "%WL_HOME%\common\bin\commEnv.cmd"<o:p></o:p>

<o:p> </o:p>

<o:p> </o:p>

@rem USERDOMAIN_HOME is preset to the domain directory.<o:p></o:p>

set USERDOMAIN_HOME=C:\bea\user_projects\domains\lng_7006<o:p></o:p>

<o:p> </o:p>

@rem Set SERVER_NAME to the name of the server you wish to start up.<o:p></o:p>

set SERVER_NAME=AdminServer<o:p></o:p>

<o:p> </o:p>

@rem Set DOMAIN_NAME to the name of the server you wish to start up.<o:p></o:p>

set DOMAIN_NAME=test<o:p></o:p>

<o:p> </o:p>

@rem Set WLS_USER equal to your system username and WLS_PW equal  <o:p></o:p>

@rem to your system password for no username and password prompt <o:p></o:p>

@rem during server startup.  Both are required to bypass the startup<o:p></o:p>

@rem prompt.<o:p></o:p>

set WLS_USER=weblogic<o:p></o:p>

set WLS_PW=weblogic<o:p></o:p>

<o:p> </o:p>

if NOT "%1" == "" set WLS_USER=%1<o:p></o:p>

if NOT "%2" == "" set WLS_PW=%2<o:p></o:p>

<o:p> </o:p>

if "%WLS_USER%" == "" goto usage<o:p></o:p>

if "%WLS_PW%" == ""  goto usage<o:p></o:p>

goto continue<o:p></o:p>

<o:p> </o:p>

:usage<o:p></o:p>

echo Need to set WLS_USER and WLS_PW environment variables or specify<o:p></o:p>

echo them in command line:<o:p></o:p>

echo Usage: installService.cmd [WLS_USER] [WLS_PW]<o:p></o:p>

echo for example:<o:p></o:p>

echo installService.cmd user password<o:p></o:p>

goto finish<o:p></o:p>

<o:p> </o:p>

:continue<o:p></o:p>

<o:p> </o:p>

@rem Set JAVA_OPTIONS to the java flags you want to pass to the vm. i.e.: <o:p></o:p>

@rem set JAVA_OPTIONS=-Dweblogic.attribute=value -Djava.attribute=value<o:p></o:p>

set JAVA_OPTIONS=<o:p></o:p>

<o:p> </o:p>

@rem Set JAVA_VM to the java virtual machine you want to run.  For instance:<o:p></o:p>

@rem set JAVA_VM=-server<o:p></o:p>

@rem set JAVA_VM=<o:p></o:p>

<o:p> </o:p>

@rem Set MEM_ARGS to the memory args you want to pass to java.  For instance:<o:p></o:p>

@rem set MEM_ARGS=-Xms32m -Xmx200m<o:p></o:p>

@rem set MEM_ARGS=<o:p></o:p>

<o:p> </o:p>

<o:p> </o:p>

@rem Check that the WebLogic classes are where we expect them to be<o:p></o:p>

:checkWLS<o:p></o:p>

if exist "%WL_HOME%\server\lib\weblogic.jar" goto checkJava<o:p></o:p>

echo The WebLogic Server wasn't found in directory %WL_HOME%\server.<o:p></o:p>

echo Please edit your script so that the WL_HOME variable points <o:p></o:p>

echo to the WebLogic installation directory.<o:p></o:p>

goto finish<o:p></o:p>

<o:p> </o:p>

@rem Check that java is where we expect it to be<o:p></o:p>

:checkJava<o:p></o:p>

if exist "%JAVA_HOME%\bin\java.exe" goto runWebLogic<o:p></o:p>

echo The JDK wasn't found in directory %JAVA_HOME%.<o:p></o:p>

echo Please edit your script so that the JAVA_HOME variable <o:p></o:p>

echo points to the location of your JDK.<o:p></o:p>

goto finish<o:p></o:p>

<o:p> </o:p>

:runWebLogic<o:p></o:p>

<o:p> </o:p>

@echo on<o:p></o:p>

<o:p> </o:p>

set CLASSPATH=%WEBLOGIC_CLASSPATH%;%CLASSPATH%<o:p></o:p>

<o:p> </o:p>

@echo ***************************************************<o:p></o:p>

@echo *  To start WebLogic Server, use the password     *<o:p></o:p>

@echo *  assigned to the system user.  The system       *<o:p></o:p>

@echo *  username and password must also be used to     *<o:p></o:p>

@echo *  access the WebLogic Server console from a web  *<o:p></o:p>

@echo *  browser.                                       *<o:p></o:p>

@echo ***************************************************<o:p></o:p>

<o:p> </o:p>

rem *** Set Command Line for service to execute within created JVM<o:p></o:p>

<o:p> </o:p>

@echo off<o:p></o:p>

<o:p> </o:p>

if "%ADMIN_URL%" == "" goto runAdmin<o:p></o:p>

@echo on<o:p></o:p>

set CMDLINE="%JAVA_VM% %MEM_ARGS% %JAVA_OPTIONS% -classpath \"%CLASSPATH%\" -Dweblogic.Name=%SERVER_NAME% -Dweblogic.management.username=%WLS_USER% -Dweblogic.management.server=\"%ADMIN_URL%\" -Dweblogic.ProductionModeEnabled=%PRODUCTION_MODE% -Djava.security.policy=\"%WL_HOME%\server\lib\weblogic.policy\" weblogic.Server"<o:p></o:p>

goto installSvc<o:p></o:p>

<o:p> </o:p>

:runAdmin<o:p></o:p>

@echo on<o:p></o:p>

set CMDLINE="%JAVA_VM% %MEM_ARGS% %JAVA_OPTIONS% -classpath \"%CLASSPATH%\" -Dweblogic.Name=%SERVER_NAME% -Dweblogic.management.username=%WLS_USER% -Dweblogic.ProductionModeEnabled=%PRODUCTION_MODE% -Djava.security.policy=\"%WL_HOME%\server\lib\weblogic.policy\" weblogic.Server"<o:p></o:p>

<o:p> </o:p>

:installSvc<o:p></o:p>

rem *** Set up extrapath for win32 and win64 platform separately<o:p></o:p>

if not "%WL_USE_64BITDLL%" == "true" set EXTRAPATH=%WL_HOME%\server\bin;%JAVA_HOME%\jre\bin;%JAVA_HOME%\bin;%WL_HOME%\server\bin\oci920_8<o:p></o:p>

<o:p> </o:p>

if "%WL_USE_64BITDLL%" == "true" set EXTRAPATH=%WL_HOME%\server\bin\win64;%WL_HOME%\server\bin;%JAVA_HOME%\jre\bin;%JAVA_HOME%\bin;%WL_HOME%\server\bin\win64\oci920_8<o:p></o:p>

<o:p> </o:p>

rem *** Install the service<o:p></o:p>

"%WL_HOME%\server\bin\beasvc" -install -svcname:"beasvc_%DOMAIN_NAME%_%SERVER_NAME%" -javahome:"%JAVA_HOME%" -execdir:"%USERDOMAIN_HOME%" -extrapath:"%EXTRAPATH%" -password:"%WLS_PW%" -cmdline:%CMDLINE% -log:"test.log"<o:p></o:p>

<o:p> </o:p>

:finish<o:p></o:p>

ENDLOCAL<o:p></o:p>

<o:p> </o:p>

<o:p> </o:p>

以上加红的为需修改的地方:

       set JAVA_HOME=C:\Program Files\Java\jdk1.5.0_04 jdk环境<o:p></o:p>

    set USERDOMAIN_HOME=C:\bea\user_projects\domains\lng_7006 为部署的目录<o:p></o:p>

set SERVER_NAME=AdminServer  此处为发布的server名称(*必需与发布的server名称相同,区分大小写)<o:p></o:p>

       set DOMAIN_NAME=test 可自定义名称<o:p></o:p>

    set WLS_USER=weblogic weblogic用户名<o:p></o:p>

set WLS_PW=weblogic 密码<o:p></o:p>

<o:p> </o:p>

执行脚本后生成的服务名为<o:p></o:p>

       Beasvc_test_AdminServer<o:p></o:p>

<o:p> </o:p>

卸载服务命令:<o:p></o:p>

       C:\bea\weblogic92\server\bin\beasvc –remove –svcname:”服务名”<o:p></o:p>

评论
1 楼 marsjin 2007-10-12  
看到你的文章,很高兴
可是我注册成服务,不能够正常启动!

这是错误信息:
<Server failed. Reason:

There are 1 nested errors:

weblogic.management.ManagementException: [Management:141223]The server name Weblogic92AsServer specified with -Dweblogic.Name does not exist. The configuration includes the following servers {AdminServer}.
at weblogic.management.provider.internal.RuntimeAccessImpl.<init>(RuntimeAccessImpl.java:144)
at weblogic.management.provider.internal.RuntimeAccessService.start(RuntimeAccessService.java:38)
at weblogic.t3.srvr.ServerServicesManager.startService(ServerServicesManager.java:374)
at weblogic.t3.srvr.ServerServicesManager.startInStandbyState(ServerServicesManager.java:125)
at weblogic.t3.srvr.T3Srvr.initializeStandby(T3Srvr.java:630)
at weblogic.t3.srvr.T3Srvr.startup(T3Srvr.java:402)
at weblogic.t3.srvr.T3Srvr.run(T3Srvr.java:361)
at weblogic.Server.main(Server.java:67)

>

如果您能够帮忙,请回复:marsjin@sina.com

相关推荐

Global site tag (gtag.js) - Google Analytics