Im having this error where it says that i have two classes of same XML type name
so the problem is between InfoSource -> NameSearchFilters -> SearchRequest
error
Caused by: com.sun.xml.internal.bind.v2.runtime.IllegalAnnotationsException: 2 counts of IllegalAnnotationExceptions
Two classes have the same XML type name "{http://test.au/schema/namesearch}InfoSource". Use @XmlType.name and @XmlType.namespace to assign different names to them.
this problem is related to the following location:
at au.test.identitySearch.model.InfoSource
at protected au.test.identitySearch.model.InfoSource au.test.identitySearch.model.nameSearch.NameSearchFilters.infoSourceList
at au.test.identitySearch.model.nameSearch.NameSearchFilters
this problem is related to the following location:
at au.test.identitySearch.model.InfoSource
at protected au.test.identitySearch.model.InfoSource au.test.identitySearch.model.nameSearch.NameSearchFilters.infoSourceList
at au.test.identitySearch.model.nameSearch.NameSearchFilters
at protected au.test.identitySearch.model.nameSearch.NameSearchFilters au.test.identitySearch.ws.model.SearchRequest.searchFilters
at au.test.identitySearch.ws.model.SearchRequest
InfoSource
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "InfoSource", propOrder = {
"infoSource"
})
public class InfoSource {
@XmlElement
protected List<String> infoSource;
NameSearchFilters
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "NameSearchFilters", propOrder = {
})
public class NameSearchFilters {
@XmlElement
protected InfoSource infoSourceList;
@XmlElement
protected String nameType;
SearchRequest
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = {
"searchControls",
"searchCriteria",
"searchFilters"
})
@XmlRootElement(name = "searchRequest")
public class SearchRequest {
@XmlElement(required = true)
protected SearchControls searchControls;
@XmlElement(required = true)
protected NameSearchCriteria searchCriteria;
@XmlElement
protected NameSearchFilters searchFilters;
Why is there problem here?
Did you try adding different values of namespace attribute to each of them like @XmlType(namespace="test1", name = "InfoSource", propOrder = { "infoSource" }) )
?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With