Three ways to deploy projects in weblogic

Posted by mightyworld.com on Wed, 09 Mar 2022 11:13:36 +0100

There are usually three ways to deploy projects in weblogic: first, install and deploy in the console; Second, deploy the deployment package under the autodeploy directory in the domain domain; Third, use the configuration file config. In the domain XML for project deployment.

 

Console deployment

 

1. Start the weblogic service, log in to the weblogic console page, enter the user name and password, and log in to the console

 

2. Click deployment on the left

 

3. Click the installation button on the right to prepare for project installation

 

4. When you see the path input box, you can select the location of the project to be deployed below

 

5. You can also directly enter the location of the package to be deployed and press enter

 

6. Click next

 

7. Continue to the next step

 

8. Click the finish button

 

9. Save the settings of the previous steps

 

10. After saving, you will see the prompt of activating the change, and there is no need to restart.

 

11. It can be carried out at this time test After entering the project name, you can see the welcome page of the project, that is, the project has been deployed successfully.

 

If the previous steps are completed, but you still cannot access the project, you can refer to the following supplementary steps

Supplementary steps

Supplement 1. Click deploy, check the previous item, and click start

 

Supplement 2. After startup, when the project status is active and the health status is OK, continue the test.

 

autodeploy auto deploy

 

During automatic deployment, you do not need to log in to the console. There is an autodeploy directory under the main directory of the domain domain. You can directly copy the project package to the autodeploy directory.

There is a readme in the autodeploy directory Txt document, open it and take a look. Here, pick out the first paragraph

 

  1. This autodeploy directory provides a quick way to deploy applications  
  2. to a development server. When the WebLogic Server instance is running  
  3. in development mode, applications and modules in this directory are   
  4. automatically deployed.  


What is it mainly about? Under the development mode, when weblogic is started, the projects under the autodeploy directory will be automatically deployed.

 

The package servletDemo. Will be deployed Put war under the autodeploy directory and start startweblogic CMD, access servletDemo, and you can still see

Welcome page.

 

config.xml configuration file deployment

 

config. The XML file is under the config directory of the domain domain, config XML mainly configures some related information of domain domain

Where should we deploy the project

 

  1. <?xml version='1.0' encoding='UTF-8'?>  
  2. <domain xmlns="http://xmlns.oracle.com/weblogic/domain" xmlns:sec="http://xmlns.oracle.com/weblogic/security" xmlns:wls="http://xmlns.oracle.com/weblogic/security/wls" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.oracle.com/weblogic/security/xacml http://xmlns.oracle.com/weblogic/security/xacml/1.0/xacml.xsd http://xmlns.oracle.com/weblogic/security/providers/passwordvalidator http://xmlns.oracle.com/weblogic/security/providers/passwordvalidator/1.0/passwordvalidator.xsd http://xmlns.oracle.com/weblogic/domain http://xmlns.oracle.com/weblogic/1.0/domain.xsd http://xmlns.oracle.com/weblogic/security http://xmlns.oracle.com/weblogic/1.0/security.xsd http://xmlns.oracle.com/weblogic/security/wls http://xmlns.oracle.com/weblogic/security/wls/1.0/wls.xsd">  
  3.   <name>base_domain</name>  
  4.   <domain-version>12.1.3.0.0</domain-version>  
  5.   <security-configuration>  
  6.     <name>base_domain</name>  
  7.     <realm>  
  8.       <sec:authentication-provider xsi:type="wls:default-authenticatorType">  
  9.         <sec:name>DefaultAuthenticator</sec:name>  
  10.       </sec:authentication-provider>  
  11.       <sec:password-validator xmlns:pas="http://xmlns.oracle.com/weblogic/security/providers/passwordvalidator" xsi:type="pas:system-password-validatorType">  
  12.         <sec:name>SystemPasswordValidator</sec:name>  
  13.         <pas:min-password-length>8</pas:min-password-length>  
  14.         <pas:min-numeric-or-special-characters>1</pas:min-numeric-or-special-characters>  
  15.       </sec:password-validator>  
  16.     </realm>  
  17.     <default-realm>myrealm</default-realm>  
  18.     <credential-encrypted>{AES}xLPXh4gcT6JErTB+toxRZ1pQpAS+MGMuqnnXzu/OsxWMQTB8152ggdbUlhkSXUGC9f959oL7tIzyZiu9XdeajlkK9vAu9cQlCKLLUaUMyl5Ty4C0uuJA99b14eR7oIu4</credential-encrypted>  
  19.     <node-manager-username>weblogic</node-manager-username>  
  20.     <node-manager-password-encrypted>{AES}n3LLdgmAsocPRoYUrFfR2waWOlEz6KDFsp7+gByNeo8=</node-manager-password-encrypted>  
  21.   </security-configuration>  
  22.   <server>  
  23.     <name>AdminServer</name>  
  24.     <listen-address></listen-address>  
  25.   </server>  
  26.   <embedded-ldap>  
  27.     <name>base_domain</name>  
  28.     <credential-encrypted>{AES}21z8vCiCbuaYqsSj5t5+y6qvEY8dE3NdNr0zDG+K3EdwWEubzk9Vmx79Di43oxqX</credential-encrypted>  
  29.   </embedded-ldap>  
  30.   <configuration-version>12.1.3.0.0</configuration-version>  
  31.   <admin-server-name>AdminServer</admin-server-name>  
  32. </domain>  


