<ul dir="auto">
<li>[ x ] I have searched the <a href="https://github.com/apache/dubbo/issues">issues</a> of this repository and believe that this is not a duplicate.</li>
<li>[ x ] I have checked the <a href="https://github.com/apache/dubbo/blob/master/FAQ.md">FAQ</a> of this repository and believe that this is not a duplicate.</li>
</ul>
<h3 dir="auto">Environment</h3>
<ul dir="auto">
<li>Dubbo version: 2.7.7</li>
<li>Operating System version: Mac Catalina 10.15.7 (19H2)</li>
<li>Java version: 1.8.0_231</li>
<li>SpringBoot: 1.5.9.RELEASE</li>
</ul>
<h3 dir="auto">Steps to reproduce this issue</h3>
<ol dir="auto">
<li>基于spring boot 1.5.x搭建demo项目并编写测试controller</li>
<li>访问该测试controller，默认返回json格式的response</li>
<li>引用以下包：</li>
</ol>
<div class="highlight highlight-text-xml notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="        &lt;dependency&gt;
            &lt;groupId&gt;org.apache.dubbo&lt;/groupId&gt;
            &lt;artifactId&gt;dubbo-spring-boot-starter&lt;/artifactId&gt;
            &lt;version&gt;2.7.7&lt;/version&gt;
        &lt;/dependency&gt;
        &lt;dependency&gt;
            &lt;groupId&gt;io.springfox&lt;/groupId&gt;
            &lt;artifactId&gt;springfox-swagger2&lt;/artifactId&gt;
            &lt;version&gt;2.9.2&lt;/version&gt;
        &lt;/dependency&gt;
        &lt;dependency&gt;
            &lt;groupId&gt;io.springfox&lt;/groupId&gt;
            &lt;artifactId&gt;springfox-swagger-ui&lt;/artifactId&gt;
            &lt;version&gt;2.9.2&lt;/version&gt;
        &lt;/dependency&gt;
        &lt;dependency&gt;
            &lt;groupId&gt;io.swagger&lt;/groupId&gt;
            &lt;artifactId&gt;swagger-jersey2-jaxrs&lt;/artifactId&gt;
            &lt;version&gt;1.5.9&lt;/version&gt;
        &lt;/dependency&gt;"><pre class="notranslate">        &lt;<span class="pl-ent">dependency</span>&gt;
            &lt;<span class="pl-ent">groupId</span>&gt;org.apache.dubbo&lt;/<span class="pl-ent">groupId</span>&gt;
            &lt;<span class="pl-ent">artifactId</span>&gt;dubbo-spring-boot-starter&lt;/<span class="pl-ent">artifactId</span>&gt;
            &lt;<span class="pl-ent">version</span>&gt;2.7.7&lt;/<span class="pl-ent">version</span>&gt;
        &lt;/<span class="pl-ent">dependency</span>&gt;
        &lt;<span class="pl-ent">dependency</span>&gt;
            &lt;<span class="pl-ent">groupId</span>&gt;io.springfox&lt;/<span class="pl-ent">groupId</span>&gt;
            &lt;<span class="pl-ent">artifactId</span>&gt;springfox-swagger2&lt;/<span class="pl-ent">artifactId</span>&gt;
            &lt;<span class="pl-ent">version</span>&gt;2.9.2&lt;/<span class="pl-ent">version</span>&gt;
        &lt;/<span class="pl-ent">dependency</span>&gt;
        &lt;<span class="pl-ent">dependency</span>&gt;
            &lt;<span class="pl-ent">groupId</span>&gt;io.springfox&lt;/<span class="pl-ent">groupId</span>&gt;
            &lt;<span class="pl-ent">artifactId</span>&gt;springfox-swagger-ui&lt;/<span class="pl-ent">artifactId</span>&gt;
            &lt;<span class="pl-ent">version</span>&gt;2.9.2&lt;/<span class="pl-ent">version</span>&gt;
        &lt;/<span class="pl-ent">dependency</span>&gt;
        &lt;<span class="pl-ent">dependency</span>&gt;
            &lt;<span class="pl-ent">groupId</span>&gt;io.swagger&lt;/<span class="pl-ent">groupId</span>&gt;
            &lt;<span class="pl-ent">artifactId</span>&gt;swagger-jersey2-jaxrs&lt;/<span class="pl-ent">artifactId</span>&gt;
            &lt;<span class="pl-ent">version</span>&gt;1.5.9&lt;/<span class="pl-ent">version</span>&gt;
        &lt;/<span class="pl-ent">dependency</span>&gt;</pre></div>
