Description of problem: When trying to create/edit a vm via API and setting custom compatibility version to unsupported values, we get java.lang.NullPointerException instead of an informative error message. Example of body for PUT message: <vm> <custom_compatibility_version> <major>7</major> <minor>4</minor> </custom_compatibility_version> </vm> Version-Release number of selected component (if applicable): rhevm-4.0.2.6-0.1.el7ev.noarch How reproducible: always Steps to Reproduce: 1. Try to create a vm or edit a vm and set custom_compatibility_version attribute with some values which are no support (see xml above). Actual results: <fault> <detail>java.lang.NullPointerException</detail> <reason>Operation Failed</reason> </fault> In engine.log we get a long trace starting with: 2016-08-16 14:14:07,195 ERROR [org.ovirt.engine.core.bll.CommandsFactory] (default task-8) [] An exception has occured while trying to create a command object for command 'UpdateVm': WELD-000049: Unable to invoke protected final void org. ovirt.engine.core.bll.CommandBase.postConstruct() on org.ovirt.engine.core.bll.UpdateVmCommand@f5f6dbe 2016-08-16 14:14:07,219 ERROR [org.ovirt.engine.api.restapi.resource.AbstractBackendResource] (default task-8) [] Operation Failed: java.lang.NullPointerException 2016-08-16 14:14:07,219 ERROR [org.ovirt.engine.api.restapi.resource.AbstractBackendResource] (default task-8) [] Exception: javax.ejb.EJBException: java.lang.NullPointerException Expected results: Action fails with an informative error message e.g. "Update failed, custom compatibility version is not supported by hosts in the cluster"
Verified on 4.1.0-9