我的环境:

windows: win10 professional edition

jdk: C:\Program Files\Java\jdk1.6.0_45

weblogic安装目录 (WEBLOGIC_HOME): C:\Oracle\Middleware\wlserver_10.3

weblogic域目录 (DOMAIN_HOME): C:\Oracle\Middleware\user_projects\domains\base_domain

weblogic版本: weblogic 11g (10.3.6 version)

准备工作:

weblogic安装完以后,为了安全,我们先备份一份WEBLOGIC_HOME\server\bin文件夹(初始只有2Mb大小)

开始

修改WEBLOGIC_HOME\server\bin\installSvc.cmd文件

原始语句:

set WL_HOME=C:\Oracle\Middleware\wlserver_10.3
call "%WL_HOME%\common\bin\commEnv.cmd"

在以上语句后追加,特别注意每个set的变量都要新起一行

@rem ******************************************************
@rem jdk安装目录
set JAVA_HOME=C:\Program Files\Java\jdk1.6.0_45
@rem 域名称
set DOMAIN_NAME=base_domain
@rem 管理服务器的名称
set SERVER_NAME=AdminServer
@rem 创建域的的实际目录地址
set USERDOMAIN_HOME=C:\Oracle\Middleware\user_projects\domains\base_domain
@rem 创建域的的实际目录地址
set DOMAIN_HOME=C:\Oracle\Middleware\user_projects\domains\base_domain
@rem 用户名
set WLS_USER=weblogic
@rem 密码
set WLS_PW=weblogic123
@rem JVM选项配置
set JAVA_OPTIONS=%JAVA_OPTIONS% -Dfile.encoding=utf-8 -Dweblogic.Stdout="C:/Oracle/Middleware/logs/stdout.txt" -Dweblogic.Stderr="C:/Oracle/Middleware/logs/stderr.txt"
@rem 内存参数
set MEM_ARGS=-Xms512m -Xmx1024m -XX:MaxPermSize=256m
@rem *******************************************************

以管理员身份运行installSvc.cmd.

Win+R手动输入services.msc打开服务,确认beasvc base_domain_AdminServer这个服务是否存在.

开一个cmd窗口,切换目录到WEBLOGIC_HOME\server\bin\

调试刚准备好的服务,输入beasvc.exe -debug "beasvc base_domain_AdminServer"

C:\Oracle\Middleware\wlserver_10.3\server\bin>beasvc.exe -debug "beasvc base_domain_AdminServer"

Debugging service ....... beasvc base_domain_AdminServer

Command Line: ....... -client -Xms512m -Xmx1024m -XX:MaxPermSize=256m  -Xverify:none -Dfile.encoding=utf-8 -Dweblogic.Stdout=C:/Oracle/Middleware/logs/stdout.tx
t -Dweblogic.Stderr=C:/Oracle/Middleware/logs/stderr.txt -classpath "C:\Oracle\MIDDLE~1\patch_wls1036\profiles\default\sys_manifest_classpath\weblogic_patch.jar
;C:\Oracle\MIDDLE~1\patch_ocp371\profiles\default\sys_manifest_classpath\weblogic_patch.jar;C:\PROGRA~1\Java\JDK16~1.0_4\lib\tools.jar;C:\Oracle\MIDDLE~1\WLSERV
~1.3\server\lib\weblogic_sp.jar;C:\Oracle\MIDDLE~1\WLSERV~1.3\server\lib\weblogic.jar;C:\Oracle\MIDDLE~1\modules\features\weblogic.server.modules_10.3.6.0.jar;C
:\Oracle\MIDDLE~1\WLSERV~1.3\server\lib\webservices.jar;C:\Oracle\MIDDLE~1\modules\ORGAPA~1.1/lib/ant-all.jar;C:\Oracle\MIDDLE~1\modules\NETSFA~1.0_1/lib/ant-co
ntrib.jar;.;$JAVA_HOME/lib/dt.jar;$JAVA_HOME/lib/tools.jar" -Dweblogic.Name=AdminServer -Dweblogic.management.username=weblogic -Dweblogic.ProductionModeEnabled
= -Djava.security.policy="C:\Oracle\MIDDLE~1\WLSERV~1.3\server\lib\weblogic.policy" weblogic.Server Current Directory: ....... C:\Oracle\Middleware\user_projects\domains\base_domain Path: ....... C:\Oracle\MIDDLE~1\WLSERV~1.3\server\native\win\x64\;C:\Oracle\MIDDLE~1\WLSERV~1.3\server\bin;C:\Program Files\Java\jdk1.6.0_45\jre\bin;C:\Program
Files\Java\jdk1.6.0_45\bin;C:\Oracle\MIDDLE~1\WLSERV~1.3\server\native\win\x64\oci920_8;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\Syst
em32\WindowsPowerShell\v1.0\;C:\Program Files\Java\jdk1.6.0_45/bin;
Java Home: ....... C:\Program Files\Java\jdk1.6.0_45 Delay: ....... 0 Thread created successfully!
Unrecognized option: -client Error in java application ....... The following line contains specific error details .......
Unable to initialize the Java virtual machine!
C:\Oracle\Middleware\wlserver_10.3\server\bin>

发现是虚拟机问题,多了一个-client启动参数.

Win+R手动输入regedit打开注册表, 定位HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\beasvc BASE_DOMAIN_AdminServer\Parameters, 在CmdLine这个属性处删掉最前面的-client.

再次在cmd界面输入输入beasvc.exe -debug "beasvc base_domain_AdminServer"一般是正常启动了,但这个时候会显示乱码.

因为cmd界面默认GBK显示,weblogic正常启动输出日志很可能为乱码,因为在开始设置了-Dfile.encoding=utf-8所以导致了编码不一致.

改变cmd界面以UTF-8显示,在任意cmd中输入chcp 65001 改成UTF-8窗口,且改变窗口显示风格成Lucida Console

再启动就不乱码了

C:\Oracle\Middleware\wlserver_10.3\server\bin>beasvc.exe -debug "beasvc base_domain_AdminServer"

Debugging service ....... beasvc base_domain_AdminServer

Command Line: ....... -Xms512m -Xmx1024m -XX:MaxPermSize=256m  -Xverify:none -Dfile.encoding=utf-8 -Dweblogic.Stdout=C:/Oracle/Middleware/logs/stdout.txt -Dwebl
ogic.Stderr=C:/Oracle/Middleware/logs/stderr.txt -classpath "C:\Oracle\MIDDLE~1\patch_wls1036\profiles\default\sys_manifest_classpath\weblogic_patch.jar;C:\Orac
le\MIDDLE~1\patch_ocp371\profiles\default\sys_manifest_classpath\weblogic_patch.jar;C:\PROGRA~1\Java\JDK16~1.0_4\lib\tools.jar;C:\Oracle\MIDDLE~1\WLSERV~1.3\ser
ver\lib\weblogic_sp.jar;C:\Oracle\MIDDLE~1\WLSERV~1.3\server\lib\weblogic.jar;C:\Oracle\MIDDLE~1\modules\features\weblogic.server.modules_10.3.6.0.jar;C:\Oracle
\MIDDLE~1\WLSERV~1.3\server\lib\webservices.jar;C:\Oracle\MIDDLE~1\modules\ORGAPA~1.1/lib/ant-all.jar;C:\Oracle\MIDDLE~1\modules\NETSFA~1.0_1/lib/ant-contrib.ja
r;.;$JAVA_HOME/lib/dt.jar;$JAVA_HOME/lib/tools.jar" -Dweblogic.Name=AdminServer-Dweblogic.management.username=weblogic -Dweblogic.ProductionModeEnabled= -Djava
.security.policy="C:\Oracle\MIDDLE~1\WLSERV~1.3\server\lib\weblogic.policy" weblogic.Server Current Directory: ....... C:\Oracle\Middleware\user_projects\domains\base_domain Path: ....... C:\Oracle\MIDDLE~1\WLSERV~1.3\server\native\win\x64\;C:\Oracle\MIDDLE~1\WLSERV~1.3\server\bin;C:\Program Files\Java\jdk1.6.0_45\jre\bin;C:\Program
Files\Java\jdk1.6.0_45\bin;C:\Oracle\MIDDLE~1\WLSERV~1.3\server\native\win\x64\oci920_8;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\Syst
em32\WindowsPowerShell\v1.0\;C:\Program Files\Java\jdk1.6.0_45/bin; Java Home: ....... C:\Program Files\Java\jdk1.6.0_45 Delay: ....... 0 Thread created successfully!
<2017-11-17 下午07时36分06秒 CST> <Info> <Security> <BEA-090905> <Disabling CryptoJ JCE Provider self-integrity check for better startup performance. To enable this
check, specify -Dweblogic.security.allowCryptoJDefaultJCEVerification=true>n=true>
<2017-11-17 下午07时36分06秒 CST> <Info> <Security> <BEA-090906> <Changing the default Random Number Generator in RSA CryptoJ from ECDRBG to FIPS186PRNG. To disable
this change, specify -Dweblogic.security.allowCryptoJDefaultPRNG=true>G=true>
<2017-11-17 下午07时36分08秒 CST> <Info> <WebLogicServer> <BEA-000377> <Starting WebLogic Server with Java HotSpot(TM) 64-Bit Server VM Version 20.45-b01 from Sun Mi
crosystems Inc.>s Inc.>
<2017-11-17 下午07时36分09秒 CST> <Info> <Management> <BEA-141107> <Version: WebLogic Server 10.3.6.0 Tue Nov 15 08:52:36 PST 2011 1441050 >41050 >
<2017-11-17 下午07时36分10秒 CST> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to STARTING>ARTING>
<2017-11-17 下午07时36分10秒 CST> <Info> <WorkManager> <BEA-002900> <Initializing self-tuning thread pool>d pool>

