Skip to content
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

How resolve confuse that SpringBoot3.2 and shardingsphere 5.4.1 org.yaml.snakeyaml.representer.Representer: method 'void <init>()' not found #29402

Closed
JianfeiMa opened this issue Dec 14, 2023 · 7 comments
Assignees
Labels
stale type: dependencies Pull requests that update a dependency file type: fixed type: question

Comments

@JianfeiMa
Copy link

2023-12-14T16:52:45.441+08:00 INFO 11512 --- [ main] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Starting...
2023-12-14T16:52:45.730+08:00 INFO 11512 --- [ main] com.zaxxer.hikari.pool.HikariPool : HikariPool-1 - Added connection conn0: url=jdbc:h2:mem:config user=SA
2023-12-14T16:52:45.732+08:00 INFO 11512 --- [ main] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Start completed.
Exception in thread "main" java.lang.NoSuchMethodError: org.yaml.snakeyaml.representer.Representer: method 'void ()' not found
at org.apache.shardingsphere.infra.util.yaml.representer.ShardingSphereYamlRepresenter.(ShardingSphereYamlRepresenter.java:42)
at org.apache.shardingsphere.infra.util.yaml.YamlEngine.marshal(YamlEngine.java:112)
at org.apache.shardingsphere.metadata.persist.service.config.global.NewPropertiesPersistService.persist(NewPropertiesPersistService.java:51)
at org.apache.shardingsphere.metadata.persist.NewMetaDataPersistService.persistGlobalRuleConfiguration(NewMetaDataPersistService.java:97)
at org.apache.shardingsphere.mode.metadata.NewMetaDataContextsFactory.persistDatabaseConfigurations(NewMetaDataContextsFactory.java:147)
at org.apache.shardingsphere.mode.metadata.NewMetaDataContextsFactory.create(NewMetaDataContextsFactory.java:102)
at org.apache.shardingsphere.mode.metadata.NewMetaDataContextsFactory.create(NewMetaDataContextsFactory.java:71)
at org.apache.shardingsphere.mode.manager.standalone.NewStandaloneContextManagerBuilder.build(NewStandaloneContextManagerBuilder.java:53)
at org.apache.shardingsphere.driver.jdbc.core.datasource.ShardingSphereDataSource.createContextManager(ShardingSphereDataSource.java:78)
at org.apache.shardingsphere.driver.jdbc.core.datasource.ShardingSphereDataSource.(ShardingSphereDataSource.java:66)
at org.apache.shardingsphere.driver.api.ShardingSphereDataSourceFactory.createDataSource(ShardingSphereDataSourceFactory.java:95)
at com.example.demo.DemoApplication.main(DemoApplication.java:53)

@linghengqian
Copy link
Member

@linghengqian linghengqian added type: fixed type: question type: dependencies Pull requests that update a dependency file labels Dec 14, 2023
@yyyyyyyysssss
Copy link

me too
Have you solved it?

version:

org.apache.shardingsphere
shardingsphere-jdbc-core
5.4.1

