<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> 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 class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> 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.5.3</li>
<li>Operating System version: MacOS Mojave 10.14.4 (18E226)</li>
<li>Java version: 1.8</li>
</ul>
<h3 dir="auto">Steps to reproduce this issue</h3>
<ol dir="auto">
<li>register script route</li>
</ol>
<div class="highlight highlight-source-java notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="URL registryUrl = URL.valueOf(&quot;zookeeper://127.0.0.1:2181&quot;);
        ZookeeperRegistryFactory zookeeperRegistryFactory = new
                ZookeeperRegistryFactory();
        zookeeperRegistryFactory.setZookeeperTransporter(new
                CuratorZookeeperTransporter());
        Registry zookeeperRegistry = zookeeperRegistryFactory.createRegistry(registryUrl);
        URL routerURL =
//                URL.valueOf(&quot;script://0.0.0.0/com.wk.dubbotest.IDubboTest?category=routers&amp;dynamic=false&amp;enabled=true&amp;force=false&amp;priority=0&amp;runtime=true&amp;rule=&quot;
                URL.valueOf(&quot;script://0.0.0.0/com.wk.dubbotest.IDubboTest?type=javascript&amp;rule=&quot;
                + URL.encode(get_demoService_createUser_router()));

//        routerURL = routerURL.addParameter(&quot;rule&quot;, URL.encode(get_demoService_createUser_router()));
//        zookeeperRegistry.register(routerURL);     // 注册
         zookeeperRegistry.unregister(routerURL); // 取消注册"><pre class="notranslate"><span class="pl-smi">URL</span> <span class="pl-s1">registryUrl</span> = <span class="pl-smi">URL</span>.<span class="pl-en">valueOf</span>(<span class="pl-s">"zookeeper://127.0.0.1:2181"</span>);
        <span class="pl-smi">ZookeeperRegistryFactory</span> <span class="pl-s1">zookeeperRegistryFactory</span> = <span class="pl-k">new</span>
                <span class="pl-smi">ZookeeperRegistryFactory</span>();
        <span class="pl-s1">zookeeperRegistryFactory</span>.<span class="pl-en">setZookeeperTransporter</span>(<span class="pl-k">new</span>
                <span class="pl-smi">CuratorZookeeperTransporter</span>());
        <span class="pl-smi">Registry</span> <span class="pl-s1">zookeeperRegistry</span> = <span class="pl-s1">zookeeperRegistryFactory</span>.<span class="pl-en">createRegistry</span>(<span class="pl-s1">registryUrl</span>);
        <span class="pl-smi">URL</span> <span class="pl-s1">routerURL</span> =
<span class="pl-c">//                URL.valueOf("script://0.0.0.0/com.wk.dubbotest.IDubboTest?category=routers&amp;dynamic=false&amp;enabled=true&amp;force=false&amp;priority=0&amp;runtime=true&amp;rule="</span>
                <span class="pl-smi">URL</span>.<span class="pl-en">valueOf</span>(<span class="pl-s">"script://0.0.0.0/com.wk.dubbotest.IDubboTest?type=javascript&amp;rule="</span>
                + <span class="pl-smi">URL</span>.<span class="pl-en">encode</span>(<span class="pl-en">get_demoService_createUser_router</span>()));

<span class="pl-c">//        routerURL = routerURL.addParameter("rule", URL.encode(get_demoService_createUser_router()));</span>
<span class="pl-c">//        zookeeperRegistry.register(routerURL);     // 注册</span>
         <span class="pl-s1">zookeeperRegistry</span>.<span class="pl-en">unregister</span>(<span class="pl-s1">routerURL</span>); <span class="pl-c">// 取消注册</span></pre></div>
<ol start="2" dir="auto">
<li>consumer print error</li>
</ol>
<p dir="auto">Pls. provide [GitHub address] to reproduce this issue.</p>
<h3 dir="auto">Expected Result</h3>
<p dir="auto">I hope that consumer can work correctly and the script route can take effect</p>
<h3 dir="auto">Actual Result</h3>
<p dir="auto">Consumer  print error when I registered the script route</p>
<p dir="auto">If there is an exception, please attach the exception trace:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="2019-09-02 11:39:59.302 ERROR 5026 --- [-127.0.0.1:2181] c.a.d.r.integration.RegistryDirectory    : Unsupported protocol script in notified url: script://0.0.0.0/com.wk.dubbotest.IDubboTest?rule=function+route%28invokers%29+%7B++++var+result+%3D+new+java.util.ArrayList%28invokers.size%28%29%29%3B++++result.add%28invokers.get%280%29%29%3B++++return+result%3B%7Droute%28invokers%29%3B&amp;type=javascript from registry 127.0.0.1:2181 to consumer 10.38.1.51, supported protocol: [dubbo, injvm, mock, redis, registry, rmi, thrift]

java.lang.IllegalStateException: Unsupported protocol script in notified url: script://0.0.0.0/com.wk.dubbotest.IDubboTest?rule=function+route%28invokers%29+%7B++++var+result+%3D+new+java.util.ArrayList%28invokers.size%28%29%29%3B++++result.add%28invokers.get%280%29%29%3B++++return+result%3B%7Droute%28invokers%29%3B&amp;type=javascript from registry 127.0.0.1:2181 to consumer 10.38.1.51, supported protocol: [dubbo, injvm, mock, redis, registry, rmi, thrift]
	at com.alibaba.dubbo.registry.integration.RegistryDirectory.toInvokers(RegistryDirectory.java:372) [dubbo-2.5.3.jar:2.5.3]
	at com.alibaba.dubbo.registry.integration.RegistryDirectory.refreshInvoker(RegistryDirectory.java:224) [dubbo-2.5.3.jar:2.5.3]
	at com.alibaba.dubbo.registry.integration.RegistryDirectory.notify(RegistryDirectory.java:195) [dubbo-2.5.3.jar:2.5.3]
	at com.alibaba.dubbo.registry.support.AbstractRegistry.notify(AbstractRegistry.java:449) [dubbo-2.5.3.jar:2.5.3]
	at com.alibaba.dubbo.registry.support.FailbackRegistry.doNotify(FailbackRegistry.java:273) [dubbo-2.5.3.jar:2.5.3]
	at com.alibaba.dubbo.registry.support.FailbackRegistry.notify(FailbackRegistry.java:259) [dubbo-2.5.3.jar:2.5.3]
	at com.alibaba.dubbo.registry.zookeeper.ZookeeperRegistry.access$400(ZookeeperRegistry.java:45) [dubbo-2.5.3.jar:2.5.3]
	at com.alibaba.dubbo.registry.zookeeper.ZookeeperRegistry$3.childChanged(ZookeeperRegistry.java:159) [dubbo-2.5.3.jar:2.5.3]
	at com.alibaba.dubbo.remoting.zookeeper.zkclient.ZkclientZookeeperClient$2.handleChildChange(ZkclientZookeeperClient.java:82) [dubbo-2.5.3.jar:2.5.3]
	at org.I0Itec.zkclient.ZkClient$10.run(ZkClient.java:843) [zkclient-0.9.jar:na]
	at org.I0Itec.zkclient.ZkEventThread.run(ZkEventThread.java:71) [zkclient-0.9.jar:na]"><pre class="notranslate"><code class="notranslate">2019-09-02 11:39:59.302 ERROR 5026 --- [-127.0.0.1:2181] c.a.d.r.integration.RegistryDirectory    : Unsupported protocol script in notified url: script://0.0.0.0/com.wk.dubbotest.IDubboTest?rule=function+route%28invokers%29+%7B++++var+result+%3D+new+java.util.ArrayList%28invokers.size%28%29%29%3B++++result.add%28invokers.get%280%29%29%3B++++return+result%3B%7Droute%28invokers%29%3B&amp;type=javascript from registry 127.0.0.1:2181 to consumer 10.38.1.51, supported protocol: [dubbo, injvm, mock, redis, registry, rmi, thrift]

java.lang.IllegalStateException: Unsupported protocol script in notified url: script://0.0.0.0/com.wk.dubbotest.IDubboTest?rule=function+route%28invokers%29+%7B++++var+result+%3D+new+java.util.ArrayList%28invokers.size%28%29%29%3B++++result.add%28invokers.get%280%29%29%3B++++return+result%3B%7Droute%28invokers%29%3B&amp;type=javascript from registry 127.0.0.1:2181 to consumer 10.38.1.51, supported protocol: [dubbo, injvm, mock, redis, registry, rmi, thrift]
	at com.alibaba.dubbo.registry.integration.RegistryDirectory.toInvokers(RegistryDirectory.java:372) [dubbo-2.5.3.jar:2.5.3]
	at com.alibaba.dubbo.registry.integration.RegistryDirectory.refreshInvoker(RegistryDirectory.java:224) [dubbo-2.5.3.jar:2.5.3]
	at com.alibaba.dubbo.registry.integration.RegistryDirectory.notify(RegistryDirectory.java:195) [dubbo-2.5.3.jar:2.5.3]
	at com.alibaba.dubbo.registry.support.AbstractRegistry.notify(AbstractRegistry.java:449) [dubbo-2.5.3.jar:2.5.3]
	at com.alibaba.dubbo.registry.support.FailbackRegistry.doNotify(FailbackRegistry.java:273) [dubbo-2.5.3.jar:2.5.3]
	at com.alibaba.dubbo.registry.support.FailbackRegistry.notify(FailbackRegistry.java:259) [dubbo-2.5.3.jar:2.5.3]
	at com.alibaba.dubbo.registry.zookeeper.ZookeeperRegistry.access$400(ZookeeperRegistry.java:45) [dubbo-2.5.3.jar:2.5.3]
	at com.alibaba.dubbo.registry.zookeeper.ZookeeperRegistry$3.childChanged(ZookeeperRegistry.java:159) [dubbo-2.5.3.jar:2.5.3]
	at com.alibaba.dubbo.remoting.zookeeper.zkclient.ZkclientZookeeperClient$2.handleChildChange(ZkclientZookeeperClient.java:82) [dubbo-2.5.3.jar:2.5.3]
	at org.I0Itec.zkclient.ZkClient$10.run(ZkClient.java:843) [zkclient-0.9.jar:na]
	at org.I0Itec.zkclient.ZkEventThread.run(ZkEventThread.java:71) [zkclient-0.9.jar:na]
</code></pre></div>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> 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 class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> 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.2</li>
<li>Operating System version: macOS 10.12.6</li>
<li>Java version: 1.8</li>
</ul>
<h3 dir="auto">Steps to reproduce this issue</h3>
<ol dir="auto">
<li>使用protobuf-json的序列化方式</li>
<li>进行普通的dubbo RPC调用</li>
</ol>
<h3 dir="auto">Expected Result</h3>
<p dir="auto">正常调用</p>
<h3 dir="auto">Actual Result</h3>
<p dir="auto">报错,序列化失败</p>
<p dir="auto">If there is an exception, please attach the exception trace:</p>
<div class="highlight highlight-source-java notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="Caused by: java.lang.IllegalArgumentException: This serialization only support google protobuf object, the object class is: java.lang.String
	at org.apache.dubbo.common.serialize.protobuf.support.GenericProtobufObjectOutput.writeObject(GenericProtobufObjectOutput.java:94)
	at org.apache.dubbo.common.serialize.protobuf.support.GenericProtobufObjectOutput.writeUTF(GenericProtobufObjectOutput.java:74)
	at org.apache.dubbo.rpc.protocol.dubbo.DubboCodec.encodeRequestData(DubboCodec.java:176)
	at org.apache.dubbo.remoting.exchange.codec.ExchangeCodec.encodeRequest(ExchangeCodec.java:238)
	at org.apache.dubbo.remoting.exchange.codec.ExchangeCodec.encode(ExchangeCodec.java:69)
	at org.apache.dubbo.rpc.protocol.dubbo.DubboCountCodec.encode(DubboCountCodec.java:40)
	at org.apache.dubbo.remoting.transport.netty4.NettyCodecAdapter$InternalEncoder.encode(NettyCodecAdapter.java:70)
	at io.netty.handler.codec.MessageToByteEncoder.write(MessageToByteEncoder.java:107)
	... 23 more

	at org.apache.dubbo.remoting.exchange.support.DefaultFuture.doReceived(DefaultFuture.java:191)
	at org.apache.dubbo.remoting.exchange.support.DefaultFuture.received(DefaultFuture.java:153)
	at org.apache.dubbo.remoting.exchange.support.DefaultFuture.received(DefaultFuture.java:141)
	at org.apache.dubbo.remoting.exchange.support.header.HeaderExchangeHandler.handleResponse(HeaderExchangeHandler.java:62)
	at org.apache.dubbo.remoting.exchange.support.header.HeaderExchangeHandler.received(HeaderExchangeHandler.java:199)
	at org.apache.dubbo.remoting.transport.DecodeHandler.received(DecodeHandler.java:51)
	at org.apache.dubbo.remoting.transport.dispatcher.ChannelEventRunnable.run(ChannelEventRunnable.java:57)
	... 3 more
"><pre class="notranslate"><span class="pl-smi">Caused</span> <span class="pl-s1">by</span>: <span class="pl-s1">java</span>.<span class="pl-s1">lang</span>.<span class="pl-s1">IllegalArgumentException</span>: <span class="pl-s1">This</span> <span class="pl-s1">serialization</span> <span class="pl-s1">only</span> <span class="pl-s1">support</span> <span class="pl-s1">google</span> <span class="pl-s1">protobuf</span> <span class="pl-s1">object</span>, <span class="pl-s1">the</span> <span class="pl-smi">object</span> <span class="pl-s1">class</span> <span class="pl-s1">is</span>: <span class="pl-smi">java</span>.<span class="pl-smi">lang</span>.<span class="pl-smi">String</span>
	<span class="pl-s1">at</span> <span class="pl-s1">org</span>.<span class="pl-s1">apache</span>.<span class="pl-s1">dubbo</span>.<span class="pl-s1">common</span>.<span class="pl-s1">serialize</span>.<span class="pl-s1">protobuf</span>.<span class="pl-s1">support</span>.<span class="pl-s1">GenericProtobufObjectOutput</span>.<span class="pl-en">writeObject</span>(<span class="pl-smi">GenericProtobufObjectOutput</span>.<span class="pl-smi">java</span>:<span class="pl-c1">94</span>)
	<span class="pl-smi">at</span> <span class="pl-s1">org</span>.<span class="pl-s1">apache</span>.<span class="pl-s1">dubbo</span>.<span class="pl-s1">common</span>.<span class="pl-s1">serialize</span>.<span class="pl-s1">protobuf</span>.<span class="pl-s1">support</span>.<span class="pl-s1">GenericProtobufObjectOutput</span>.<span class="pl-s1">writeUTF</span>(<span class="pl-smi">GenericProtobufObjectOutput</span>.<span class="pl-smi">java</span>:<span class="pl-c1">74</span>)
	<span class="pl-smi">at</span> <span class="pl-s1">org</span>.<span class="pl-s1">apache</span>.<span class="pl-s1">dubbo</span>.<span class="pl-s1">rpc</span>.<span class="pl-s1">protocol</span>.<span class="pl-s1">dubbo</span>.<span class="pl-s1">DubboCodec</span>.<span class="pl-en">encodeRequestData</span>(<span class="pl-smi">DubboCodec</span>.<span class="pl-smi">java</span>:<span class="pl-c1">176</span>)
	<span class="pl-s1">at</span> <span class="pl-s1">org</span>.<span class="pl-s1">apache</span>.<span class="pl-s1">dubbo</span>.<span class="pl-s1">remoting</span>.<span class="pl-s1">exchange</span>.<span class="pl-s1">codec</span>.<span class="pl-s1">ExchangeCodec</span>.<span class="pl-en">encodeRequest</span>(<span class="pl-smi">ExchangeCodec</span>.<span class="pl-smi">java</span>:<span class="pl-c1">238</span>)
	<span class="pl-s1">at</span> <span class="pl-s1">org</span>.<span class="pl-s1">apache</span>.<span class="pl-s1">dubbo</span>.<span class="pl-s1">remoting</span>.<span class="pl-s1">exchange</span>.<span class="pl-s1">codec</span>.<span class="pl-s1">ExchangeCodec</span>.<span class="pl-en">encode</span>(<span class="pl-smi">ExchangeCodec</span>.<span class="pl-smi">java</span>:<span class="pl-c1">69</span>)
	<span class="pl-s1">at</span> <span class="pl-s1">org</span>.<span class="pl-s1">apache</span>.<span class="pl-s1">dubbo</span>.<span class="pl-s1">rpc</span>.<span class="pl-s1">protocol</span>.<span class="pl-s1">dubbo</span>.<span class="pl-s1">DubboCountCodec</span>.<span class="pl-en">encode</span>(<span class="pl-smi">DubboCountCodec</span>.<span class="pl-smi">java</span>:<span class="pl-c1">40</span>)
	<span class="pl-s1">at</span> <span class="pl-s1">org</span>.<span class="pl-s1">apache</span>.<span class="pl-s1">dubbo</span>.<span class="pl-s1">remoting</span>.<span class="pl-s1">transport</span>.<span class="pl-s1">netty4</span>.<span class="pl-s1">NettyCodecAdapter$InternalEncoder</span>.<span class="pl-en">encode</span>(<span class="pl-smi">NettyCodecAdapter</span>.<span class="pl-smi">java</span>:<span class="pl-c1">70</span>)
	<span class="pl-s1">at</span> <span class="pl-s1">io</span>.<span class="pl-s1">netty</span>.<span class="pl-s1">handler</span>.<span class="pl-s1">codec</span>.<span class="pl-s1">MessageToByteEncoder</span>.<span class="pl-en">write</span>(<span class="pl-smi">MessageToByteEncoder</span>.<span class="pl-smi">java</span>:<span class="pl-c1">107</span>)
	... <span class="pl-c1">23</span> <span class="pl-s1">more</span>

	<span class="pl-smi">at</span> <span class="pl-s1">org</span>.<span class="pl-s1">apache</span>.<span class="pl-s1">dubbo</span>.<span class="pl-s1">remoting</span>.<span class="pl-s1">exchange</span>.<span class="pl-s1">support</span>.<span class="pl-s1">DefaultFuture</span>.<span class="pl-en">doReceived</span>(<span class="pl-smi">DefaultFuture</span>.<span class="pl-smi">java</span>:<span class="pl-c1">191</span>)
	<span class="pl-s1">at</span> <span class="pl-s1">org</span>.<span class="pl-s1">apache</span>.<span class="pl-s1">dubbo</span>.<span class="pl-s1">remoting</span>.<span class="pl-s1">exchange</span>.<span class="pl-s1">support</span>.<span class="pl-s1">DefaultFuture</span>.<span class="pl-en">received</span>(<span class="pl-smi">DefaultFuture</span>.<span class="pl-smi">java</span>:<span class="pl-c1">153</span>)
	<span class="pl-s1">at</span> <span class="pl-s1">org</span>.<span class="pl-s1">apache</span>.<span class="pl-s1">dubbo</span>.<span class="pl-s1">remoting</span>.<span class="pl-s1">exchange</span>.<span class="pl-s1">support</span>.<span class="pl-s1">DefaultFuture</span>.<span class="pl-en">received</span>(<span class="pl-smi">DefaultFuture</span>.<span class="pl-smi">java</span>:<span class="pl-c1">141</span>)
	<span class="pl-s1">at</span> <span class="pl-s1">org</span>.<span class="pl-s1">apache</span>.<span class="pl-s1">dubbo</span>.<span class="pl-s1">remoting</span>.<span class="pl-s1">exchange</span>.<span class="pl-s1">support</span>.<span class="pl-s1">header</span>.<span class="pl-s1">HeaderExchangeHandler</span>.<span class="pl-en">handleResponse</span>(<span class="pl-smi">HeaderExchangeHandler</span>.<span class="pl-smi">java</span>:<span class="pl-c1">62</span>)
	<span class="pl-s1">at</span> <span class="pl-s1">org</span>.<span class="pl-s1">apache</span>.<span class="pl-s1">dubbo</span>.<span class="pl-s1">remoting</span>.<span class="pl-s1">exchange</span>.<span class="pl-s1">support</span>.<span class="pl-s1">header</span>.<span class="pl-s1">HeaderExchangeHandler</span>.<span class="pl-en">received</span>(<span class="pl-smi">HeaderExchangeHandler</span>.<span class="pl-smi">java</span>:<span class="pl-c1">199</span>)
	<span class="pl-s1">at</span> <span class="pl-s1">org</span>.<span class="pl-s1">apache</span>.<span class="pl-s1">dubbo</span>.<span class="pl-s1">remoting</span>.<span class="pl-s1">transport</span>.<span class="pl-s1">DecodeHandler</span>.<span class="pl-en">received</span>(<span class="pl-smi">DecodeHandler</span>.<span class="pl-smi">java</span>:<span class="pl-c1">51</span>)
	<span class="pl-s1">at</span> <span class="pl-s1">org</span>.<span class="pl-s1">apache</span>.<span class="pl-s1">dubbo</span>.<span class="pl-s1">remoting</span>.<span class="pl-s1">transport</span>.<span class="pl-s1">dispatcher</span>.<span class="pl-s1">ChannelEventRunnable</span>.<span class="pl-en">run</span>(<span class="pl-smi">ChannelEventRunnable</span>.<span class="pl-smi">java</span>:<span class="pl-c1">57</span>)
	... <span class="pl-c1">3</span> <span class="pl-s1">more</span></pre></div>