Setting weblogic10.3 scheduled restart task under windows

  Due to the memory overflow of the project (the project is deployed using weblogic), the service needs to be restarted regularly, so set weblogic as a windows service. The steps are as follows:
1. Set the weblogic service as a windows service
    1. Find the installSvc.cmd in the root directory of the weblogic you installed, for example, my path is: F:\JavaTools\weblogicServer\wls\ wlserver\server\bin; open installSvc .cmd, find the following:
    set WL_HOME=F:\JavaTools\weblogicServer\wls\wlserver
    call "%WL_HOME%\common\bin\commEnv.cmd"
    Move it below
          @echo off
           SETLOCAL and add the following:
    set DOMAIN_NAME=mydomain
    set SERVER_NAME=myserver
    set
  USERDOMAIN_HOME=F:\JavaTools\weblogicServer\wls\user_projects\domains\mydomain
    set WLS_USER=weblogic
    set WLS_PW=weblogic123
    Note: Change the account and password to your own. After saving, run as administrator to find the service in the windows service; the service name is: "beasvc mydomain_myserver" (if you are using weblogic12.1.3, the service name is "wlsvc mydomain_myserver", just pay attention)
2. Set the service as a scheduled task
    1. Create a plan.cmd in your root directory; the contents are:
    net stop "beasvc mydomain_myserver" 
    net start "beasvc mydomain_myserver"
    2. Create a scheduled task in windows; open the control panel -> Task plan; then set it step by step and import plan.cmd.
    At this point, the service will restart according to the time you set.     3. Problems
found when running the project after the service is set         up         successfully In the jre\lib\ext folder under the jdk used by weblogic, add the hibernate-jpa-2.0-api-1.0.1.Final.jar package;     2. WebLogic Hibernate exception org.hibernate.hql.ast.HqlToken




         Solution: copy the package antlr-2.7.6.jar in Hibernate3 to %WL_HOME%\server\lib ( note: this WL_HOME is the installation directory of your weblogic, not the directory when your project is deployed, ps: when the project is deployed can be placed elsewhere ). Then, modify F:\JavaTools\weblogicServer\wls\user_projects\domains\mydomain\bin\startWebLogic.cmd:
    add the following sentence before and after set CLASSPATH=%SAVE_CLASSPATH% to:
    set PRE_CLASSPATH=%WL_HOME%\server\lib \antlr-2.7.6.jar
    set CLASSPATH=%SAVE_CLASSPATH%
    set CLASSPATH=%PRE_CLASSPATH%;%CLASSPATH%
    However, due to the simultaneous deployment of multiple projects, this problem still exists, so we need to deploy the system under the WEB-INF folder Create a weblogic.xml
with the following content:
<?xml version="1.0" encoding="UTF-8"?>
<weblogic-web-app>
<container-descriptor>
<prefer-web-inf-classes>true</ prefer-web-inf-classes>
<
</weblogic-web-app>


Problem solved.


    


   

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326942025&siteId=291194637