exception message:
2023/12/25 17:11:29.428 INFO [x-transaction-id: ] [RMI TCP Connection(2)-192.168.23.165] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Starting...
2023/12/25 17:11:29.430 INFO [x-transaction-id: ] [RMI TCP Connection(3)-192.168.23.165] org.apache.catalina.core.ContainerBase.[Tomcat].[localhost].[/] : Initializing Spring DispatcherServlet 'dispatcherServlet'
2023/12/25 17:11:29.430 INFO [x-transaction-id: ] [RMI TCP Connection(3)-192.168.23.165] org.springframework.web.servlet.DispatcherServlet : Initializing Servlet 'dispatcherServlet'
2023/12/25 17:11:29.432 INFO [x-transaction-id: ] [RMI TCP Connection(3)-192.168.23.165] org.springframework.web.servlet.DispatcherServlet : Completed initialization in 1 ms
2023/12/25 17:11:29.679 INFO [x-transaction-id: ] [RMI TCP Connection(2)-192.168.23.165] com.zaxxer.hikari.HikariDataSource : HikariPool-2 - Starting...
2023/12/25 17:11:29.853 INFO [x-transaction-id: ] [RMI TCP Connection(2)-192.168.23.165] com.zaxxer.hikari.pool.HikariPool : HikariPool-2 - Added connection conn0: url=jdbc:h2:mem:config user=SA
2023/12/25 17:11:29.854 INFO [x-transaction-id: ] [RMI TCP Connection(2)-192.168.23.165] com.zaxxer.hikari.HikariDataSource : HikariPool-2 - Start completed.
2023/12/25 17:11:29.949 INFO [x-transaction-id: ] [RMI TCP Connection(2)-192.168.23.165] com.zaxxer.hikari.HikariDataSource : HikariPool-3 - Starting...
2023/12/25 17:11:30.077 INFO [x-transaction-id: ] [RMI TCP Connection(2)-192.168.23.165] com.zaxxer.hikari.pool.HikariPool : HikariPool-3 - Added connection com.mysql.cj.jdbc.ConnectionImpl@62da74ee
2023/12/25 17:11:30.077 INFO [x-transaction-id: ] [RMI TCP Connection(2)-192.168.23.165] com.zaxxer.hikari.HikariDataSource : HikariPool-3 - Start completed.
2023/12/25 17:11:30.077 INFO [x-transaction-id: ] [RMI TCP Connection(2)-192.168.23.165] com.zaxxer.hikari.HikariDataSource : HikariPool-4 - Starting...
2023/12/25 17:11:30.088 INFO [x-transaction-id: ] [RMI TCP Connection(2)-192.168.23.165] com.zaxxer.hikari.pool.HikariPool : HikariPool-4 - Added connection com.mysql.cj.jdbc.ConnectionImpl@58f35683
2023/12/25 17:11:30.089 INFO [x-transaction-id: ] [RMI TCP Connection(2)-192.168.23.165] com.zaxxer.hikari.HikariDataSource : HikariPool-4 - Start completed.
2023/12/25 17:11:30.089 INFO [x-transaction-id: ] [RMI TCP Connection(2)-192.168.23.165] com.zaxxer.hikari.HikariDataSource : HikariPool-5 - Starting...
2023/12/25 17:11:30.094 INFO [x-transaction-id: ] [RMI TCP Connection(2)-192.168.23.165] com.zaxxer.hikari.pool.HikariPool : HikariPool-5 - Added connection com.mysql.cj.jdbc.ConnectionImpl@22638704
2023/12/25 17:11:30.095 INFO [x-transaction-id: ] [RMI TCP Connection(2)-192.168.23.165] com.zaxxer.hikari.HikariDataSource : HikariPool-5 - Start completed.
2023/12/25 17:11:34.592 INFO [x-transaction-id: ys-16233f1713874e968a87054e78ca8440] [tomcat-handler-0] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Starting...
2023/12/25 17:11:34.612 INFO [x-transaction-id: ys-16233f1713874e968a87054e78ca8440] [tomcat-handler-0] com.zaxxer.hikari.HikariDataSource : HikariPool-6 - Starting...
2023/12/25 17:11:34.613 INFO [x-transaction-id: ys-16233f1713874e968a87054e78ca8440] [tomcat-handler-0] com.zaxxer.hikari.pool.HikariPool : HikariPool-6 - Added connection conn10: url=jdbc:h2:mem:config user=SA
2023/12/25 17:11:34.613 INFO [x-transaction-id: ys-16233f1713874e968a87054e78ca8440] [tomcat-handler-0] com.zaxxer.hikari.HikariDataSource : HikariPool-6 - Start completed.
2023/12/25 17:11:34.614 INFO [x-transaction-id: ys-16233f1713874e968a87054e78ca8440] [tomcat-handler-0] com.zaxxer.hikari.HikariDataSource : HikariPool-7 - Starting...
2023/12/25 17:11:34.622 INFO [x-transaction-id: ys-16233f1713874e968a87054e78ca8440] [tomcat-handler-0] com.zaxxer.hikari.pool.HikariPool : HikariPool-7 - Added connection com.mysql.cj.jdbc.ConnectionImpl@78ad4671
2023/12/25 17:11:34.623 INFO [x-transaction-id: ys-16233f1713874e968a87054e78ca8440] [tomcat-handler-0] com.zaxxer.hikari.HikariDataSource : HikariPool-7 - Start completed.
2023/12/25 17:11:34.623 INFO [x-transaction-id: ys-16233f1713874e968a87054e78ca8440] [tomcat-handler-0] com.zaxxer.hikari.HikariDataSource : HikariPool-8 - Starting...
2023/12/25 17:11:34.628 INFO [x-transaction-id: ys-16233f1713874e968a87054e78ca8440] [tomcat-handler-0] com.zaxxer.hikari.pool.HikariPool : HikariPool-8 - Added connection com.mysql.cj.jdbc.ConnectionImpl@640e3020
2023/12/25 17:11:34.629 INFO [x-transaction-id: ys-16233f1713874e968a87054e78ca8440] [tomcat-handler-0] com.zaxxer.hikari.HikariDataSource : HikariPool-8 - Start completed.
2023/12/25 17:11:34.629 INFO [x-transaction-id: ys-16233f1713874e968a87054e78ca8440] [tomcat-handler-0] com.zaxxer.hikari.HikariDataSource : HikariPool-9 - Starting...
2023/12/25 17:11:34.633 INFO [x-transaction-id: ys-16233f1713874e968a87054e78ca8440] [tomcat-handler-0] com.zaxxer.hikari.pool.HikariPool : HikariPool-9 - Added connection com.mysql.cj.jdbc.ConnectionImpl@d9beb29
2023/12/25 17:11:34.633 INFO [x-transaction-id: ys-16233f1713874e968a87054e78ca8440] [tomcat-handler-0] com.zaxxer.hikari.HikariDataSource : HikariPool-9 - Start completed.
jakarta.servlet.ServletException: Handler dispatch failed: java.lang.NoSuchMethodError: org.yaml.snakeyaml.representer.Representer: method 'void ()' not found
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1104)
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:979)
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1014)
at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:903)
at jakarta.servlet.http.HttpServlet.service(HttpServlet.java:564)
at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:885)
at jakarta.servlet.http.HttpServlet.service(HttpServlet.java:658)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:205)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:149)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:51)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:174)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:149)
at com.ys.order.filter.MDCTraceFilter.doFilter(MDCTraceFilter.java:35)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:174)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:149)
at org.springframework.web.filter.ServerHttpObservationFilter.doFilterInternal(ServerHttpObservationFilter.java:109)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:116)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:174)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:149)
at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:201)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:116)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:174)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:149)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:167)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:90)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:482)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:115)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:93)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:74)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:340)
at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:391)
at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:63)
at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:896)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1744)
at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:52)
at java.base/java.lang.VirtualThread.run(VirtualThread.java:309)
Caused by: java.lang.NoSuchMethodError: org.yaml.snakeyaml.representer.Representer: method 'void ()' not found
at org.apache.shardingsphere.infra.util.yaml.representer.ShardingSphereYamlRepresenter.(ShardingSphereYamlRepresenter.java:42)
at org.apache.shardingsphere.infra.util.yaml.YamlEngine.marshal(YamlEngine.java:112)
at org.apache.shardingsphere.metadata.persist.service.config.global.NewPropertiesPersistService.persist(NewPropertiesPersistService.java:51)
at org.apache.shardingsphere.metadata.persist.NewMetaDataPersistService.persistGlobalRuleConfiguration(NewMetaDataPersistService.java:97)
at org.apache.shardingsphere.mode.metadata.NewMetaDataContextsFactory.persistDatabaseConfigurations(NewMetaDataContextsFactory.java:147)
at org.apache.shardingsphere.mode.metadata.NewMetaDataContextsFactory.create(NewMetaDataContextsFactory.java:102)
at org.apache.shardingsphere.mode.metadata.NewMetaDataContextsFactory.create(NewMetaDataContextsFactory.java:71)
at org.apache.shardingsphere.mode.manager.standalone.NewStandaloneContextManagerBuilder.build(NewStandaloneContextManagerBuilder.java:53)
at org.apache.shardingsphere.driver.jdbc.core.datasource.ShardingSphereDataSource.createContextManager(ShardingSphereDataSource.java:78)
at org.apache.shardingsphere.driver.jdbc.core.datasource.ShardingSphereDataSource.(ShardingSphereDataSource.java:66)
at org.apache.shardingsphere.driver.api.ShardingSphereDataSourceFactory.createDataSource(ShardingSphereDataSourceFactory.java:95)
at org.apache.shardingsphere.driver.api.yaml.YamlShardingSphereDataSourceFactory.createDataSource(YamlShardingSphereDataSourceFactory.java:167)
at org.apache.shardingsphere.driver.api.yaml.YamlShardingSphereDataSourceFactory.createDataSource(YamlShardingSphereDataSourceFactory.java:102)
at org.apache.shardingsphere.driver.jdbc.core.driver.DriverDataSourceCache.createDataSource(DriverDataSourceCache.java:52)
at org.apache.shardingsphere.driver.jdbc.core.driver.DriverDataSourceCache.lambda$get$0(DriverDataSourceCache.java:46)
at java.base/java.util.concurrent.ConcurrentHashMap.computeIfAbsent(ConcurrentHashMap.java:1708)
at org.apache.shardingsphere.driver.jdbc.core.driver.DriverDataSourceCache.get(DriverDataSourceCache.java:46)
at org.apache.shardingsphere.driver.ShardingSphereDriver.connect(ShardingSphereDriver.java:53)
at com.zaxxer.hikari.util.DriverDataSource.getConnection(DriverDataSource.java:121)
at com.zaxxer.hikari.pool.PoolBase.newConnection(PoolBase.java:359)
at com.zaxxer.hikari.pool.PoolBase.newPoolEntry(PoolBase.java:201)
at com.zaxxer.hikari.pool.HikariPool.createPoolEntry(HikariPool.java:470)
at com.zaxxer.hikari.pool.HikariPool.checkFailFast(HikariPool.java:561)
at com.zaxxer.hikari.pool.HikariPool.(HikariPool.java:100)
at com.zaxxer.hikari.HikariDataSource.getConnection(HikariDataSource.java:112)
at org.springframework.jdbc.datasource.DataSourceUtils.fetchConnection(DataSourceUtils.java:160)
at org.springframework.jdbc.datasource.DataSourceUtils.doGetConnection(DataSourceUtils.java:118)
at org.springframework.jdbc.datasource.DataSourceUtils.getConnection(DataSourceUtils.java:81)
at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:388)
at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:476)
at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:486)
at org.springframework.jdbc.core.JdbcTemplate.queryForList(JdbcTemplate.java:536)
at com.ys.order.controller.TestController.test4(TestController.java:133)
at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
at java.base/java.lang.reflect.Method.invoke(Method.java:580)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:352)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:196)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:765)
at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:97)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:184)
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:765)
at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:717)
at com.ys.order.controller.TestController$$SpringCGLIB$$0.test4()
at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
at java.base/java.lang.reflect.Method.invoke(Method.java:580)
at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:254)
at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:182)
at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:118)
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:917)
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:829)
at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87)
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1089)
... 35 more

