不同包中相同类名的JAXB元素应该相同(使用@XMLTYPE,例如:“user”)

时间:2016-03-23 06:06:08

标签: java xml jaxb

我们有两个包:

  1. com.yash.user
  2. com.indore.user
  3. 现在,当我们为它们创建JAXB元素时,它显示以下异常:

    Two classes have the same XML type name "{http://api.yash.com/v3}user".
    Use @XmlType.name and @XmlType.namespace to assign different names to them.
    
      this problem is related to the following location:
            at com.yash.user
            at protected com.indore.user 
    
    -->  this problem is related to the following location:
            at com.yash.user
    

    但对于这两个类,我们需要一个相同名称@XMLTYPE(name =“user”)。

    我们可以为此找到解决方案吗?

0 个答案:

没有答案