虽然卡在<Initializing self-tuning thread pool>d pool>这句话这里,但其实已经正常启动了.现在就可以去找开控制台http://localhost:7001/console登录了.

在以上步骤都成功以后,关掉cmd,去服务那里手动启动beasvc base_domain_AdminServer服务,让服务变成已启动就OK了,以后windows重启系统后会自动把weblogic 管理控制台一并启动.

附我的installSvc.cmd实际配置

@rem *************************************************************************
@rem This script is used to install WebLogic Server as a Windows Service.
@rem
@rem To create your own start script for your domain, simply set the
@rem SERVER_NAME variable to your server name then call this script from your
@rem domain directory.
@rem
@rem This script sets the following variables before installing
@rem WebLogic Server as a Windows Service:
@rem
@rem WL_HOME - The root directory of your WebLogic installation
@rem JAVA_HOME - Location of the version of Java used to start WebLogic
@rem Server. This variable must point to the root directory of a
@rem JDK installation and will be set for you by the installer.
@rem See the Oracle Fusion Middleware Supported System Configurations page
@rem (http://www.oracle.com/technology/software/products/ias/files/fusion_certification.html)
@rem for an up-to-date list of supported JVMs.
@rem PATH - Adds the JDK and WebLogic directories to the system path.
@rem CLASSPATH - Adds the JDK and WebLogic jars to the classpath.
@rem
@rem Other variables that installSvc takes are:
@rem
@rem WLS_USER - admin username for server startup
@rem WLS_PW - cleartext password for server startup
@rem ADMIN_URL - if this variable is set, the server started will be a
@rem managed server, and will look to the url specified (i.e.
@rem http://localhost:7001) as the admin server.
@rem PRODUCTION_MODE - set to true for production mode servers, false for
@rem development mode
@rem JAVA_OPTIONS - Java command-line options for running the server. (These
@rem will be tagged on to the end of the JAVA_VM and MEM_ARGS)
@rem JAVA_VM - The java arg specifying the VM to run. (i.e. -server,
@rem -client, etc.)
@rem MEM_ARGS - The variable to override the standard memory arguments
@rem passed to java
@rem
@rem
@rem MAX_CONNECT_RETRIES - Number of attempts the Windows Service will make to check
@rem if the Weblogic Server is started. If this variable
@rem is specified along with HOST and PORT, the Windows Service will
@rem wait until the Weblogic Server is started.
@rem HOST - IP address of the Weblogic Server
@rem PORT - Port number where the WebLogic Server is listening for requests
@rem
@rem jDriver for Oracle users: This script assumes that native libraries
@rem required for jDriver for Oracle have been installed in the proper
@rem location and that your system PATH variable has been set appropriately.
@rem
@rem For additional information, refer to "Managing Server Startup and Shutdown for Oracle WebLogic Server"
@rem (http://download.oracle.com/docs/cd/E23943_01/web.1111/e13708/overview.htm).
@rem ************************************************************************* @echo off
SETLOCAL set WL_HOME=C:\Oracle\Middleware\wlserver_10.3
call "%WL_HOME%\common\bin\commEnv.cmd" @rem ******************************************************
@rem jdk安装目录
set JAVA_HOME=C:\Program Files\Java\jdk1.6.0_45
@rem 域名称
set DOMAIN_NAME=base_domain
@rem 管理服务器的名称
set SERVER_NAME=AdminServer
@rem 创建域的的实际目录地址
set USERDOMAIN_HOME=C:\Oracle\Middleware\user_projects\domains\base_domain
@rem 创建域的的实际目录地址
set DOMAIN_HOME=C:\Oracle\Middleware\user_projects\domains\base_domain
@rem 用户名
set WLS_USER=weblogic
@rem 密码
set WLS_PW=weblogic123
@rem JVM选项配置
set JAVA_OPTIONS=%JAVA_OPTIONS% -Dfile.encoding=utf-8 -Dweblogic.Stdout="C:/Oracle/Middleware/logs/stdout.txt" -Dweblogic.Stderr="C:/Oracle/Middleware/logs/stderr.txt"
@rem 内存参数
set MEM_ARGS=-Xms512m -Xmx1024m -XX:MaxPermSize=256m
@rem ******************************************************* @rem Check that the WebLogic classes are where we expect them to be
:checkWLS
if exist "%WL_HOME%\server\lib\weblogic.jar" goto checkJava
echo The WebLogic Server wasn't found in directory %WL_HOME%\server.
echo Please edit your script so that the WL_HOME variable points
echo to the WebLogic installation directory.
goto finish @rem Check that java is where we expect it to be
:checkJava
if exist "%JAVA_HOME%\bin\java.exe" goto runWebLogic
echo The JDK wasn't found in directory %JAVA_HOME%.
echo Please edit your script so that the JAVA_HOME variable
echo points to the location of your JDK.
goto finish :runWebLogic if not "%JAVA_VM%" == "" goto noResetJavaVM
if "%JAVA_VENDOR%" == "BEA" set JAVA_VM=-jrocket
if "%JAVA_VENDOR%" == "HP" set JAVA_VM=-server
if "%JAVA_VENDOR%" == "Sun" set JAVA_VM=-server :noResetJavaVM
if not "%MEM_ARGS%" == "" goto noResetMemArgs
set MEM_ARGS=-Xms32m -Xmx200m :noResetMemArgs @echo on set CLASSPATH=%WEBLOGIC_CLASSPATH%;%CLASSPATH% @echo ***************************************************
@echo * To start WebLogic Server, use the password *
@echo * assigned to the system user. The system *
@echo * username and password must also be used to *
@echo * access the WebLogic Server console from a web *
@echo * browser. *
@echo *************************************************** rem *** Set Command Line for service to execute within created JVM @echo off if "%ADMIN_URL%" == "" goto runAdmin
@echo on
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"
goto finish :runAdmin
@echo on
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" :finish
rem *** Set up extrapath for win32 and win64 platform separately
if "%WL_USE_X86DLL%" == "true" set EXTRAPATH=%WL_HOME%\server\native\win\32;%WL_HOME%\server\bin;%JAVA_HOME%\jre\bin;%JAVA_HOME%\bin;%WL_HOME%\server\native\win\32\oci920_8 if "%WL_USE_IA64DLL%" == "true" set EXTRAPATH=%WL_HOME%\server\native\win\64\;%WL_HOME%\server\bin;%JAVA_HOME%\jre\bin;%JAVA_HOME%\bin;%WL_HOME%\server\native\win\64\oci920_8 if "%WL_USE_AMD64DLL%" == "true" set EXTRAPATH=%WL_HOME%\server\native\win\x64\;%WL_HOME%\server\bin;%JAVA_HOME%\jre\bin;%JAVA_HOME%\bin;%WL_HOME%\server\native\win\x64\oci920_8 rem *** Install the service
"%WL_HOME%\server\bin\beasvc" -install -svcname:"beasvc %DOMAIN_NAME%_%SERVER_NAME%" -javahome:"%JAVA_HOME%" -execdir:"%USERDOMAIN_HOME%" -maxconnectretries:"%MAX_CONNECT_RETRIES%" -host:"%HOST%" -port:"%PORT%" -extrapath:"%EXTRAPATH%" -password:"%WLS_PW%" -cmdline:%CMDLINE% ENDLOCAL

卸载windows服务

本方法为通用方法,不仅限于weblogic.

在服务界面,右击-->属性-->复制weblogic的服务名称 beasvc base_domain_AdminServer, 先关掉服务,以管理员身份启动cmd界面,输入sc delete "beasvc base_domain_AdminServer" 删除weblogic服务.

其它方式(使用任务计划启动weblogic):

Weblogic Server 启动脚本

主要参考:

weblogic10.3.6 自动启动服务后停止的解决方案 (极佳)

WEBLOGIC注册为WINDOWS的系统服务项

windows环境安装weblogic服务【转】【补】的更多相关文章

  1. 图解Windows下安装WebLogic

    Oracle 的Weblogic分开发者版本和生产版本,有32位和64位.一般生产版本的weblogic是64位的,安装文件是一个大小为1G多的jar包.去oracle官网上下载64版weblogic ...

  2. PHP XAMPP windows环境安装扩展redis 致命错误: Class 'Redis' not found解决方法

    PHP XAMPP windows环境安装扩展redis 致命错误: Class 'Redis' not found解决方法 1.电脑需要先安装redis服务端环境,并在安装目录下打开客户端redis ...

  3. windows环境安装MySQL

    转:https://www.cnblogs.com/ayyl/p/5978418.html windows环境安装MySQL mySQL下载链接:MySQL Installer 5.7 :http:/ ...

  4. Windows环境安装MySQL数据库

    Windows环境安装MySQL数据库 作者:尹正杰 版权声明:原创作品,谢绝转载!否则将追究法律责任. 最近在学习Java语言,开发环境在Windows操作系统上,因此需要在Windows上安装My ...

  5. MongoDB(二):在Windows环境安装MongoDB

    1. 在Windows环境安装 1.1 MongoDB下载 要在Windows上安装MongoDB,首先打开MongoDB官网:https://www.mongodb.com/download-cen ...

  6. windows环境搭建dubbo服务

    windows环境搭建dubbo服务 1:首先需要下载dubbo的注册中心 zookeeper zookeeper注册中心下载地址链接:http://mirror.bit.edu.cn/apache/ ...

  7. windows IIS安装php服务及配置

    windows IIS安装php服务及配置 启动IIS服务 打开 "控制面板" => "程序" => "启用或关闭Window功能&quo ...

  8. Redis:在windows环境安装Redis

    Redis:在windows环境安装Redis 第一步: 下载windows版本的Redis:https://github.com/MSOpenTech/Redis. 第二步: 在命令行执行:D:\r ...

  9. Windows环境安装tesseract-ocr 4.00并配置环境变量

    最近要做文字识别,不让直接用别人的接口,所以只能尝试去用开源的类库.tesseract-ocr是惠普公司开源的一个文字识别项目,通过它可以快速搭建图文识别系统,帮助我们开发出能识别图片的ocr系统.因 ...

随机推荐

  1. [洛谷P1730] 最小密度路径

    类型:Floyd 传送门:>Here< 题意:定义一条路径密度 = 该路径长度 / 边数.给出一张$DAG$,现有$Q$次询问,每次给出$X,Y$,问$X,Y$的最小密度路径($N \le ...

  2. 执行sql脚本保留操作日志

    需求场景,操作数据库场景较多,无专业dba,腾讯云mysql虽然提供了类似于phpmyadmin的管理后台,但是操作卡,效率低 #!/usr/bin CDATE=`date +%Y%m%d-%H%M% ...

  3. 自学华为IoT物联网_11 物联网操作系统介绍

    点击返回自学华为IoT物流网 自学华为IoT物联网_11 物联网操作系统介绍 1.1  物联网面临的困难 物联网终端发展面临的困难:开发者需要懂硬件和芯片的差异,自行适配硬件接口 物联网开发面临的困难 ...

  4. [CF438D]The Child and Sequence【线段树】

    题目大意 区间取模,区间求和,单点修改. 分析 其实算是一道蛮简单的水题. 首先线段树非常好解决后两个操作,重点在于如何解决区间取模的操作. 一开始想到的是暴力单点修改,但是复杂度就飙到了\(mnlo ...

  5. django从零开始-视图

    1.处理的登录请求 views文章中添加登录函数login_action def login_action(request): if request.method == 'POST': usernam ...

  6. C#解决方案生成工具(2)

    环境  VS2017 社区版 W10 Project类 : 在Microsoft.Build.Evaluation命名空间下,可使用Project类分析项目的.csproj文件 // 实例化对象,参数 ...

  7. HR_Array Manipulation

    第一版有7个时间超限,优化成了第二版: 1: #!/bin/python3 import math import os import random import re import sys # Com ...

  8. SCOI2008着色方案(记忆化搜索)

    有n个木块排成一行,从左到右依次编号为1~n.你有k种颜色的油漆,其中第i 种颜色的油漆足够涂ci 个木块.所有油漆刚好足够涂满所有木块,即 c1+c2+...+ck=n.相邻两个木块涂相同色显得很难 ...

  9. NOI2017蔬菜(贪心)

    小 N 是蔬菜仓库的管理员,负责设计蔬菜的销售方案. 在蔬菜仓库中,共存放有 n 种蔬菜,小 N 需要根据不同蔬菜的特性,综合考虑各 方面因素,设计合理的销售方案,以获得最多的收益. 在计算销售蔬菜的 ...

  10. [BJOI2012]最多的方案(记忆化搜索)

    第二关和很出名的斐波那契数列有关,地球上的OIer都知道:F1=1, F2=2, Fi = Fi-1 + Fi-2,每一项都可以称为斐波那契数.现在给一个正整数N,它可以写成一些斐波那契数的和的形式. ...