[ 
https://issues.apache.org/jira/browse/TOMEE-2295?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Roberto Cortez updated TOMEE-2295:
----------------------------------
    Fix Version/s:     (was: 8.0.0-M2)
                   8.0.0-M3

> Persistence Unit mapping-file ignored by CmpJpaConversion
> ---------------------------------------------------------
>
>                 Key: TOMEE-2295
>                 URL: https://issues.apache.org/jira/browse/TOMEE-2295
>             Project: TomEE
>          Issue Type: Bug
>    Affects Versions: 1.7.5, 7.0.5, 7.1.0, 8.0.0-M1
>            Reporter: Jonathan Gallimore
>            Assignee: Jonathan Gallimore
>            Priority: Major
>              Labels: pull-request-available
>             Fix For: 1.7.6, 7.0.6, 7.1.1, 8.0.0-M3
>
>
> The CmpJpaConversion code enables TomEE to run CMP entity beans by converting 
> them to JPA "on the fly". It does this by using a persistence unit it creates 
> on the app module named "cmp", and generating an orm.xml file for the 
> persistence component to use.
>  
> However, if you create a persistence.xml file and a custom orm.xml file 
> (using the `openejb.descriptors.output=true` system property, for example) 
> and reference the custom orm.xml in persistence.xml, it is ignored.
>  
> One possible workaround is to remove the mapping file reference from 
> persistence.xml and package it in the artifact as 
> META-INF/openejb-cmp-orm.xml (or WEB-INF/openejb-cmp-orm.xml for .war files): 
> [https://github.com/apache/tomee/blob/0165264d37f9cb6ce6d2585f2f6b0fbd926ad5c4/container/openejb-core/src/main/java/org/apache/openejb/config/ReadDescriptors.java#L553]
>  and 
> [https://github.com/apache/tomee/blob/0165264d37f9cb6ce6d2585f2f6b0fbd926ad5c4/arquillian/arquillian-tomee-tests/arquillian-tomee-webprofile-tests/src/test/java/org/apache/openejb/arquillian/tests/cmp/CmpMappingTest.java#L45]
>  
> However, it should be possible to also check for the presence of an existing 
> mapping file on the cmp persistence unit, and use that as opposed to 
> generating a new one.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to