Bug 823191

Summary: OVF XML writer doesn't work with Java 7 StAX implementation
Product: Red Hat Enterprise Virtualization Manager Reporter: Juan Hernández <juan.hernandez>
Component: ovirt-engineAssignee: Juan Hernández <juan.hernandez>
Status: CLOSED CURRENTRELEASE QA Contact: Pavel Stehlik <pstehlik>
Severity: high Docs Contact:
Priority: unspecified    
Version: 3.1.0CC: acathrow, dyasny, iheim, lpeer, oramraz, Rhev-m-bugs, yeylon, ykaul, yzaslavs
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard: infra
Fixed In Version: si6 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Fedora 17 Beta
Last Closed: 2012-12-04 20:02:12 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: Infra RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Juan Hernández 2012-05-19 19:15:37 UTC
Description of problem:

When creating a VM the OVF XML writer is used to generate the metadata. This doesn't work with Java 7 because the code doesn't provide explicitly the namespace URIs for some attributes.

Version-Release number of selected component (if applicable):

ovirt-engine commit 44f32cf2892ff99a8c5fcf63eb617e85ac63c249

How reproducible:

Always.

Steps to Reproduce:

1. Build the engine with Java 7.
2. Run the engine with Java 7.
3. Create a virtual machine.
  
Actual results:

The following exception appears in the log of the engine:

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)

The creation of the virtual machine never finishes.

Expected results:

The virtual machine should be created without problems.

Comment 1 Juan Hernández 2012-05-19 19:17:39 UTC
The following change has been proposed to fix the problem in ovirt-engine:

http://gerrit.ovirt.org/4540

Comment 2 Juan Hernández 2012-06-04 08:08:35 UTC
This change has already been merged.

Comment 3 Yaniv Kaul 2012-06-04 08:19:33 UTC
AFAIK, downstream does not use Java 7 yet - how do we test this fix downstream?

Comment 4 Juan Hernández 2012-06-04 08:24:55 UTC
(In reply to comment #3)
> AFAIK, downstream does not use Java 7 yet - how do we test this fix
> downstream?

Downstream used to work correctly before this change. What we need to make sure is that it continues to work correctly after. A way to do it is to create a virtual machine before without the change, take the generated OVF file and compare it with the result of creating the same VM after the change. The OVF files should be exactly equal.

Comment 5 Yaniv Kaul 2012-09-13 10:54:51 UTC
SI18: as we don't have an OVF from before the change, and OVF look OK right now, I'm moving this bug to VERIFIED. If we find specific issues with the OVF, we'll re-open.