Weblogic部署项目三种方式

  • Post author:
  • Post category:其他

 

    在weblogic中部署项目通常有三种方式:第一,在控制台中安装部署;第二,将部署包放在domain域中autodeploy目录下部署;第三,使用域中配置文件config.xml 进行项目的部署。

 

控制台部署

 

1  启动weblogic服务,登录到weblogic控制台页面,输入用户名和密码,登录到控制台里面

 

2  点击左侧的部署

 

3  在右侧点击安装按钮,准备进行项目安装

 

4  看到路径输入框,可以在下面选择要部署的项目的位置

 

5  也可以直接输入要部署的包的位置,敲回车

 

6  点击下一步即可

 

7  继续下一步

 

8  点击完成按钮

 

9   保存前面各步的设置

 

10  保存完成后,会看到激活更改的提示,且不需要重启。

 

11  这时便可以进行测试了,输入项目名称,看到了项目的欢迎页面,即项目部署成功。

 

如果前面的步骤操作完成了,但依然无法访问项目的话,可以参考下面的补充步骤

补充步骤

补1  点击部署,勾选上项目,点击启动

 

补2  待启动后,项目状态为活动,健康状况为OK时,继续测试。

 

autodeploy自动部署

 

自动部署时不需要登录控制台,在domain域的主目录下面有个autodeploy目录,直接将项目包拷贝到autodeploy目录下面就可以了。

autodeploy目录里面有个readme.txt 文档,打开看一下,这里摘第一段出来

 

 
  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.

主要说什么呢,就是开发模式下面,当weblogic启动时,会自动部署autodeploy目录下面的项目。

 

将部署包servletDemo.war 丢到autodeploy目录下面,启动startWeblogic.cmd ,进行servletDemo的访问,依然可以看到

欢迎页面。

 

config.xml配置文件部署

 

config.xml文件在domain域的config目录下面,config.xml主要配置了domain域的一些相关信息

我们要部署项目,该在哪里配置呢

 

 
  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>

我们的项目部署信息添加在configuration-version 和 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>

 

刚开始进行config.xml 配置文件部署的时候,出现了404,修改了下配置就可以了

将部署的war包解压为文件夹的形式,然后

将 <module-type>war</module-type> 里面的war 修改为 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>

 

 

然后启动weblogic服务即可

转载来源:

https://blog.csdn.net/magi1201/article/details/46280507