shardingsphere-elasticjob icon indicating copy to clipboard operation
shardingsphere-elasticjob copied to clipboard

please help ,why The source code and the code in the jar are different, jar download in maven

Open Summary-wcj opened this issue 3 years ago • 3 comments

Hi, I have a question: in source code -->ElasticJobBootstrapConfiguration implements SmartInitializingSingleton, ApplicationContextAware but in the jar --> ElasticJobBootstrapConfiguration implements ApplicationContextAware, BeanPostProcessor

ElasticJobBootstrapConfiguration implements ApplicationContextAware, BeanPostProcessor

源码中的 ElasticJobBootstrapConfiguration 类 实现的是 SmartInitializingSingleton 和 ApplicationContextAware,但是在打包后的jar中 ElasticJobBootstrapConfiguration 实现是的 ApplicationContextAware和 BeanPostProcessor,一个是SmartInitializingSingleton,一个是BeanPostProcessor,哪个是正确的

Summary-wcj avatar Jan 13 '22 13:01 Summary-wcj

Please check the version of ElasticJob.

TeslaCN avatar Jan 14 '22 12:01 TeslaCN

What I pulled from Git is the code of the master branch. After packaging, I put the starter dependency into the task test project for testing. The startup failed. Then I downloaded the package from Maven for testing. I found that the implementation classes of ElasticJobBootstrapConfiguration are different

我从git上拉去的是master分支的代码,打包后将starter 的依赖放在任务测试的项目中测试,启动失败,然后我从maven去下载包进行测试,发现ElasticJobBootstrapConfiguration 的实现的类不同

Summary-wcj avatar Jan 15 '22 14:01 Summary-wcj

it is error info:

Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled. 2022-01-15 23:06:09.972 ERROR 8100 --- [ main] o.s.b.d.LoggingFailureAnalysisReporter :


APPLICATION FAILED TO START


Description:

Field occurErrorNoticeEmailJob in com.example.elasticdemo.controller.OneOffJobController required a bean of type 'org.apache.shardingsphere.elasticjob.lite.api.bootstrap.impl.OneOffJobBootstrap' that could not be found.

The injection point has the following annotations: - @org.springframework.beans.factory.annotation.Autowired(required=true) - @org.springframework.beans.factory.annotation.Qualifier(value=occurErrorNoticeEmailBean)

Action:

Consider defining a bean of type 'org.apache.shardingsphere.elasticjob.lite.api.bootstrap.impl.OneOffJobBootstrap' in your configuration.

Disconnected from the target VM, address: '127.0.0.1:56523', transport: 'socket'

Because of this error, I used the dependency package on Maven warehouse and found that there was no such error. Then I checked the "ScheduleJobBootstrap" according to the error information. I found that the class "ElasticJobBootstrapConfiguration" was used, and found that this class is different from the class implemented by the class on the master branch of GIT warehouse

Is the dependency package published in the Maven repository not on the master branch?

maven:3.0.0-RC1

Self packaged is the master branch

I pulled the source code from GIT and tested it locally

Please help me see why

因为这个错误,我使用maven仓库上的依赖包,发现是没有这个错误的,然后我根据错误信息去查看了这个“ScheduleJobBootstrap”,看到是在这个类“ElasticJobBootstrapConfiguration”被使用了,并且发现了这个类与git仓库上master分支上的这个类所实现的类是不一样的

是不是发布在maven仓库的依赖包不是master分支上的吗

maven:是3.0.0-RC1 自己打包的是master分支的依赖

我是将源码从git上拉取下来,在本地测试的

Summary-wcj avatar Jan 15 '22 15:01 Summary-wcj