In one of my cxf projects, after modifying the URL-pattern of Web. XML, the following error is returned:
10:09:00 org. Apache. cxf. phase. phaseinterceptorchain dointercept
Information: Interceptor has thrown exception, unwinding now response was of unexpected text/html contenttype. Incoming portion of HTML stream: <! Doctype HTML public "-// W3C // dtd html 4.01 transitional // en" "http://www.w3.org/TR/html4/loose.dtd"> <HTML> Exception in thread "Main" javax. xml. ws. Soap. soapfaultexception: response was of unexpected text/html contenttype. Incoming portion of HTML stream: <! Doctype HTML public "-// W3C // dtd html 4.01 transitional // en" "http://www.w3.org/TR/html4/loose.dtd"> <HTML> At org. Apache. cxf. jaxws. jaxwsclientproxy. Invoke (jaxwsclientproxy. Java: 145)
At $ proxy43.gettermlist (unknown source)
At com. synjones. terminalmonitor. WebService. Client. Client. Main (client. Java: 26)
Caused by: org. Apache. cxf. Interceptor. fault: response was of unexpected text/html contenttype. Incoming portion of HTML stream: <! Doctype HTML public "-// W3C // dtd html 4.01 transitional // en" "http://www.w3.org/TR/html4/loose.dtd"> <HTML> At org. Apache. cxf. Interceptor. staxininterceptor. handlemessage (staxininterceptor. Java: 73)
At org. Apache. cxf. phase. phaseinterceptorchain. dointercept (phaseinterceptorchain. Java: 226)
At org. Apache. cxf. endpoint. clientimpl. onmessage (clientimpl. Java: 641)
At org. Apache. cxf. Transport. http. httpconduit $ wrappedoutputstream. handleresponseinternal (httpconduit. Java: 2102)
At org. Apache. cxf. Transport. http. httpconduit $ wrappedoutputstream. handleresponse (httpconduit. Java: 1980)
At org. Apache. cxf. Transport. http. httpconduit $ wrappedoutputstream. Close (httpconduit. Java: 1905)
At org. Apache. cxf. Transport. abstractconducting it. Close (abstractconducting it. Java: 66)
At org. Apache. cxf. Transport. http. httpconduit. Close (httpconduit. Java: 600)
At org. Apache. cxf. Interceptor. messagesenderinterceptor $ messagesenderendinginterceptor. handlemessage (messagesenderinterceptor. Java: 62)
At org. Apache. cxf. phase. phaseinterceptorchain. dointercept (phaseinterceptorchain. Java: 226)
At org. Apache. cxf. endpoint. clientimpl. Invoke (clientimpl. Java: 469)
At org. Apache. cxf. endpoint. clientimpl. Invoke (clientimpl. Java: 299)
At org. Apache. cxf. endpoint. clientimpl. Invoke (clientimpl. Java: 251)
At org. Apache. cxf. frontend. clientproxy. invokesync (clientproxy. Java: 73)
At org. Apache. cxf. jaxws. jaxwsclientproxy. Invoke (jaxwsclientproxy. Java: 124)
... 2 more
I am not sure about the error description. Google's key information: Interceptor has thrown exception, unwinding now response was of unexpected text/html contenttype. but no satisfactory answer was found. Later I saw that the prompt message contains http: // localhost: 8088/Terminal/termwebservice? WSDL. This URL has one more termwebservice than I configured.
Is the web that I just configured. the URL-pattern of XML, Which is <URL-pattern>/termwebservice/* </url-pattern>, in the past, it was <URL-pattern>/* </url-pattern>, so the problem was found, that is, adding a termwebservice to the URL,
Therefore, you can add termwebservice on the client end of the call to call the service. Because errors are misleading, you can check whether the error is correct on the Internet.