Hi!
The issue concerns working with the XenServer SDK in Java, problem arose upon starting work with the latest version XCP 8.3, and error occurred:
Caused by: org.apache.xmlrpc.client.XmlRpcClientException: Failed to parse server's response: Duplicate name: restrict_vtpm
at org.apache.xmlrpc.client.XmlRpcStreamTransport.readResponse(XmlRpcStreamTransport.java:188) ~[engine.jar:?]
at org.apache.xmlrpc.client.XmlRpcStreamTransport.sendRequest(XmlRpcStreamTransport.java:156) ~[engine.jar:?]
at org.apache.xmlrpc.client.XmlRpcHttpTransport.sendRequest(XmlRpcHttpTransport.java:143) ~[engine.jar:?]
at org.apache.xmlrpc.client.XmlRpcSunHttpTransport.sendRequest(XmlRpcSunHttpTransport.java:69) ~[engine.jar:?]
at org.apache.xmlrpc.client.XmlRpcClientWorker.execute(XmlRpcClientWorker.java:56) ~[engine.jar:?]
at org.apache.xmlrpc.client.XmlRpcClient.execute(XmlRpcClient.java:167) ~[engine.jar:?]
at org.apache.xmlrpc.client.XmlRpcClient.execute(XmlRpcClient.java:137) ~[engine.jar:?]
at org.apache.xmlrpc.client.XmlRpcClient.execute(XmlRpcClient.java:126) ~[engine.jar:?]
at com.xensource.xenapi.Connection.dispatch(Connection.java:216) ~[engine.jar:?]
at com.xensource.xenapi.Host.getAllRecords(Host.java:3831) ~[engine.jar:?]
The API sends this value twice in the method:
Host.getAllRecords(connector)
(package com.xensource.xenapi;)
Everything else happens under the hood of the library, and I don't have access there, but when debugging, I did indeed discover that the second restrict_vtpm field is being returned.
I found the MapParser (package org.apache.xmlrpc.parser;) addResult method doesn't allow working with two identical fields:
protected void addResult(Object pResult) throws SAXException {
if (inName) {
nameObject = pResult;
} else {
if (nameObject == null) {
throw new SAXParseException("Invalid state: Expected name",
getDocumentLocator());
} else {
if (map.containsKey(nameObject)) {
throw new SAXParseException("Duplicate name: " + nameObject,
getDocumentLocator());
} else {
map.put(nameObject, pResult);
}
}
}
}
So, the Java libraries don't allow this behavior.
I started looking for this setting in XCP UI and CLI but couldn't find any specific restriction related to vTPM. My searches also didn't yield any results.
Thus, I have no access to the internals of the library, nor do I have control over this setting. Could you suggest please what could be done in this case? Could this issue be related to my use of an old version of your SDK (xenserver-7.6.0)?
If so, is there any way I can fix it without updating the library? (I have too many dependencies tied to it already.)
Thanks in advance and have a nice day!