可以在任何服务器上部署war文件吗? [英] Can a war file be deployed on any server?

查看:153
本文介绍了可以在任何服务器上部署war文件吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果这个问题很愚蠢,请原谅我。假设我使用WebSphere应用程序服务器使用Spring框架和MS SQL-Server数据库开发J2EE Web应用程序。我稍后为此应用程序创建一个WAR文件。

Please pardon me if this question is silly. Suppose I develop a J2EE web application using Spring framework and a MS SQL-Server database, using a WebSphere application server. I later create a WAR file for this application.

我可以在Tomcat服务器上部署此WAR文件而无需更改代码吗?或者我的问题是,这可以由仅提供Tomcat服务器的Web主机托管吗?如果是,是否需要更改代码?

Can I deploy this WAR file on a Tomcat server without any change in code? Or my question is can this be hosted by web hosting which provides only Tomcat servers? If yes, is there any change in code required?

如果无法部署,你可以建议我做什么,因为我还没有在tomcat服务器上开发任何应用程序。我开发的所有应用程序都使用RAD在Websphere App Server上。

If it cannot be deployed, can you please suggest me what to do, because I havent developed any application on a tomcat server. All the applications that I have developed have been on Websphere App Server using RAD.

推荐答案

原则上,是的WAR文件应该是可移植的跨Java EE服务器。在实践中,我不会期望许多可移植性问题,但它在很大程度上取决于您的应用程序的细节以及您是否已经非常接近Java EE标准。此外,只是将您的应用程序部署到不同的环境(您的开发机器与托管环境)可能会遇到障碍,而不是WAS和Tomcat一样,环境与此环境相同。

In principle, yes WAR files should be portable across Java EE servers. In practice I would not expect many portability problems, but it very much depends upon the details of your application and whether you've stuck very closely to Java EE standards. Also, just deploying your app into a different environment (your dev machine versus a hosting environment) might hit snags, not so much a WAS v Tomcat as this environment v that environment.

可能的问题,可能性的降序:

Possible issues, descending order of likelyhood:

1)。您是否针对相同版本的标准。

1). Are you targetting the same versions of the standards.

2)。您是否使用了Java EE规范之外的任何特定于WebSphere的扩展。大多数供应商都有一些额外的好东西,你使用过吗?

2). Did you use any WebSphere specific extensions beyond the Java EE specs. Most vendors have some extra goodies, did you use any.

3)。您已经对目标平台上以不同方式访问的某些资源(文件,目录,打印机,数据库)进行了硬编码。

3). You've hard-coded some resource (file, directory, printer, database) that is accessed differently on your target platform.

4)。你是否达到了规范的模糊性?是否存在WAS行为与Tomcat行为不同的极端情况。

4). Did you hit a spec ambiguity? Is there some corner case where WAS behaviour differes from Tomcat behaviour.

5)。你依赖于WAS或你的平台真正快速完成的事情而你的taget平台没有。

5). You depend upon something that WAS or your platform does really quickly and your taget platform doesn't.

我的可移植性的一般规则:始终在你的预期部署范围内尽早测试平台。几乎总有一些问题。如果你早点发现,你可以轻松修复。

My general rule for portability: always test early across your range of intended deployment platforms. There's nearly always some gotcha. If you find out early you can fix with little pain.

这篇关于可以在任何服务器上部署war文件吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