-
Notifications
You must be signed in to change notification settings - Fork 7.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
1.1.6hotfix版本的adapter运行异常:java.nio.ByteBuffer.clear()Ljava/nio/ByteBuffer #4358
Comments
me too |
一样的情况 |
最新的1.1.7-alpha已经兼容了jdk>=1.8的运行 |
一样的报错: 2022-09-21 13:12:33.079 [main] INFO o.s.c.annotation.AnnotationConfigApplicationContext - Refreshing org.springframework.context.annotation.AnnotationConfigApplicationContext@2beee7ff: startup date [Wed Sep 21 13:12:33 CST 2022]; root of context hierarchy |
我现在就是用最新得1.1.7-alpha-1,jdk还是1.8,问题还是出现了 |
赞
…------------------ 原始邮件 ------------------
发件人: "alibaba/canal" ***@***.***>;
发送时间: 2022年9月7日(星期三) 晚上8:05
***@***.***>;
***@***.******@***.***>;
主题: Re: [alibaba/canal] 1.1.6hotfix版本的adapter运行异常:java.nio.ByteBuffer.clear()Ljava/nio/ByteBuffer (Issue #4358)
已解决 跟了下源码 com.alibaba.otter.canal.client.impl.SimpleCanalConnector 42行,方法readHeader.clear(); 进行方法,调的是jdk的下rt.jar里面的方法。异常信息是java.lang.NoSuchMethodError: java.nio.ByteBuffer.clear()Ljava/nio/ByteBuffer,但是明明jdk是有这个方法的。 一般这种情况是jdk版本不一致导致的。可能作者用是jdk 9,10,11或者更高版本开发的,而环境变量低于代码编译版本。 所以用高版本运行就可以了。 我直接用了jdk12运行,就没有报这个错了。我用的是mysql同步es,数据同步正常。我直接用jdk12测试的,可能 9,10,11也可以,你们自己去测试。这个问题网上找了半天也没有找到答案,我看也有好多同学在问。版本发布声音说的是jdk1.6.x以上就可以运行,太坑了。
试了jdk11 也可以解决这个问题
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you commented.Message ID: ***@***.***>
|
阿里的开源就是搞笑,没有任何规范,想怎么改就怎么改,反正是刷kpi |
升级jdk11解决 |
存在这种bug,建议废弃这个版本或者修改 wiki,研究了好几天了。。。太坑了 |
哈哈,不要这么说,咱们不能吃别人的饭,还要砸别人的锅。 |
Question
canal版本1.1.6
下载了2022-08-11编译的hotfix包,运行后admin,deployer都正常,但adapter启动报错,信息如下:
2022-08-16 11:07:12.334 [main] INFO o.s.c.annotation.AnnotationConfigApplicationContext - Refreshing org.springframework.context.annotation.AnnotationConfigApplicationContext@445b295b: startup date [Tue Aug 16 11:07:12 CST 2022]; root of context hierarchy
2022-08-16 11:07:12.834 [main] INFO o.s.c.s.PostProcessorRegistrationDelegate$BeanPostProcessorChecker - Bean 'configurationPropertiesRebinderAutoConfiguration' of type [org.springframework.cloud.autoconfigure.ConfigurationPropertiesRebinderAutoConfiguration$$EnhancerBySpringCGLIB$$a1606e1f] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2022-08-16 11:07:13.834 [main] INFO com.alibaba.druid.pool.DruidDataSource - {dataSource-1} inited
2022-08-16 11:07:14.037 [main] INFO c.a.otter.canal.adapter.launcher.CanalAdapterApplication - No active profile set, falling back to default profiles: default
2022-08-16 11:07:14.068 [main] INFO o.s.b.w.s.c.AnnotationConfigServletWebServerApplicationContext - Refreshing org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext@553f1d75: startup date [Tue Aug 16 11:07:14 CST 2022]; parent: org.springframework.context.annotation.AnnotationConfigApplicationContext@445b295b
2022-08-16 11:07:14.802 [main] INFO org.springframework.cloud.context.scope.GenericScope - BeanFactory id=d918d7e8-5091-3baa-be10-1466c8ff3b6d
2022-08-16 11:07:14.912 [main] INFO o.s.c.s.PostProcessorRegistrationDelegate$BeanPostProcessorChecker - Bean 'org.springframework.cloud.autoconfigure.ConfigurationPropertiesRebinderAutoConfiguration' of type [org.springframework.cloud.autoconfigure.ConfigurationPropertiesRebinderAutoConfiguration$$EnhancerBySpringCGLIB$$a1606e1f] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2022-08-16 11:07:15.318 [main] INFO o.s.boot.web.embedded.tomcat.TomcatWebServer - Tomcat initialized with port(s): 8081 (http)
2022-08-16 11:07:15.334 [main] INFO org.apache.coyote.http11.Http11NioProtocol - Initializing ProtocolHandler ["http-nio-8081"]
2022-08-16 11:07:15.365 [main] INFO org.apache.catalina.core.StandardService - Starting service [Tomcat]
2022-08-16 11:07:15.365 [main] INFO org.apache.catalina.core.StandardEngine - Starting Servlet Engine: Apache Tomcat/8.5.29
2022-08-16 11:07:15.381 [localhost-startStop-1] INFO org.apache.catalina.core.AprLifecycleListener - The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: [C:\Program Files\Java\jdk1.8.0_191\jre\bin;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0;C:\Program Files\Bingosoft\DeployAgent\tools;C:\Program Files\Bingosoft\DeployAgent\tools;C:\Program Files\Amazon\cfn-bootstrap;;C:\Program Files\Java\jdk1.8.0_191\bin;C:\Program Files\Java\jdk1.8.0_191\jre\bin;C:\Program Files (x86)\VRV\CEMS;C:\Users\Administrator\AppData\Local\Microsoft\WindowsApps;;.]
2022-08-16 11:07:15.599 [localhost-startStop-1] INFO o.a.catalina.core.ContainerBase.[Tomcat].[localhost].[/] - Initializing Spring embedded WebApplicationContext
2022-08-16 11:07:15.599 [localhost-startStop-1] INFO org.springframework.web.context.ContextLoader - Root WebApplicationContext: initialization completed in 1531 ms
2022-08-16 11:07:15.787 [localhost-startStop-1] INFO o.s.boot.web.servlet.ServletRegistrationBean - Servlet statViewServlet mapped to [/druid/]
2022-08-16 11:07:15.787 [localhost-startStop-1] INFO o.s.boot.web.servlet.ServletRegistrationBean - Servlet dispatcherServlet mapped to [/]
2022-08-16 11:07:15.787 [localhost-startStop-1] INFO o.s.boot.web.servlet.FilterRegistrationBean - Mapping filter: 'characterEncodingFilter' to: [/]
2022-08-16 11:07:15.802 [localhost-startStop-1] INFO o.s.boot.web.servlet.FilterRegistrationBean - Mapping filter: 'hiddenHttpMethodFilter' to: [/]
2022-08-16 11:07:15.802 [localhost-startStop-1] INFO o.s.boot.web.servlet.FilterRegistrationBean - Mapping filter: 'httpPutFormContentFilter' to: [/]
2022-08-16 11:07:15.802 [localhost-startStop-1] INFO o.s.boot.web.servlet.FilterRegistrationBean - Mapping filter: 'requestContextFilter' to: [/*]
2022-08-16 11:07:16.224 [main] INFO o.s.web.servlet.handler.SimpleUrlHandlerMapping - Mapped URL path [//favicon.ico] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler]
2022-08-16 11:07:16.490 [main] INFO o.s.w.s.m.method.annotation.RequestMappingHandlerAdapter - Looking for @ControllerAdvice: org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext@553f1d75: startup date [Tue Aug 16 11:07:14 GMT+08:00 2022]; parent: org.springframework.context.annotation.AnnotationConfigApplicationContext@445b295b
2022-08-16 11:07:16.615 [main] INFO o.s.w.s.m.method.annotation.RequestMappingHandlerMapping - Mapped "{[/count/{type}/{key}/{task}],methods=[GET]}" onto public java.util.Map<java.lang.String, java.lang.Object> com.alibaba.otter.canal.adapter.launcher.rest.CommonRest.count(java.lang.String,java.lang.String,java.lang.String)
2022-08-16 11:07:16.615 [main] INFO o.s.w.s.m.method.annotation.RequestMappingHandlerMapping - Mapped "{[/count/{type}/{task}],methods=[GET]}" onto public java.util.Map<java.lang.String, java.lang.Object> com.alibaba.otter.canal.adapter.launcher.rest.CommonRest.count(java.lang.String,java.lang.String)
2022-08-16 11:07:16.615 [main] INFO o.s.w.s.m.method.annotation.RequestMappingHandlerMapping - Mapped "{[/destinations],methods=[GET]}" onto public java.util.List<java.util.Map<java.lang.String, java.lang.String>> com.alibaba.otter.canal.adapter.launcher.rest.CommonRest.destinations()
2022-08-16 11:07:16.615 [main] INFO o.s.w.s.m.method.annotation.RequestMappingHandlerMapping - Mapped "{[/etl/{type}/{key}/{task}],methods=[POST]}" onto public com.alibaba.otter.canal.client.adapter.support.EtlResult com.alibaba.otter.canal.adapter.launcher.rest.CommonRest.etl(java.lang.String,java.lang.String,java.lang.String,java.lang.String)
2022-08-16 11:07:16.615 [main] INFO o.s.w.s.m.method.annotation.RequestMappingHandlerMapping - Mapped "{[/syncSwitch/{destination}],methods=[GET]}" onto public java.util.Map<java.lang.String, java.lang.String> com.alibaba.otter.canal.adapter.launcher.rest.CommonRest.etl(java.lang.String)
2022-08-16 11:07:16.615 [main] INFO o.s.w.s.m.method.annotation.RequestMappingHandlerMapping - Mapped "{[/syncSwitch/{destination}/{status}],methods=[PUT]}" onto public com.alibaba.otter.canal.client.adapter.support.Result com.alibaba.otter.canal.adapter.launcher.rest.CommonRest.etl(java.lang.String,java.lang.String)
2022-08-16 11:07:16.615 [main] INFO o.s.w.s.m.method.annotation.RequestMappingHandlerMapping - Mapped "{[/etl/{type}/{task}],methods=[POST]}" onto public com.alibaba.otter.canal.client.adapter.support.EtlResult com.alibaba.otter.canal.adapter.launcher.rest.CommonRest.etl(java.lang.String,java.lang.String,java.lang.String)
2022-08-16 11:07:16.631 [main] INFO o.s.w.s.m.method.annotation.RequestMappingHandlerMapping - Mapped "{[/error]}" onto public org.springframework.http.ResponseEntity<java.util.Map<java.lang.String, java.lang.Object>> org.springframework.boot.autoconfigure.web.servlet.error.BasicErrorController.error(javax.servlet.http.HttpServletRequest)
2022-08-16 11:07:16.631 [main] INFO o.s.w.s.m.method.annotation.RequestMappingHandlerMapping - Mapped "{[/error],produces=[text/html]}" onto public org.springframework.web.servlet.ModelAndView org.springframework.boot.autoconfigure.web.servlet.error.BasicErrorController.errorHtml(javax.servlet.http.HttpServletRequest,javax.servlet.http.HttpServletResponse)
2022-08-16 11:07:16.662 [main] INFO o.s.web.servlet.handler.SimpleUrlHandlerMapping - Mapped URL path [/webjars/] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler]
2022-08-16 11:07:16.662 [main] INFO o.s.web.servlet.handler.SimpleUrlHandlerMapping - Mapped URL path [/**] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler]
2022-08-16 11:07:17.006 [main] INFO o.s.jmx.export.annotation.AnnotationMBeanExporter - Registering beans for JMX exposure on startup
2022-08-16 11:07:17.021 [main] INFO o.s.jmx.export.annotation.AnnotationMBeanExporter - Bean with name 'refreshScope' has been autodetected for JMX exposure
2022-08-16 11:07:17.021 [main] INFO o.s.jmx.export.annotation.AnnotationMBeanExporter - Bean with name 'configurationPropertiesRebinder' has been autodetected for JMX exposure
2022-08-16 11:07:17.021 [main] INFO o.s.jmx.export.annotation.AnnotationMBeanExporter - Bean with name 'environmentManager' has been autodetected for JMX exposure
2022-08-16 11:07:17.021 [main] INFO o.s.jmx.export.annotation.AnnotationMBeanExporter - Located managed bean 'environmentManager': registering with JMX server as MBean [org.springframework.cloud.context.environment:name=environmentManager,type=EnvironmentManager]
2022-08-16 11:07:17.037 [main] INFO o.s.jmx.export.annotation.AnnotationMBeanExporter - Located managed bean 'refreshScope': registering with JMX server as MBean [org.springframework.cloud.context.scope.refresh:name=refreshScope,type=RefreshScope]
2022-08-16 11:07:17.052 [main] INFO o.s.jmx.export.annotation.AnnotationMBeanExporter - Located managed bean 'configurationPropertiesRebinder': registering with JMX server as MBean [org.springframework.cloud.context.properties:name=configurationPropertiesRebinder,context=553f1d75,type=ConfigurationPropertiesRebinder]
2022-08-16 11:07:17.068 [main] INFO c.a.o.canal.adapter.launcher.loader.CanalAdapterService - ## syncSwitch refreshed.
2022-08-16 11:07:17.068 [main] INFO c.a.o.canal.adapter.launcher.loader.CanalAdapterService - ## start the canal client adapters.
2022-08-16 11:07:17.084 [main] INFO c.a.otter.canal.client.adapter.support.ExtensionLoader - extension classpath dir: D:\canal-v1.1.6\adapter_hotfix\plugin
2022-08-16 11:07:17.131 [main] INFO c.a.o.canal.adapter.launcher.loader.CanalAdapterLoader - Load canal adapter: logger succeed
2022-08-16 11:07:17.146 [main] INFO c.a.otter.canal.client.adapter.rdb.config.ConfigLoader - ## Start loading rdb mapping config ...
2022-08-16 11:07:17.209 [main] INFO c.a.otter.canal.client.adapter.rdb.config.ConfigLoader - ## Rdb mapping config loaded
2022-08-16 11:07:17.537 [main] INFO com.alibaba.druid.pool.DruidDataSource - {dataSource-2} inited
2022-08-16 11:07:17.552 [main] INFO c.a.o.canal.adapter.launcher.loader.CanalAdapterLoader - Load canal adapter: rdb succeed
2022-08-16 11:07:17.568 [main] INFO c.alibaba.otter.canal.connector.core.spi.ExtensionLoader - extension classpath dir: D:\canal-v1.1.6\adapter_hotfix\plugin
2022-08-16 11:07:17.599 [main] INFO c.a.o.canal.adapter.launcher.loader.CanalAdapterLoader - Start adapter for canal-client mq topic: Canal_31TO83-gPBM succeed
2022-08-16 11:07:17.599 [Thread-4] INFO c.a.otter.canal.adapter.launcher.loader.AdapterProcessor - =============> Start to connect destination: Canal_31TO83 <=============
2022-08-16 11:07:17.599 [main] INFO c.a.o.canal.adapter.launcher.loader.CanalAdapterService - ## the canal client adapters are running now ......
2022-08-16 11:07:17.615 [main] INFO org.apache.coyote.http11.Http11NioProtocol - Starting ProtocolHandler ["http-nio-8081"]
2022-08-16 11:07:17.615 [Thread-4] ERROR c.a.otter.canal.adapter.launcher.loader.AdapterProcessor - process error!
java.lang.NoSuchMethodError: java.nio.ByteBuffer.clear()Ljava/nio/ByteBuffer;
at com.alibaba.otter.canal.client.impl.SimpleCanalConnector.readNextPacket(SimpleCanalConnector.java:412) ~[na:na]
at com.alibaba.otter.canal.client.impl.SimpleCanalConnector.readNextPacket(SimpleCanalConnector.java:397) ~[na:na]
at com.alibaba.otter.canal.client.impl.SimpleCanalConnector.doConnect(SimpleCanalConnector.java:155) ~[na:na]
at com.alibaba.otter.canal.client.impl.SimpleCanalConnector.connect(SimpleCanalConnector.java:116) ~[na:na]
at com.alibaba.otter.canal.connector.tcp.consumer.CanalTCPConsumer.connect(CanalTCPConsumer.java:63) ~[na:na]
at com.alibaba.otter.canal.adapter.launcher.loader.AdapterProcessor.process(AdapterProcessor.java:185) ~[client-adapter.launcher-1.1.6.jar:na]
at java.lang.Thread.run(Thread.java:748) ~[na:1.8.0_191]
2022-08-16 11:07:17.631 [main] INFO org.apache.tomcat.util.net.NioSelectorPool - Using a shared selector for servlet write/read
2022-08-16 11:07:17.646 [main] INFO o.s.boot.web.embedded.tomcat.TomcatWebServer - Tomcat started on port(s): 8081 (http) with context path ''
2022-08-16 11:07:17.646 [main] INFO c.a.otter.canal.adapter.launcher.CanalAdapterApplication - Started CanalAdapterApplication in 6.047 seconds (JVM running for 7.13)
然后还是用1.1.6hotfix版的admin和deployer,adapter换成2022-05-24发布的包,运行正常,可以同步数据。
The text was updated successfully, but these errors were encountered: