林有這個錯誤,它說,我有兩個類相同的XML類型名稱的兩類具有相同的XML類型名稱
所以這個問題是InfoSource之間 - > NameSearchFilters - > SearchRequest
錯誤
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;
爲什麼會出現問題嗎?
什麼時候你的代碼失敗,上下文創建期間?它不會在我的盒子上失敗,但我沒有可用的NameSearchCriteria類。也許你可以發佈這個呢? – home
該應用程序可以跨多個teirs工作,並且在未部署時可以正常工作,問題是在調用marshaller時部署到服務器(本例中爲本地tomcat)時的問題。 –
瞭解,您是否在系統上運行不同的JDK/JRE?我可能是JAXB版本造成麻煩... – home