Java 如何通过 Eclipse 为 Websphere Application Server 构建 EAR/WAR?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/298534/
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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-11 12:45:10  来源:igfitidea点击:

How to build EAR/WAR for Websphere Application Server by Eclipse?

javajakarta-eewebsphere

提问by Fuangwith S.

IBM Rational Application Developer is very slow and has many problems.

IBM Rational Application Developer 非常慢并且有很多问题。

I tried to use ant scripts to build EAR/WAR files for Websphere Application Server but it did not work.

我尝试使用 ant 脚本为 Websphere Application Server 构建 EAR/WAR 文件,但没有奏效。

回答by Shivasubramanian A

My understanding is that you build the EAR/WAR, then open your browser, login to the admin console, then deploy your application.

我的理解是您构建 EAR/WAR,然后打开浏览器,登录到管理控制台,然后部署您的应用程序。

If my understanding is correct, just add an instance of the WAS server to your workspace, and then right click on the server, select Add/Remove Projects and add your project. This way, you don't have to build the EAR/WAR file at all... Building your project is enough. If the build is successful, then RAD automatically builds the EAR/WAR and publishes the file to the server.

如果我的理解是正确的,只需在您的工作区中添加一个 WAS 服务器的实例,然后右键单击该服务器,选择 Add/Remove Projects 并添加您的项目。这样,您根本不必构建 EAR/WAR 文件……构建您的项目就足够了。如果构建成功,那么 RAD 会自动构建 EAR/WAR 并将文件发布到服务器。

Atleast that's the way we do it.

至少我们就是这样做的。

回答by McDowell

If Ant can't find the WAS tasks, then it is likely that the WAS API's are missing from the Ant classpath.

如果 Ant 找不到 WAS 任务,则很可能是 Ant 类路径中缺少 WAS API。

See this questionfor other sample scripts and suggestions.

有关其他示例脚本和建议,请参阅此问题

回答by toolkit

You need to make sure the jar file containing the com.ibm.websphere.ant.tasks.WSDL2Javais in your lib.pathclasspath.

您需要确保包含 的 jar 文件com.ibm.websphere.ant.tasks.WSDL2Java在您的lib.path类路径中。

<taskdef name="wsdl2java"
    classname="com.ibm.websphere.ant.tasks.WSDL2Java">
    <classpath refid="lib.path"/>
</taskdef>

If you're on UNIX, you can scan for this class using code similar to:

如果您使用的是 UNIX,则可以使用类似于以下内容的代码扫描此类:

find . -type f -name "*.jar" | while read file
do
    jar tvf $file | grep WSDL2Java && echo $file
done

回答by Michael

If RAD is slow, - try to upgrade to the latest FixPack available. - read the following article https://www.ibm.com/developerworks/wikis/download/attachments/113606723/radtipsv754.pdf?version=1

如果 RAD 速度较慢, - 尝试升级到可用的最新 FixPack。- 阅读以下文章https://www.ibm.com/developerworks/wikis/download/attachments/113606723/radtipsv754.pdf?version=1

Or contact support and explain more specifically the problem.

或者联系支持人员并更具体地解释问题。

回答by Drew

If you're using a brand new version of Eclipse (like Helios or Indigo) that has the Marketplace, then there is the possibility of deploying directly to Websphere. Here's a link about it: Announcing the new WebSphere Application Server Developer Tools for Eclipse V8.0.4

如果您使用的是具有 Marketplace 的全新版本的 Eclipse(如 Helios 或 Indigo),则可以直接部署到 Websphere。这是一个关于它的链接: 宣布适用于 Eclipse V8.0.4 的新 WebSphere Application Server Developer Tools