一个 `.war` 文件嵌套在另一个 `.ear` 文件内部的配置是否有效?

huangapple go评论70阅读模式
英文:

Is a .war file nested in a .ear file nested inside another .ear file ever a valid configuration?

问题

我曾与几个 J2EE 应用程序一起工作,但从未自己设计和构建过,并且对应用程序背后的实际结构不太熟悉。

我正在支持一个需要从 WebSphere 6 服务器迁移到 WebSphere 8.5 服务器的 J2EE 应用程序。

在追踪我在 8.5 服务器的测试版本的应用程序日志文件中发现的错误时,我决定查看一下 WebSphere 服务器上的 .ear 文件内部,查看 .ear 文件内部的 .war 文件,并查看 .war 文件内部的 web.xml 文件,以查看根据源代码树应该存在的配置变量的值。

令我惊讶的是,在 .ear 文件中并没有找到 .war 文件。更令我惊讶的是,在 .ear 文件内部嵌套了另一个 .ear 文件。然后,当我查看嵌套的 .ear 文件内部时,.war 文件就在那里。

这个故事还有更多内容,但我觉得这似乎一定是该应用程序过去的某个人可能造成的构建错误或部署错误。

这是否可能是有效的配置?

英文:

I've worked with a few J2EE apps, but have never designed and built one myself and am not well-versed on the actual structures behind the apps.

I'm supporting a J2EE application that needs to be migrated from a WebSphere 6 server to a WebSphere 8.5 server.

While tracking down an error that I found in the application's log file on the test version of the 8.5 server. I decided that it might be a good idea to take a look inside the .ear file on the WebSphere server, look inside the .war file inside of the .ear file, and look at the web.xml file inside the .war file to see the value of a config variable that, according to the source tree, ought to be there.

I was surprised to find that the .war file wasn't there in the .ear file. I was even more surprised to see that another .ear file was nested inside the .ear file. And then, when I looked inside that nested .ear file, the .war file was there.

There's more to this story, but this strikes me as if it has to be a build error or deployment error made by someone in this application's past.

Is there any way that this is a valid configuration?

答案1

得分: 2

不,那是无效的。一个EAR文件可以包含其他模块级别的归档,比如WAR、EJB JAR、RAR或者库JAR,但不能包含其他EAR文件。

更多详情请参考:https://docs.oracle.com/javaee/6/tutorial/doc/bnaby.html

英文:

No, that is not valid. An EAR file may contain other module-level archives, such as WAR, EJB JARs, RARs, or library JARs, but it may not contain other EAR files.

More details here: https://docs.oracle.com/javaee/6/tutorial/doc/bnaby.html

huangapple
  • 本文由 发表于 2020年10月16日 09:30:59
  • 转载请务必保留本文链接:https://go.coder-hub.com/64381766.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定