<ol start="4" dir="auto">
<li>重启demo项目并再次访问测试controller，这时会返回xml格式的response</li>
</ol>
<h3 dir="auto">Expected Result</h3>
<p dir="auto">引用swagger不改变spring boot的默认http message converter组织方式，不影响各接口的response格式。</p>
<h3 dir="auto">Actual Result</h3>
<p dir="auto">引用swagger后改变了spring boot的默认http message converter组织方式，进而改变了各接口的response格式。</p>
<h3 dir="auto">Trouble Shooting</h3>
<ol dir="auto">
<li>dubbo rest集成了swagger，用到了相关的类，比如：<code class="notranslate">io.swagger.jaxrs.listing.BaseApiListingResource</code>。</li>
<li>因此必须引用 <code class="notranslate">swagger-jersey2-jaxrs</code> 包。</li>
<li><code class="notranslate">swagger-jersey2-jaxrs</code> 包引用了 <code class="notranslate">jackson-dataformat-xml</code>包。</li>
<li><code class="notranslate">jackson-dataformat-xml</code>内部的 <code class="notranslate">XmlMapper</code>类会改变SpringBoot的HttpMessageConverter组装过程，从而改变默认response格式。</li>
</ol>
<ul dir="auto">
<li>[ Y] I have searched the <a href="https://github.com/apache/dubbo/issues">issues</a> of this repository and believe that this is not a duplicate.</li>
<li>[ Y] I have checked the <a href="https://github.com/apache/dubbo/blob/master/FAQ.md">FAQ</a> of this repository and believe that this is not a duplicate.</li>
</ul>
<h3 dir="auto">Environment</h3>
<ul dir="auto">
<li>Dubbo version: 2.7.3</li>
<li>Operating System version: windows 10 &amp; centos 7.5</li>
<li>Java version: 1.8</li>
</ul>
<h3 dir="auto">Steps to reproduce this issue</h3>
<ol dir="auto">
<li>start app<br>
该问题有时候出现 有时候又不出现，暂时还没定位到问题。<br>
看现有的issue和我有些不一样 如果每次都出现，那就很好处理了，50%的概率启动出现，url not found的报错，我看下来是，url没有注册进去，经常只有v1可用，s1不可用。</li>
</ol>
<p dir="auto">bootstrap：<br>
protocols:<br>
dubbo:<br>
name: dubbo<br>
port: 30881<br>
http:<br>
name: rest<br>
port: 30991<br>
server: netty<br>
contextpath: biz<br>
keepalive: false<br>
extension: com.XXX.EirExceptionMapper</p>
<p dir="auto"><a class="user-mention notranslate" data-hovercard-type="organization" data-hovercard-url="/orgs/path/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/path">@path</a>("s1")<br>
<a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/consumes/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/consumes">@consumes</a>({MediaType.APPLICATION_JSON, MediaType.TEXT_XML})<br>
<a class="user-mention notranslate" data-hovercard-type="organization" data-hovercard-url="/orgs/produces/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/produces">@produces</a>({MediaType.APPLICATION_JSON, MediaType.TEXT_XML})<br>
public interface Facade1 {<br>
}</p>
<p dir="auto"><a class="user-mention notranslate" data-hovercard-type="organization" data-hovercard-url="/orgs/path/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/path">@path</a>("v1")<br>
<a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/consumes/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/consumes">@consumes</a>({MediaType.APPLICATION_JSON, MediaType.TEXT_XML})<br>
<a class="user-mention notranslate" data-hovercard-type="organization" data-hovercard-url="/orgs/produces/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/produces">@produces</a>({MediaType.APPLICATION_JSON, MediaType.TEXT_XML})<br>
public interface Facade1 {<br>
}</p>
<p dir="auto">javax.ws.rs.NotFoundException: RESTEASY003210: Could not find resource for full path: <a href="http://localhost:30991/biz/s1/eirinfo?no=2020050784981002" rel="nofollow">http://localhost:30991/biz/s1/eirinfo?no=2020050784981002</a><br>
at org.jboss.resteasy.core.registry.ClassNode.match(ClassNode.java:61)<br>
at org.jboss.resteasy.core.registry.RootClassNode.match(RootClassNode.java:47)<br>
at org.jboss.resteasy.core.ResourceMethodRegistry.getResourceInvoker(ResourceMethodRegistry.java:442)<br>
at org.jboss.resteasy.core.SynchronousDispatcher.getInvoker(SynchronousDispatcher.java:300)<br>
at org.jboss.resteasy.core.SynchronousDispatcher.lambda$invoke$4(SynchronousDispatcher.java:221)<br>
at org.jboss.resteasy.core.SynchronousDispatcher.lambda$preprocess$0(SynchronousDispatcher.java:135)<br>
at org.jboss.resteasy.core.interception.PreMatchContainerRequestContext.filter(PreMatchContainerRequestContext.java:355)<br>
at org.jboss.resteasy.core.SynchronousDispatcher.preprocess(SynchronousDispatcher.java:138)<br>
at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:215)<br>
at org.jboss.resteasy.plugins.server.netty.RequestDispatcher.service(RequestDispatcher.java:83)<br>
at org.jboss.resteasy.plugins.server.netty.RequestHandler.channelRead0(RequestHandler.java:51)<br>
at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:105)<br>
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)<br>
at io.netty.channel.AbstractChannelHandlerContext.access$600(AbstractChannelHandlerContext.java:38)<br>
at io.netty.channel.AbstractChannelHandlerContext$7.run(AbstractChannelHandlerContext.java:353)<br>
at io.netty.util.concurrent.AbstractEventExecutor.safeExecute$$$capture(AbstractEventExecutor.java:163)<br>
at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java)<br>
at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:404)<br>
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:466)<br>
at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:897)<br>
at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)<br>
at java.lang.Thread.run(Thread.java:748)</p>