,我实行的是启动和运行,当我尝试运行客户端,我得到以下错误关于使用的wsimport生成的类Web服务,Web服务 - 客户端类
Caused by: java.security.PrivilegedActionException: com.sun.xml.internal.bind.v2.runtime.IllegalAnnotationsException: 4 counts of IllegalAnnotationExceptions
Two classes have the same XML type name "{http://server.agency.hw2/}userJoined". Use @XmlType.name and @XmlType.namespace to assign different names to them.
this problem is related to the following location:
at hw2.chat.backend.main.generatedfromserver.UserJoined
at public javax.xml.bind.JAXBElement hw2.chat.backend.main.generatedfromserver.ObjectFactory.createUserJoined(hw2.chat.backend.main.generatedfromserver.UserJoined)
at hw2.chat.backend.main.generatedfromserver.ObjectFactory
this problem is related to the following location:
at ChatCompany.BackendChatServer.hw2.chat.backend.main.generatedfromserver.UserJoined
Two classes have the same XML type name "{http://server.agency.hw2/}userJoinedResponse". Use @XmlType.name and @XmlType.namespace to assign different names to them.
this problem is related to the following location:
at hw2.chat.backend.main.generatedfromserver.UserJoinedResponse
at public javax.xml.bind.JAXBElement hw2.chat.backend.main.generatedfromserver.ObjectFactory.createUserJoinedResponse(hw2.chat.backend.main.generatedfromserver.UserJoinedResponse)
但我无法弄清楚错误到底是什么意思。我假设我需要改变的东西的注解在这些类由编译器指出:
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "userJoinedResponse")
public class UserJoinedResponse {
}
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "userJoined", propOrder = {
"arg0"
})
public class UserJoined {
可能有人请指出为什么有一个名称冲突,我需要改变什么注解?
感谢
所有生成的代码是在'wsimport'的一次执行中产生的,还是多次执行的? – skaffman 2010-06-06 08:45:25
错误,wsimport的执行次数是什么意思?如果这回答我只是通过Windows CMD运行命令。 – Noona 2010-06-06 09:10:43
您可以粘贴UserJoined类中使用的注释吗?你在处理你自己没有写的代码吗?如果是,请在所有代码中搜索“name =”userJoinedResponse“”和“name =”userJoined“',看看是否找到重复的注释。 – 2010-06-06 09:56:17