xuxueli / xxl-job

A distributed task scheduling framework.(分布式任务调度平台XXL-JOB)
http://www.xuxueli.com/xxl-job/
GNU General Public License v3.0
27.82k stars 10.96k forks source link

springcloud+nacos+openfeign项目集成xxl-job后,历史废弃接口不写请求方式不行了。 #3474

Open lixinyucode opened 5 months ago

lixinyucode commented 5 months ago

集成xxljob后,我原先模块的一些废弃接口,原先都是把请求方式注释掉的,不让外界访问,集成xxljob后,这些模块都起不来了,提示我那些接口需要加@PostMapping或者@GetMapping之类的注解,我加上这些注解,确实好用,但是我不想这么做,因为他们都是废弃接口,我不想暴露给外界,请求xxljob中是什么组件提供了扫描接口请求方式的功能,我能否避免掉呢?

Please answer some questions before submitting your issue. Thanks!

Which version of XXL-JOB do you using?

2.4.1

Expected behavior

Actual behavior

Steps to reproduce the behavior

Other information

zhipingwu commented 5 months ago

有具体的日志吗

lixinyucode commented 5 months ago

2024-06-12 09:58:31,261 [main] INFO com.zaxxer.hikari.HikariDataSource:350[NONE] - PRIMARY-192.168.88.7 - Shutdown initiated... 2024-06-12 09:58:31,539 [main] INFO com.zaxxer.hikari.HikariDataSource:352[NONE] - PRIMARY-192.168.88.7 - Shutdown completed. 2024-06-12 09:58:31,540 [main] INFO org.apache.catalina.core.StandardService:173[NONE] - Stopping service [Tomcat] 2024-06-12 09:58:31,560 [main] INFO o.s.b.a.logging.ConditionEvaluationReportLogger:82[NONE] -

Error starting ApplicationContext. To display the condition evaluation report re-run your application with 'debug' enabled. 2024-06-12 09:58:31,721 [main] ERROR org.springframework.boot.SpringApplication:822[NONE] - Application run failed org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'com.ds.client.settlecenter.api.SettlementApi': FactoryBean threw exception on object creation at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.doGetObjectFromFactoryBean(FactoryBeanRegistrySupport.java:184) at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.getObjectFromFactoryBean(FactoryBeanRegistrySupport.java:120) at org.springframework.beans.factory.support.AbstractBeanFactory.getObjectForBeanInstance(AbstractBeanFactory.java:1804) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.getObjectForBeanInstance(AbstractAutowireCapableBeanFactory.java:1273) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:258) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199) at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1158) at com.xxl.job.core.executor.impl.XxlJobSpringExecutor.initJobHandlerMethodRepository(XxlJobSpringExecutor.java:95) at com.xxl.job.core.executor.impl.XxlJobSpringExecutor.afterSingletonsInstantiated(XxlJobSpringExecutor.java:38) at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:984) at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:942) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:608) at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:146) at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:732) at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:434) at org.springframework.boot.SpringApplication.run(SpringApplication.java:310) at org.springframework.boot.SpringApplication.run(SpringApplication.java:1304) at org.springframework.boot.SpringApplication.run(SpringApplication.java:1293) at com.ds.Bootstrap.main(Bootstrap.java:15) Caused by: java.lang.IllegalStateException: Method SettlementApi#sumSettlementDTO(SettlementFindRequest) not annotated with HTTP method type (ex. GET, POST) Warnings:

Process finished with exit code 1 @zhipingwu 这是具体的日志

lixinyucode commented 5 months ago

image image @zhipingwu 这是我那个废弃接口,以前注掉postmapping注解都没问题的,加了xxljob后,就报错了