I'd say we should try the same jar that persistence.xml is in. That said, I
thought it was loaded via the classloader, so what's on the classpath when
we try and read this file?

Jon

On Thu, Jan 17, 2019 at 11:44 AM Otávio Gonçalves de Santana <
osant...@tomitribe.com> wrote:

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

Reply via email to