You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tomee.apache.org by "Timothy Ward (JIRA)" <ji...@apache.org> on 2013/05/24 18:58:21 UTC

[jira] [Updated] (OPENEJB-1977) ear file deployment failed with persistence.xml in ear file's META-INF folder

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

Timothy Ward updated OPENEJB-1977:
----------------------------------

    Attachment: jboss-as-kitchensink-ear-ear.ear

This application triggers the error
                
> ear file deployment failed with persistence.xml in ear file's META-INF folder
> -----------------------------------------------------------------------------
>
>                 Key: OPENEJB-1977
>                 URL: https://issues.apache.org/jira/browse/OPENEJB-1977
>             Project: OpenEJB
>          Issue Type: Bug
>          Components: tomee
>    Affects Versions: 4.5.1
>         Environment: windows
>            Reporter: Peter He
>         Attachments: jboss-as-kitchensink-ear-ear.ear
>
>
> I have a ear file which can run the other app server but failed in TOMEE when it has persistence.xml in ear file's META-INF folder. I look at the source code and find the issue.I am sure if it has been fixed in 1.5.2. But I'd like to share my fix.
> in DeploymentLoader.java in openejb-4.5.0\container\openejb-core\src\main\java\org\apache\openejb\config
> in method: AppModule createAppModule(final File jarFile, final String jarPath)
> after the following line:
> appModule.getAltDDs().putAll(appDescriptors);
> we should convert persistence.xml entry to List<URL>. I add a very simple method in the following lines
> 	private static void convertPersistenceToList(Map map){
> 		Object url = map.get("persistence.xml");
>         if(url!=null && url instanceof URL){
> 			List<URL> persistences = new ArrayList<URL>();
> 			persistences.add((URL)url);
>         	map.put("persistence.xml", persistences);
> 		}
> 	}
> and call it like the following lines
>             Map<String, Object> altDDs = appModule.getAltDDs();
>             altDDs.putAll(appDescriptors);
>             convertPersistenceToList(altDDs);

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira