When deploying an EAR to WebSphere, what is the reason for the "duplicate record" SaveFailureException?

When trying to establish an EAR, the following exception is thrown:

Caught Exception installing ApplicationName  
com.ibm.ws.scripting.ScriptingException: com.ibm.websphere.management.application.client.AppDeploymentException: AppDeploymentException: []  
org.eclipse.jst.j2ee.commonarchivecore.internal.exception.SaveFailureException: META-INF/application.xml  
META-INF/application.xml  
duplicate entry: META-INF/application.xml  
org.eclipse.jst.j2ee.commonarchivecore.internal.exception.SaveFailureException: org.eclipse.jst.j2ee.commonarchivecore.internal.exception.SaveFailureException: META-INF/application.xml  

Needless to say, there are no two application.xml files in the EAR file, so I cannot explain the "re-write" error. Is this exception familiar to everyone? How is this allowed?

+3
source share
5 answers

My advice is to open / examine the ear using 7-zip and make sure that there are no two application.xml files at the META-INF level. Zip will create duplicate entries for files in many conditions, especially if you copy source files from multiple directories. We had the same problem.

+4

.

Ear.setAppXml(): ear ant, META-INF/application.xml, ear ( , ).

setAppXml(): appxml ear application.xml. {exploded.dir}/META-INF/application.xml, .

:

Copy the META-INF/application.xml to some /tmp/app.xml
Pass "/tmp/app.xml" for setAppXml() / "appxml" in ear task
Delete the entry: {exploded.dir}/META-INF/application.xml
Pack the EAR now.

, .

+2

, , .

+1

, JAR , EAR, META-INF/application.xml.

? , ( EAR EAR).

0

I had this problem and it turned out to be a problem on the server I was deploying with. The target had a lot of space, the server that performed the deployment was completely absent.

0
source

Source: https://habr.com/ru/post/1742884/


All Articles