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?
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