简体   繁体   中英

Resource interpreted as Document but transferred with MIME type application/xml

I have some RESTful APIs that I am building using Apache CXF. I was using the browser to test my results and this works fine mostly. However, in some cases I get "Resource interpreted as Document but transferred with MIME type application/xm" error on Chrome and with firefox I get "XML Parsing Error: no element found"

The strange thing is that if I restrict my response by adding some conditions then it works fine. This makes me thing its related to the size of response. I have searched the web but I didn't find any concrete answers.

What am I missing? Any help is appreciated.

Thanks.

I am using Apache Camel to route my requests to different services. I had the streamCache flag enabled for my CamelContext configuration. Disabling the streamCaching resolved the issue.

Details about stream caching can found at the following url: http://camel.apache.org/stream-caching.html

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM