No adapter for endpoint

筅森魡賤 提交于 2021-02-08 08:41:37

问题


I have a Java class with the @Endpoint annotation. It was working fine until I try to add another parameter - MessageContext and I am getting the "No adapter for endpoint"

See my method signature below:

@PayloadRoot(localPart = "PolicyNewBusinessQuoteRequest", namespace = TARGET_NAMESPACE)
  @ResponsePayload
  public PolicyNewBusinessQuoteResponseDocument processQuoteRequest(@RequestPayload PolicyNewBusinessQuoteRequestDocument requestDocument, MessageContext messageContext) throws Exception {
}

回答1:


Your data is not sufficient to answer this question.

But most of the times,

java.lang.IllegalStateException: No adapter for endpoint […]: 
Is your endpoint annotated with @Endpoint, 
or does it implement a supported interface like MessageHandler or PayloadEndpoint?

this exception is can be resolved with

Addition of @XmlRootElement annotation on your request and response class.




回答2:


I have found the solution to my own problem:

http://forum.spring.io/forum/spring-projects/web-services/126322-unable-to-include-and-access-messagecontext-on-endpoint-method



来源:https://stackoverflow.com/questions/46314081/no-adapter-for-endpoint

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!