Given an EAR package that has an EJB jar with a persistence.xml within a mapping-file element. The CmpJpaConversion <https://github.com/apache/tomee/blob/master/container/openejb-core/src/main/java/org/apache/openejb/config/CmpJpaConversion.java#L109L128> does not find this reference because when it reads, this file reference isn’t in the jar anymore but in the EAR location. It seems that the DeploymentLoader <https://github.com/apache/tomee/blob/master/container/openejb-core/src/main/java/org/apache/openejb/config/DeploymentLoader.java> goes to all jar files to find the persistence XML. However, it doesn’t load the others resources files.
IMHO: that does not look an easy solution, because it raises some decisions: - What happens if have one or more jar file with the same file name? - Should we have priorities? - Should we read the mapping-file just from the specific jar file? Ref: https://github.com/apache/tomee/pull/374