oracle 在 weblogic 服务器中自动部署/重新加载 jar
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/13508125/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Auto-deploy/reload a jar in weblogic server
提问by Swamy
I am new to Oracle SOA Suite 11.1.1.4... Currently I am working on User defined XPath Functions. As part of this, I will prepare a jar file and need to deploy into weblogic server(10.3) domain lib folder(fusionmw\soasuite\11gR1\11.1.1\sp4\user_projects\domains\DOMAIN_NAME\lib). When ever this jar is altered, I need to replace this in server domain lib and restart the server to load the changes. But I feel this is not a good practice in production server to restart.
我是 Oracle SOA Suite 11.1.1.4 的新手...目前我正在研究用户定义的 XPath 函数。作为其中的一部分,我将准备一个 jar 文件并需要部署到 weblogic server(10.3) 域 lib 文件夹中(fusionmw\soasuite\11gR1\11.1.1\sp4\user_projects\domains\DOMAIN_NAME\lib)。当这个 jar 被改变时,我需要在服务器域库中替换它并重新启动服务器以加载更改。但是我觉得这不是在生产服务器重启的好习惯。
Is there a way to auto load updated jar into server's domain so the changes will reflect immediately instead of restarting the server.
有没有办法将更新的 jar 自动加载到服务器的域中,以便更改将立即反映而不是重新启动服务器。
Thanks in advance, Swamy.
提前致谢,斯瓦米。
回答by Ashish Kumar Gupta
Auto-deployment is a method for quickly deploying an application to a stand-alone server (Administration Server) for evaluation or testing. It is recommended that this method be used only in a single-server development environment.
自动部署是一种将应用程序快速部署到独立服务器(管理服务器)进行评估或测试的方法。建议仅在单服务器开发环境中使用此方法。
You can run a WebLogic Server domain in two different modes: development and production. Only development mode allows you use the auto-deployment feature
您可以在两种不同的模式下运行 WebLogic Server 域:开发和生产。只有开发模式允许您使用自动部署功能
To auto-deploy an archived application, copy its archive file to the /autodeploy directory. WebLogic Server automatically sets the application's deployment mode to stage mode.
要自动部署已归档的应用程序,请将其归档文件复制到 /autodeploy 目录。WebLogic Server 自动将应用程序的部署模式设置为暂存模式。
回答by Sym-Sym
Few words of caution when using autodeploy
使用 autodeploy 时的注意事项
- Make sure that the server is running while you are adding/replacing/deleting a jar/war/ear in the autodeploy folder. Otherwise the server goes out of sync
- Make sure the server is running in development mode otherwise the autodeploy folder changes are not seen by the server instance
In case you are packaging your jar/war/ear in a windows system then deploying it to a weblogic server running in a Unix environment, the weblogic instance will fail to unpack/autodeploy the file through the following exception
java.util.zip.ZipException: Error opening file - filename.war Message - error in opening zip file java.io.IOException: error in opening zip file with ... Message - error in opening zip file ....
- Read this link
- 在 autodeploy 文件夹中添加/替换/删除 jar/war/ear 时,请确保服务器正在运行。否则服务器不同步
- 确保服务器在开发模式下运行,否则服务器实例看不到 autodeploy 文件夹更改
如果您在 Windows 系统中打包 jar/war/ear 然后将其部署到在 Unix 环境中运行的 weblogic 服务器,weblogic 实例将无法通过以下异常解包/自动部署文件
java.util.zip.ZipException:打开文件时出错 - filename.war 消息 - 打开 zip 文件时出错 java.io.IOException:使用 ... 消息打开 zip 文件时出错 - 打开 zip 文件时出错 ....
- 阅读此链接