-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
springboot2.x+ elasticjo3.0.0-RC1 +mybatis-dynamic3.3.0, can not work well with elasticjob.tracing.type=RDB #1865
Comments
you can register a bean of TracingConfiguration<DataSource> like this:
and
|
it dosen`t work,when i change version to 3.0.0 |
i have tried to it,but it not work well,Have you solved it now? |
I also encountered the same problem, the problem is not solved, version:3.0.1, the error is as follows: |
I'm going to rewrite TracingConfiguration about the Springboot partial integration, but it always prompts that two identical types appear. It is always not possible to configure a data source dedicated to the job task.Now, I don't know what to do! |
I can't reproduce this issue with Spring Boot 3.3.2 in master branch, see #2417. Please provide unit tests. |
Closed because it could not be reproduced. |
application.yml as below:
if i open elasticjob.tracing.type , like below, then application will throw exception, otherwise it work well.
18:25:57.644 logback [main] WARN o.s.b.w.s.c.AnnotationConfigServletWebServerApplicationContext - Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.apache.shardingsphere.elasticjob.lite.spring.boot.job.ElasticJobBootstrapConfiguration': Invocation of init method failed; nested exception is java.lang.NullPointerException
18:25:57.644 logback [main] INFO c.b.d.d.DynamicRoutingDataSource - dynamic-datasource start closing ....
18:25:57.647 logback [main] INFO c.alibaba.druid.pool.DruidDataSource - {dataSource-1} closing ...
18:25:57.650 logback [main] INFO c.alibaba.druid.pool.DruidDataSource - {dataSource-1} closed
18:25:57.650 logback [main] INFO c.alibaba.druid.pool.DruidDataSource - {dataSource-2} closing ...
18:25:57.651 logback [main] INFO c.alibaba.druid.pool.DruidDataSource - {dataSource-2} closed
18:25:57.651 logback [main] INFO c.alibaba.druid.pool.DruidDataSource - {dataSource-3} closing ...
18:25:57.653 logback [main] INFO c.alibaba.druid.pool.DruidDataSource - {dataSource-3} closed
18:25:57.653 logback [main] INFO c.b.d.d.DynamicRoutingDataSource - dynamic-datasource all closed success,bye
18:25:58.155 logback [Curator-Framework-0] INFO o.a.c.f.imps.CuratorFrameworkImpl - backgroundOperationsLoop exiting
18:25:58.177 logback [main-SendThread(192.168.255.102:2181)] WARN org.apache.zookeeper.ClientCnxn - An exception was thrown while closing send thread for session 0x3f9a1ce0008.
org.apache.zookeeper.ClientCnxn$EndOfStreamException: Unable to read additional data from server sessionid 0x3f9a1ce0008, likely server has closed socket
at org.apache.zookeeper.ClientCnxnSocketNIO.doIO(ClientCnxnSocketNIO.java:75)
at org.apache.zookeeper.ClientCnxnSocketNIO.doTransport(ClientCnxnSocketNIO.java:348)
at org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1262)
18:25:58.280 logback [main] INFO org.apache.zookeeper.ZooKeeper - Session: 0x3f9a1ce0008 closed
18:25:58.280 logback [main-EventThread] INFO org.apache.zookeeper.ClientCnxn - EventThread shut down for session: 0x3f9a1ce0008
18:25:58.288 logback [main] INFO o.s.b.a.l.ConditionEvaluationReportLoggingListener -
Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
18:25:58.307 logback [main] ERROR o.s.boot.SpringApplication - Application run failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.apache.shardingsphere.elasticjob.lite.spring.boot.job.ElasticJobBootstrapConfiguration': Invocation of init method failed; nested exception is java.lang.NullPointerException
at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor.postProcessBeforeInitialization(InitDestroyAnnotationBeanPostProcessor.java:160)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInitialization(AbstractAutowireCapableBeanFactory.java:422)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1778)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:602)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:524)
at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:213)
at org.springframework.context.support.PostProcessorRegistrationDelegate.registerBeanPostProcessors(PostProcessorRegistrationDelegate.java:270)
at org.springframework.context.support.AbstractApplicationContext.registerBeanPostProcessors(AbstractApplicationContext.java:762)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:567)
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:144)
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:769)
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:761)
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:426)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:326)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1313)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1302)
at com.job.common.executor.LemesJobCommonExecutorApplication.main(LemesJobCommonExecutorApplication.java:13)
Caused by: java.lang.NullPointerException: null
at com.baomidou.dynamic.datasource.ds.AbstractRoutingDataSource.getConnection(AbstractRoutingDataSource.java:44)
at org.apache.shardingsphere.elasticjob.tracing.rdb.storage.RDBJobEventStorage.getDatabaseType(RDBJobEventStorage.java:79)
at org.apache.shardingsphere.elasticjob.tracing.rdb.storage.RDBJobEventStorage.(RDBJobEventStorage.java:73)
at org.apache.shardingsphere.elasticjob.tracing.rdb.listener.RDBTracingListener.(RDBTracingListener.java:36)
at org.apache.shardingsphere.elasticjob.tracing.rdb.listener.RDBTracingListenerConfiguration.createTracingListener(RDBTracingListenerConfiguration.java:35)
at org.apache.shardingsphere.elasticjob.tracing.rdb.listener.RDBTracingListenerConfiguration.createTracingListener(RDBTracingListenerConfiguration.java:30)
at org.apache.shardingsphere.elasticjob.tracing.listener.TracingListenerFactory.getListener(TracingListenerFactory.java:56)
at org.apache.shardingsphere.elasticjob.tracing.JobTracingEventBus.register(JobTracingEventBus.java:67)
at org.apache.shardingsphere.elasticjob.tracing.JobTracingEventBus.(JobTracingEventBus.java:55)
at org.apache.shardingsphere.elasticjob.lite.internal.schedule.LiteJobFacade.(LiteJobFacade.java:71)
at org.apache.shardingsphere.elasticjob.lite.internal.schedule.JobScheduler.(JobScheduler.java:86)
at org.apache.shardingsphere.elasticjob.lite.api.bootstrap.impl.ScheduleJobBootstrap.(ScheduleJobBootstrap.java:36)
at org.apache.shardingsphere.elasticjob.lite.spring.boot.job.ElasticJobBootstrapConfiguration.registerClassedJob(ElasticJobBootstrapConfiguration.java:101)
at org.apache.shardingsphere.elasticjob.lite.spring.boot.job.ElasticJobBootstrapConfiguration.constructJobBootstraps(ElasticJobBootstrapConfiguration.java:84)
at org.apache.shardingsphere.elasticjob.lite.spring.boot.job.ElasticJobBootstrapConfiguration.createJobBootstrapBeans(ElasticJobBootstrapConfiguration.java:57)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor$LifecycleElement.invoke(InitDestroyAnnotationBeanPostProcessor.java:389)
at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor$LifecycleMetadata.invokeInitMethods(InitDestroyAnnotationBeanPostProcessor.java:333)
at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor.postProcessBeforeInitialization(InitDestroyAnnotationBeanPostProcessor.java:157)
... 19 common frames omitted
Disconnected from the target VM, address: '127.0.0.1:30528', transport: 'socket'
Process finished with exit code 1
pom.xml as below:
The text was updated successfully, but these errors were encountered: