
Laszlo Hornyak has submitted this change and it was merged. Change subject: core: Java 7: Fix use of namespaces in StAX writer ...................................................................... core: Java 7: Fix use of namespaces in StAX writer The way we currently use namespaces in the StAX writer for OVF files doesn't work with Java 7. When trying to write attributes without a namespace the following exception is generated: java.lang.RuntimeException: Failed to write attribute at org.ovirt.engine.core.compat.backendcompat.XmlTextWriter.WriteAttributeString(XmlTextWriter.java:44) at org.ovirt.engine.core.utils.ovf.OvfWriter.WriteHeader(OvfWriter.java:49) at org.ovirt.engine.core.utils.ovf.OvfWriter.<init>(OvfWriter.java:40) at org.ovirt.engine.core.utils.ovf.OvfVmWriter.<init>(OvfVmWriter.java:26) at org.ovirt.engine.core.utils.ovf.OvfManager.ExportVm(OvfManager.java:24) Caused by: javax.xml.stream.XMLStreamException: NamespaceURI cannot be null at com.sun.xml.internal.stream.writers.XMLStreamWriterImpl.writeAttribute(XMLStreamWriterImpl.java:611) at org.ovirt.engine.core.compat.backendcompat.XmlTextWriter.WriteAttributeString(XmlTextWriter.java:42) This patch changes the OVF writers so that the always provide the namespaces explicitly. Change-Id: I144bab6daee284b424805c1c56d53d385f80b8ee Signed-off-by: Juan Hernandez <juan.hernandez@redhat.com> --- M backend/manager/modules/compat/src/main/java/org/ovirt/engine/core/compat/backendcompat/XmlTextWriter.java M backend/manager/modules/utils/src/main/java/org/ovirt/engine/core/utils/ovf/IOvfBuilder.java M backend/manager/modules/utils/src/main/java/org/ovirt/engine/core/utils/ovf/OvfTemplateWriter.java M backend/manager/modules/utils/src/main/java/org/ovirt/engine/core/utils/ovf/OvfVmWriter.java M backend/manager/modules/utils/src/main/java/org/ovirt/engine/core/utils/ovf/OvfWriter.java 5 files changed, 200 insertions(+), 171 deletions(-) Approvals: Laszlo Hornyak: Verified; Looks good to me, approved Juan Hernandez: Looks good to me, but someone else must approve -- To view, visit http://gerrit.ovirt.org/4540 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I144bab6daee284b424805c1c56d53d385f80b8ee Gerrit-PatchSet: 6 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Juan Hernandez <juan.hernandez@redhat.com> Gerrit-Reviewer: Eli Mesika <emesika@redhat.com> Gerrit-Reviewer: Juan Hernandez <juan.hernandez@redhat.com> Gerrit-Reviewer: Laszlo Hornyak <lhornyak@redhat.com> Gerrit-Reviewer: Moti Asayag <masayag@redhat.com>