@yyyyyyyysssss
Copy link

@linghengqian
shardingsphere-jdbc-core5.4.1 not elasticjob

@linghengqian
Copy link
Member

linghengqian commented Dec 25, 2023

@linghengqian
shardingsphere-jdbc-core5.4.1 not elasticjob

  • The reason why the old version of ShardingSphere cannot change the SnakeYAML version is that ElasticJob uses the old version of the SnakeYAML API. Therefore, only when ElasticJob makes changes and releases 3.0.4, ShardingSphere can make changes.

  • At the current stage, you need to compile this project manually and install the corresponding 5.4.2 snapshot version of ShardingSphere into the local maven repo through Maven's install goal, or deploy it into a private maven repo.

  • Background: I am not the PMC of the project, and I don't know when the release vote for 5.4.2 will be initiated. Currently, the milestone for 5.4.2 has not been closed.

@yyyyyyyysssss
Copy link

@linghengqian
shardingsphere-jdbc-core5.4.1 不是 elasticjob

  • 旧版本ShardingSphere无法更改SnakeYAML版本的原因是ElasticJob使用了旧版本的SnakeYAML API。因此,只有当ElasticJob进行变更并发布3.0.4时,ShardingSphere才可以进行变更。
  • 现在阶段,您需要手动编译该项目,并通过Maven的install目标将对应的ShardingSphere 5.4.2快照版本安装到本地maven仓库中,或者安装到本地maven仓库中。
  • 背景:我不是PMC这个项目,不知道5.4.2的发布投票什么时候发起。目前,5.4.2的里程碑尚未关闭。

ok thanks

Copy link

There hasn't been any activity on this issue recently, and in order to prioritize active issues, it will be marked as stale.

@github-actions github-actions bot added the stale label Jan 24, 2024
@linghengqian
Copy link
Member

  • If anyone expects a faster release, they should open a corresponding discussion thread on the mailing list. There is no point in continuing to open the current issue. Although I am a committer, I have no intention of becoming the release manager of the next version.

@linghengqian linghengqian self-assigned this Jan 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stale type: dependencies Pull requests that update a dependency file type: fixed type: question
Projects
None yet
Development

No branches or pull requests

3 participants