You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by GitBox <gi...@apache.org> on 2021/04/01 00:39:14 UTC
[GitHub] [shardingsphere-elasticjob] double2013 opened a new issue #1865: springboot2.x+ elasticjo3.0.0-RC1 +mybatis-dynamic3.3.0, can not work well with elasticjob.tracing.type=RDB
double2013 opened a new issue #1865:
URL: https://github.com/apache/shardingsphere-elasticjob/issues/1865
application.yml as below:
```
spring:
application:
name: job-common-executor
datasource:
# url: jdbc:mysql://192.168.255.102:3306/elastic_job_demo?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&serverTimezone=Asia/Shanghai
# username: xxxxx
# password: xxxxxx
# driver-class-name: com.mysql.cj.jdbc.Driver
druid:
stat-view-servlet:
enabled: true
login-username: admin
login-password: 123456
dynamic:
druid:
initial-size: 5
max-active: 20
min-idle: 5
max-wait: 60000
time-between-eviction-runs-millis: 60000
time-between-log-stats-millis:
stat-sqlmax-size:
min-evictable-idle-time-millis: 300000
max-evictable-idle-time-millis:
test-while-idle: true
test-on-borrow: false
test-on-return: false
validation-query: SELECT 1
validation-query-timeout:
use-global-datasource-stat:
async-init:
clear-filters-enable:
reset-stat-enable:
not-full-timeout-retry-count:
max-wait-thread-count:
fail-fast:
phyTimeout-millis:
keep-alive:
pool-prepared-statements:
init-variants:
init-global-variants:
use-unfair-lock:
kill-when-socket-read-timeout:
connection-properties:
max-pool-prepared-statement-per-connection-size: 20
init-connection-sqls:
share-prepared-statements:
connection-errorretry-attempts:
break-after-acquire-failure:
filters: stat,wall
stat:
merge-sql:
log-slow-sql:
slow-sql-millis:
primary: dmsdb
strict: false
datasource:
nabftooldb:
driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://xxxx:3306/NABFTOOLS1?useUnicode=true&characterEncoding=UTF-8&serverTimezone=UTC
username: xxxx
password: xxxxx
dmsdb:
driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://xxxxx:3306/DMS?useUnicode=true&characterEncoding=UTF-8&serverTimezone=UTC
username: xxxxx
password: xxxxx
server:
port: 8083
logging:
config: classpath:logback.xml
elasticjob:
# tracing:
# type: RDB
regCenter:
serverLists: 192.168.255.102:2181
namespace: job-common
maxSleepTimeMilliseconds: 30000
jobs:
MailAutoSendJob:
elasticJobClass: com.job.common.executor.jobhandler.MailAutoSendJob
cron: 0/10 * * * * ?
shardingTotalCount: 1
shardingItemParameters:
```
if i open elasticjob.tracing.type , like below, then application will throw exception, otherwise it work well.
```
spring:
application:
name: job-common-executor
datasource:
url: jdbc:mysql://192.168.255.102:3306/elastic_job_demo?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&serverTimezone=Asia/Shanghai
username: xxxxx
password: xxxxxx
driver-class-name: com.mysql.cj.jdbc.Driver
druid:
stat-view-servlet:
enabled: true
login-username: admin
login-password: 123456
.......
server:
port: 8083
logging:
config: classpath:logback.xml
elasticjob:
tracing:
type: RDB
.......
```
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:
```
<mybatis-plus.version>3.1.2</mybatis-plus.version>
<mybatis-dynamic.version>3.3.0</mybatis-dynamic.version>
<elasticjob.version>3.0.0-RC1</elasticjob.version>
<dependency>
<groupId>com.baomidou</groupId>
<artifactId>mybatis-plus-boot-starter</artifactId>
<version>${mybatis-plus.version}</version>
</dependency>
<dependency>
<groupId>com.baomidou</groupId>
<artifactId>dynamic-datasource-spring-boot-starter</artifactId>
<version>${mybatis-dynamic.version}</version>
</dependency>
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>druid-spring-boot-starter</artifactId>
<version>${druid.version}</version>
</dependency>
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [shardingsphere-elasticjob] Xiejinhua123 commented on issue #1865: springboot2.x+ elasticjo3.0.0-RC1 +mybatis-dynamic3.3.0, can not work well with elasticjob.tracing.type=RDB
Posted by GitBox <gi...@apache.org>.
Xiejinhua123 commented on issue #1865:
URL: https://github.com/apache/shardingsphere-elasticjob/issues/1865#issuecomment-1078750131
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!
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [shardingsphere-elasticjob] Xiejinhua123 removed a comment on issue #1865: springboot2.x+ elasticjo3.0.0-RC1 +mybatis-dynamic3.3.0, can not work well with elasticjob.tracing.type=RDB
Posted by GitBox <gi...@apache.org>.
Xiejinhua123 removed a comment on issue #1865:
URL: https://github.com/apache/shardingsphere-elasticjob/issues/1865#issuecomment-1078750266
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!
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [shardingsphere-elasticjob] sunshaohua0221 commented on issue #1865: springboot2.x+ elasticjo3.0.0-RC1 +mybatis-dynamic3.3.0, can not work well with elasticjob.tracing.type=RDB
Posted by GitBox <gi...@apache.org>.
sunshaohua0221 commented on issue #1865:
URL: https://github.com/apache/shardingsphere-elasticjob/issues/1865#issuecomment-1027507142
I also encountered the same problem, the problem is not solved, version:3.0.1, the error is as follows:
Parameter 0 of method tracingConfiguration in org.apache.shardingsphere.elasticjob.lite.spring.boot.tracing.ElasticJobTracingConfiguration required a single bean, but 2 were found:
- master: defined by method 'master' in class path resource [com/jdcloud/cost/service/config/DruidConfig.class]
- slave: defined by method 'slave' in class path resource [com/jdcloud/cost/service/config/DruidConfig.class]
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [shardingsphere-elasticjob] Xiejinhua123 commented on issue #1865: springboot2.x+ elasticjo3.0.0-RC1 +mybatis-dynamic3.3.0, can not work well with elasticjob.tracing.type=RDB
Posted by GitBox <gi...@apache.org>.
Xiejinhua123 commented on issue #1865:
URL: https://github.com/apache/shardingsphere-elasticjob/issues/1865#issuecomment-1078750266
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!
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [shardingsphere-elasticjob] ArberChang commented on issue #1865: springboot2.x+ elasticjo3.0.0-RC1 +mybatis-dynamic3.3.0, can not work well with elasticjob.tracing.type=RDB
Posted by GitBox <gi...@apache.org>.
ArberChang commented on issue #1865:
URL: https://github.com/apache/shardingsphere-elasticjob/issues/1865#issuecomment-877021787
```
<dependency>
<groupId>org.apache.shardingsphere.elasticjob</groupId>
<artifactId>elasticjob-lite-spring-boot-starter</artifactId>
<version>3.0.0</version>
</dependency>
```
it dosen`t work,when i change version to 3.0.0
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [shardingsphere-elasticjob] yujun-8848 commented on issue #1865: springboot2.x+ elasticjo3.0.0-RC1 +mybatis-dynamic3.3.0, can not work well with elasticjob.tracing.type=RDB
Posted by GitBox <gi...@apache.org>.
yujun-8848 commented on issue #1865:
URL: https://github.com/apache/shardingsphere-elasticjob/issues/1865#issuecomment-915668270
i have tried to it,but it not work well,Have you solved it now?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [shardingsphere-elasticjob] skaic commented on issue #1865: springboot2.x+ elasticjo3.0.0-RC1 +mybatis-dynamic3.3.0, can not work well with elasticjob.tracing.type=RDB
Posted by GitBox <gi...@apache.org>.
skaic commented on issue #1865:
URL: https://github.com/apache/shardingsphere-elasticjob/issues/1865#issuecomment-836478312
you can register a bean of TracingConfiguration\<DataSource\> like this:
```
@Setter
@Configuration
@ConfigurationProperties(prefix = "elasticjob.tracing.datasource")
public class ElasticJobTracingConfiguration {
private String driverClassName;
private String url;
private String username;
private String password;
@Bean
public TracingConfiguration<DataSource> myTracingConfiguration() {
BasicDataSource dataSource = new BasicDataSource();
dataSource.setDriverClassName(driverClassName);
dataSource.setUrl(url);
dataSource.setUsername(username);
dataSource.setPassword(password);
return new TracingConfiguration<>("RDB", dataSource);
}
}
```
and
```
elasticjob:
tracing:
datasource:
driverClassName: com.mysql.jdbc.Driver
url: jdbc:mysql://xxxx/databases?useUnicode=true&characterEncoding=UTF-8&useSSL=false
username: root
password: xxxx
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org