Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我需要在 JAX-WS Web 方法中使用接口作为参数和返回类型。启动服务器时,我收到一个IllegalAnnotationsException,它告诉我 JAXB 无法处理接口。
IllegalAnnotationsException
我试图用@XmlRootElement和@XmlElement(type = ...)分别注释我的类、方法结果和方法参数,但这不起作用。
@XmlRootElement
@XmlElement(type = ...)
如何在 JAX-WS Web 方法中使用接口作为参数和结果类型?
看看@XmlJavaTypeAdapter。也许它会成功。更多信息可在此处获得。