Java 如何在 Eclipse 中使用 Weblogic?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/1987061/
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
How to work with Weblogic in Eclipse?
提问by Ville M
What are the recommended plugins for eclipse to work with weblogic? Specifically I would need to work with older version of weblogic, 8.1, however I could use any version of Ecplise. I would like to debug the application and set breakpoints etc.
Eclipse 与 weblogic 一起使用的推荐插件是什么?具体来说,我需要使用旧版本的 weblogic 8.1,但是我可以使用任何版本的 Ecplise。我想调试应用程序并设置断点等。
My bigger task is to move the project over to Jboss, can I deploy the same app on both app servers within Eclipse with presumably 2 sets of config files etc, any advice? 2 separate projects?
我更大的任务是将项目转移到 Jboss,我可以在 Eclipse 内的两个应用程序服务器上部署相同的应用程序,大概有 2 组配置文件等,有什么建议吗?2个独立的项目?
采纳答案by Pascal Thivent
If you are using Eclipse with the WTP, then Weblogic Integration is available through an additional server adapter. To get it, right-clickthe Serversview then select New > Serverand click on Download additional server adapters. Select the Oracle extension from the list and proceed with the install. Once installed, you'll be able to add a new server for WebLogic from version 8.1 to 11g (for BEA WebLogic Server v8.1, look under BEA System, Inc.).
如果您将 Eclipse 与 WTP 一起使用,那么 Weblogic 集成可通过额外的服务器适配器使用。为了得到它,用鼠标右键单击该服务器视图,然后选择新建>服务器和点击下载额外的服务器适配器。从列表中选择 Oracle 扩展并继续安装。安装后,您将能够为从 8.1 到 11g 的 WebLogic 添加新服务器(对于 BEA WebLogic Server v8.1,请查看 BEA System, Inc.)。
If you have WTP servers created for JBoss and WebLogic, it's definitely possible to deploy and run the same project on both of them, there is nothing particular to do (the proprietary deployment descriptors can coexist if you want to use them, you don't have to create 2 projects for this).
如果你有为 JBoss 和 WebLogic 创建的 WTP 服务器,那么绝对可以在它们两个上部署和运行同一个项目,没有什么特别的事情(如果你想使用专有的部署描述符可以共存,你不必须为此创建 2 个项目)。
回答by maximdim
In order to debug your code running on Weblogic (or any other java server for that matter) you don't need anything but Eclipse itself. Search Google for java remote debugging.
为了调试在 Weblogic(或任何其他 Java 服务器)上运行的代码,除了 Eclipse 本身之外,您不需要任何东西。在 Google 上搜索 Java 远程调试。
As for deploying to Weblogic and Jboss - as long as your code is not using proprietary stuff from J2EE containers vendors you should be fine with one project. Standard configuration files will be common, container specific files will be separate and often won't even have to be removed in build time as container would just ignore them. This way the same artifact (e.g. War) could be deployed to both containers.
至于部署到 Weblogic 和 Jboss - 只要您的代码不使用来自 J2EE 容器供应商的专有内容,您应该可以使用一个项目。标准配置文件将是通用的,特定于容器的文件将是单独的,并且通常甚至不必在构建时删除,因为容器会忽略它们。通过这种方式,可以将相同的工件(例如 War)部署到两个容器中。
回答by Carl Smotricz
This concerns the JBoss part of the question: If there are real product-specific differences in the code, they should hopefully be localized to one or few classes. Apart from this hygienic measure, it would be unhelpfully painful to separate your project into two.
这涉及问题的 JBoss 部分:如果代码中存在真正特定于产品的差异,则希望它们应该被本地化为一个或几个类。除了这种卫生措施之外,将您的项目一分为二将是无益的痛苦。
Most of the configuration files should be the same for the two environments too; if not, you may consider doing what we do at my job site: We have a conf_XXX
and a conf_YYY
directory for separate configuration files.
两种环境的大多数配置文件也应该相同;如果没有,您可以考虑做我们在我的工作现场所做的事情:我们有一个conf_XXX
和 一个conf_YYY
用于单独配置文件的目录。
The problem of including/not including the correct files per deployment environment should be delegated to one or two ant
build scripts. If there are indeed file differences, you can create a proj_Weblogic.war
and a proj_jboss.war
and deploy those to the appropriate servers. If you can't find specific deployment ant tasks, you can still use straight file copy
tasks or scp
to move your WAR files into the server's appropriate deployment directories.
每个部署环境包含/不包含正确文件的问题应该委托给一两个ant
构建脚本。如果确实存在文件差异,您可以创建 aproj_Weblogic.war
和 aproj_jboss.war
并将它们部署到适当的服务器。如果找不到特定的部署 ant 任务,您仍然可以使用直接文件copy
任务或scp
将 WAR 文件移动到服务器的适当部署目录中。