开发者社区> 问答> 正文

配置用户名密码导致 java.io.IOException: end of stream when

当没有配置canal.properties中的

canal.user = canal.passwd =

这两项,可以正常链接并读取binlog,但是只要配置了这两项,则报错 17:55:49.476 [Thread-2] ERROR com.alibaba.otter.canal.client.impl.running.ClientRunningMonitor - There is an error when execute initRunning method, with destination [myexample]. com.alibaba.otter.canal.protocol.exception.CanalClientException: java.io.IOException: end of stream when reading header at com.alibaba.otter.canal.client.impl.SimpleCanalConnector.doConnect(SimpleCanalConnector.java:190) at com.alibaba.otter.canal.client.impl.SimpleCanalConnector.access$000(SimpleCanalConnector.java:51) at com.alibaba.otter.canal.client.impl.SimpleCanalConnector$1.processActiveEnter(SimpleCanalConnector.java:449) at com.alibaba.otter.canal.client.impl.running.ClientRunningMonitor.processActiveEnter(ClientRunningMonitor.java:211) at com.alibaba.otter.canal.client.impl.running.ClientRunningMonitor.initRunning(ClientRunningMonitor.java:122) at com.alibaba.otter.canal.client.impl.running.ClientRunningMonitor.start(ClientRunningMonitor.java:92) at com.alibaba.otter.canal.client.impl.SimpleCanalConnector.connect(SimpleCanalConnector.java:107) at com.alibaba.otter.canal.client.impl.ClusterCanalConnector.connect(ClusterCanalConnector.java:64) at com.dc.canal.util.AbstractCanalClientTest.process(AbstractCanalClientTest.java:55) at java.lang.Thread.run(Thread.java:748) Caused by: java.io.IOException: end of stream when reading header at com.alibaba.otter.canal.client.impl.SimpleCanalConnector.read(SimpleCanalConnector.java:431) at com.alibaba.otter.canal.client.impl.SimpleCanalConnector.readNextPacket(SimpleCanalConnector.java:419) at com.alibaba.otter.canal.client.impl.SimpleCanalConnector.readNextPacket(SimpleCanalConnector.java:403) at com.alibaba.otter.canal.client.impl.SimpleCanalConnector.doConnect(SimpleCanalConnector.java:176) ... 9 common frames omitted

这个错误看起来并不是auth产生的,如果代码中用户名密码填写错误会报其他的auth错误。 通过ClusterCanalClientTest或者SimpleCanalClientExample都会得到一样的结构。 求解。。。

原提问者GitHub用户ANUBIS9000

展开
收起
山海行 2023-04-27 11:54:19 374 0
1 条回答
写回答
取消 提交回答
  • 发现原因是写的连接例子那个maven项目,里面配置的依赖canal是老版本的,运行源码,使用源码里带的例子就是正常的了。

    原回答者GitHub用户ANUBIS9000

    2023-04-27 21:15:18
    赞同 展开评论 打赏
问答排行榜
最热
最新

相关电子书

更多
Spring Cloud Alibaba - 重新定义 Java Cloud-Native 立即下载
The Reactive Cloud Native Arch 立即下载
JAVA开发手册1.5.0 立即下载