在weblogic中部署项目通常有三种方式:第一,在控制台中安装部署;第二,将部署包放在domain域中autodeploy目录下部署;第三,使用域中配置文件config.xml 进行项目的部署。
控制台部署
1 启动weblogic服务,登录到weblogic控制台页面,输入用户名和密码,登录到控制台里面
![](https://img-blog.csdn.net/20150531005427606?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvbWFnaTEyMDE=/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast)
2 点击左侧的部署
![](https://img-blog.csdn.net/20150531005610903?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvbWFnaTEyMDE=/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast)
3 在右侧点击安装按钮,准备进行项目安装
![](https://img-blog.csdn.net/20150531005455327?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvbWFnaTEyMDE=/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast)
4 看到路径输入框,可以在下面选择要部署的项目的位置
![](https://img-blog.csdn.net/20150531005507917?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvbWFnaTEyMDE=/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast)
5 也可以直接输入要部署的包的位置,敲回车
![](https://img-blog.csdn.net/20150531005522955?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvbWFnaTEyMDE=/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast)
6 点击下一步即可
![](https://img-blog.csdn.net/20150531005538602?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvbWFnaTEyMDE=/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast)
7 继续下一步
![](https://img-blog.csdn.net/20150531005620472?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvbWFnaTEyMDE=/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast)
8 点击完成按钮
![](https://img-blog.csdn.net/20150531005633561?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvbWFnaTEyMDE=/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast)
9 保存前面各步的设置
![](https://img-blog.csdn.net/20150531005650518?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvbWFnaTEyMDE=/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast)
10 保存完成后,会看到激活更改的提示,且不需要重启。
![](https://img-blog.csdn.net/20150531005707241?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvbWFnaTEyMDE=/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast)
11 这时便可以进行测试了,输入项目名称,看到了项目的欢迎页面,即项目部署成功。
![](https://img-blog.csdn.net/20150531005917923?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvbWFnaTEyMDE=/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast)
如果前面的步骤操作完成了,但依然无法访问项目的话,可以参考下面的补充步骤
补充步骤
补1 点击部署,勾选上项目,点击启动
![](https://img-blog.csdn.net/20150531005854173?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvbWFnaTEyMDE=/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast)
补2 待启动后,项目状态为活动,健康状况为OK时,继续测试。
![](https://img-blog.csdn.net/20150531005742965?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvbWFnaTEyMDE=/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast)
autodeploy自动部署
自动部署时不需要登录控制台,在domain域的主目录下面有个autodeploy目录,直接将项目包拷贝到autodeploy目录下面就可以了。
autodeploy目录里面有个readme.txt 文档,打开看一下,这里摘第一段出来
- This autodeploy directory provides a quick way to deploy applications
- to a development server. When the WebLogic Server instance is running
- in development mode, applications and modules in this directory are
- automatically deployed.
主要说什么呢,就是开发模式下面,当weblogic启动时,会自动部署autodeploy目录下面的项目。
将部署包servletDemo.war 丢到autodeploy目录下面,启动startWeblogic.cmd ,进行servletDemo的访问,依然可以看到
![](https://img-blog.csdn.net/20150531011714880?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvbWFnaTEyMDE=/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast)
欢迎页面。
config.xml配置文件部署
config.xml文件在domain域的config目录下面,config.xml主要配置了domain域的一些相关信息
我们要部署项目,该在哪里配置呢
- <?xml version='1.0' encoding='UTF-8'?>
- <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">
- <name>base_domain</name>
- <domain-version>12.1.3.0.0</domain-version>
- <security-configuration>
- <name>base_domain</name>
- <realm>
- <sec:authentication-provider xsi:type="wls:default-authenticatorType">
- <sec:name>DefaultAuthenticator</sec:name>
- </sec:authentication-provider>
- <sec:password-validator xmlns:pas="http://xmlns.oracle.com/weblogic/security/providers/passwordvalidator" xsi:type="pas:system-password-validatorType">
- <sec:name>SystemPasswordValidator</sec:name>
- <pas:min-password-length>8</pas:min-password-length>
- <pas:min-numeric-or-special-characters>1</pas:min-numeric-or-special-characters>
- </sec:password-validator>
- </realm>
- <default-realm>myrealm</default-realm>
- <credential-encrypted>{AES}xLPXh4gcT6JErTB+toxRZ1pQpAS+MGMuqnnXzu/OsxWMQTB8152ggdbUlhkSXUGC9f959oL7tIzyZiu9XdeajlkK9vAu9cQlCKLLUaUMyl5Ty4C0uuJA99b14eR7oIu4</credential-encrypted>
- <node-manager-username>weblogic</node-manager-username>
- <node-manager-password-encrypted>{AES}n3LLdgmAsocPRoYUrFfR2waWOlEz6KDFsp7+gByNeo8=</node-manager-password-encrypted>
- </security-configuration>
- <server>
- <name>AdminServer</name>
- <listen-address></listen-address>
- </server>
- <embedded-ldap>
- <name>base_domain</name>
- <credential-encrypted>{AES}21z8vCiCbuaYqsSj5t5+y6qvEY8dE3NdNr0zDG+K3EdwWEubzk9Vmx79Di43oxqX</credential-encrypted>
- </embedded-ldap>
- <configuration-version>12.1.3.0.0</configuration-version>
- <admin-server-name>AdminServer</admin-server-name>
- </domain>
我们的项目部署信息添加在configuration-version 和 admin-server-name 之间
- <configuration-version>12.1.3.0.0</configuration-version>
- <app-deployment>
- <name>servletDemo</name>
- <target>AdminServer</target>
- <module-type>war</module-type>
- <source-path>C:\Users\ZhangQi\Desktop\servletDemo</source-path>
- <security-dd-model>DDOnly</security-dd-model>
- </app-deployment>
- <admin-server-name>AdminServer</admin-server-name>
刚开始进行config.xml 配置文件部署的时候,出现了404,修改了下配置就可以了
将部署的war包解压为文件夹的形式,然后
将 <module-type>war</module-type> 里面的war 修改为 dir 即可
- <app-deployment>
- <name>servletDemo</name>
- <target>AdminServer</target>
- <module-type>dir</module-type>
- <source-path>C:\Users\ZhangQi\Desktop\servletDemo</source-path>
- <security-dd-model>DDOnly</security-dd-model>
- <staging-mode>nostage</staging-mode>
- </app-deployment>
然后启动weblogic服务即可。
在weblogic中部署项目通常有三种方式:第一,在控制台中安装部署;第二,将部署包放在domain域中autodeploy目录下部署;第三,使用域中配置文件config.xml 进行项目的部署。
控制台部署
1 启动weblogic服务,登录到weblogic控制台页面,输入用户名和密码,登录到控制台里面
![](https://img-blog.csdn.net/20150531005427606?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvbWFnaTEyMDE=/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast)
2 点击左侧的部署
![](https://img-blog.csdn.net/20150531005610903?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvbWFnaTEyMDE=/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast)
3 在右侧点击安装按钮,准备进行项目安装
![](https://img-blog.csdn.net/20150531005455327?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvbWFnaTEyMDE=/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast)
4 看到路径输入框,可以在下面选择要部署的项目的位置
![](https://img-blog.csdn.net/20150531005507917?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvbWFnaTEyMDE=/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast)
5 也可以直接输入要部署的包的位置,敲回车
![](https://img-blog.csdn.net/20150531005522955?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvbWFnaTEyMDE=/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast)
6 点击下一步即可
![](https://img-blog.csdn.net/20150531005538602?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvbWFnaTEyMDE=/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast)
7 继续下一步
![](https://img-blog.csdn.net/20150531005620472?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvbWFnaTEyMDE=/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast)
8 点击完成按钮
![](https://img-blog.csdn.net/20150531005633561?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvbWFnaTEyMDE=/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast)
9 保存前面各步的设置
![](https://img-blog.csdn.net/20150531005650518?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvbWFnaTEyMDE=/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast)
10 保存完成后,会看到激活更改的提示,且不需要重启。
![](https://img-blog.csdn.net/20150531005707241?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvbWFnaTEyMDE=/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast)
11 这时便可以进行测试了,输入项目名称,看到了项目的欢迎页面,即项目部署成功。
![](https://img-blog.csdn.net/20150531005917923?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvbWFnaTEyMDE=/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast)
如果前面的步骤操作完成了,但依然无法访问项目的话,可以参考下面的补充步骤
补充步骤
补1 点击部署,勾选上项目,点击启动
![](https://img-blog.csdn.net/20150531005854173?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvbWFnaTEyMDE=/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast)
补2 待启动后,项目状态为活动,健康状况为OK时,继续测试。
![](https://img-blog.csdn.net/20150531005742965?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvbWFnaTEyMDE=/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast)
autodeploy自动部署
自动部署时不需要登录控制台,在domain域的主目录下面有个autodeploy目录,直接将项目包拷贝到autodeploy目录下面就可以了。
autodeploy目录里面有个readme.txt 文档,打开看一下,这里摘第一段出来
- This autodeploy directory provides a quick way to deploy applications
- to a development server. When the WebLogic Server instance is running
- in development mode, applications and modules in this directory are
- automatically deployed.
主要说什么呢,就是开发模式下面,当weblogic启动时,会自动部署autodeploy目录下面的项目。
将部署包servletDemo.war 丢到autodeploy目录下面,启动startWeblogic.cmd ,进行servletDemo的访问,依然可以看到
![](https://img-blog.csdn.net/20150531011714880?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvbWFnaTEyMDE=/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast)
欢迎页面。
config.xml配置文件部署
config.xml文件在domain域的config目录下面,config.xml主要配置了domain域的一些相关信息
我们要部署项目,该在哪里配置呢
- <?xml version='1.0' encoding='UTF-8'?>
- <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">
- <name>base_domain</name>
- <domain-version>12.1.3.0.0</domain-version>
- <security-configuration>
- <name>base_domain</name>
- <realm>
- <sec:authentication-provider xsi:type="wls:default-authenticatorType">
- <sec:name>DefaultAuthenticator</sec:name>
- </sec:authentication-provider>
- <sec:password-validator xmlns:pas="http://xmlns.oracle.com/weblogic/security/providers/passwordvalidator" xsi:type="pas:system-password-validatorType">
- <sec:name>SystemPasswordValidator</sec:name>
- <pas:min-password-length>8</pas:min-password-length>
- <pas:min-numeric-or-special-characters>1</pas:min-numeric-or-special-characters>
- </sec:password-validator>
- </realm>
- <default-realm>myrealm</default-realm>
- <credential-encrypted>{AES}xLPXh4gcT6JErTB+toxRZ1pQpAS+MGMuqnnXzu/OsxWMQTB8152ggdbUlhkSXUGC9f959oL7tIzyZiu9XdeajlkK9vAu9cQlCKLLUaUMyl5Ty4C0uuJA99b14eR7oIu4</credential-encrypted>
- <node-manager-username>weblogic</node-manager-username>
- <node-manager-password-encrypted>{AES}n3LLdgmAsocPRoYUrFfR2waWOlEz6KDFsp7+gByNeo8=</node-manager-password-encrypted>
- </security-configuration>
- <server>
- <name>AdminServer</name>
- <listen-address></listen-address>
- </server>
- <embedded-ldap>
- <name>base_domain</name>
- <credential-encrypted>{AES}21z8vCiCbuaYqsSj5t5+y6qvEY8dE3NdNr0zDG+K3EdwWEubzk9Vmx79Di43oxqX</credential-encrypted>
- </embedded-ldap>
- <configuration-version>12.1.3.0.0</configuration-version>
- <admin-server-name>AdminServer</admin-server-name>
- </domain>
我们的项目部署信息添加在configuration-version 和 admin-server-name 之间
- <configuration-version>12.1.3.0.0</configuration-version>
- <app-deployment>
- <name>servletDemo</name>
- <target>AdminServer</target>
- <module-type>war</module-type>
- <source-path>C:\Users\ZhangQi\Desktop\servletDemo</source-path>
- <security-dd-model>DDOnly</security-dd-model>
- </app-deployment>
- <admin-server-name>AdminServer</admin-server-name>
刚开始进行config.xml 配置文件部署的时候,出现了404,修改了下配置就可以了
将部署的war包解压为文件夹的形式,然后
将 <module-type>war</module-type> 里面的war 修改为 dir 即可
- <app-deployment>
- <name>servletDemo</name>
- <target>AdminServer</target>
- <module-type>dir</module-type>
- <source-path>C:\Users\ZhangQi\Desktop\servletDemo</source-path>
- <security-dd-model>DDOnly</security-dd-model>
- <staging-mode>nostage</staging-mode>
- </app-deployment>
然后启动weblogic服务即可。