Our project deployment information is added between configuration version and admin server name

 

 

  1. <configuration-version>12.1.3.0.0</configuration-version>  
  2.   <app-deployment>    
  3.     <name>servletDemo</name>    
  4.     <target>AdminServer</target>    
  5.     <module-type>war</module-type>    
  6.     <source-path>C:\Users\ZhangQi\Desktop\servletDemo</source-path>    
  7.     <security-dd-model>DDOnly</security-dd-model>    
  8.   </app-deployment>  
  9.   <admin-server-name>AdminServer</admin-server-name>  

 

Just started config When deploying the XML configuration file, 404 appears. Just modify the configuration

Unzip the deployed war package into a folder, and then

Modify war in < module type > war < / module type > to "dir"

 

  1. <app-deployment>    
  2.     <name>servletDemo</name>    
  3.     <target>AdminServer</target>    
  4.     <module-type>dir</module-type>    
  5.     <source-path>C:\Users\ZhangQi\Desktop\servletDemo</source-path>  
  6.     <security-dd-model>DDOnly</security-dd-model>  
  7.     <staging-mode>nostage</staging-mode>  
  8.   </app-deployment>  



 

Then start the weblogic service.

 

 

The three deployment methods can achieve the purpose of the deployment project. As for the advantages and disadvantages of the three deployment methods, let's talk about them tomorrow.

Last blog post wrote Three ways for weblogic to deploy projects , including installing the deployment in the console, deploying the deployment package under the autodeploy directory in the domain, and using the configuration file config. In the domain XML for project deployment. How to choose the deployment mode in the development environment and formal production environment? Here is a reference based on my own experience.

 

Console deployment

 

This general formal production environment or test The environment can be in this way. At this time, we need to change the operation mode of weblogic to production mode, and put the deployment package in a unified place for management, installation, update and deletion. The deployment is carried out directly on the console to facilitate monitoring.

 

autodeploy

 

This development is a little more convenient for management. During development, it is convenient to directly copy the project to autodeploy and start the weblogic service. Considering that the weblogic service will not automatically decompress the war package (which is not as good as tomcat), the files obtained through some absolute paths in the project may not be well obtained. At this time, the war package can be decompressed into a folder to facilitate file reading. During development, you can directly copy the modified files to the autodeploy directory through ant or other tools, which is more convenient.

 

config.xml configuration deployment

 

    config.xml configuration deployment is similar to autodeploy. The difference is that autodeploy must put the deployment package of the project under the autodeploy directory, but config The deployment package of XML configuration deployment can be put anywhere. This method is also used in the development environment. I don't recommend this method, because every time a new project is deployed, I have to find config. In the domain domain XML configuration, and then modify it. The risk of error is too high. It's better to use autodeploy directly.

 

According to the above analysis, console deployment is used in production and autodeploy or config. Is used in development XML configuration deployment. If you use eclipse for development, you can integrate weblogic plug-ins and start, stop and reference weblogic directly in eclipse Installing weblogic plug-ins from eclipse.

Topics: Weblogic