Bug 823191 - OVF XML writer doesn't work with Java 7 StAX implementation
OVF XML writer doesn't work with Java 7 StAX implementation
Status: CLOSED CURRENTRELEASE
Product: Red Hat Enterprise Virtualization Manager
Classification: Red Hat
Component: ovirt-engine (Show other bugs)
3.1.0
All Linux
unspecified Severity high
: ---
: ---
Assigned To: Juan Hernández
Pavel Stehlik
infra
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-05-19 15:15 EDT by Juan Hernández
Modified: 2016-02-10 14:41 EST (History)
9 users (show)

See Also:
Fixed In Version: si6
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Fedora 17 Beta
Last Closed: 2012-12-04 15:02:12 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: Infra
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Juan Hernández 2012-05-19 15:15:37 EDT
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 15:17:39 EDT
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 04:08:35 EDT
This change has already been merged.
Comment 3 Yaniv Kaul 2012-06-04 04:19:33 EDT
AFAIK, downstream does not use Java 7 yet - how do we test this fix downstream?
Comment 4 Juan Hernández 2012-06-04 04:24:55 EDT
(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 06:54:51 EDT
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.

Note You need to log in before you can comment on or make changes to this bug.