小编Joy*_*ego的帖子

Springfox swagger 在 spring boot 2.2.0 中不起作用

我想将 spring boot v2.1.9 升级到 2.2.0。但是升级后我得到了一些例外,它说 spring fox 使用的是旧版本的 spring-plugin-core。

有没有其他替代解决方案,或者我需要放弃 springfox 插件吗?

***************************
APPLICATION FAILED TO START
***************************

Description:

An attempt was made to call a method that does not exist. The attempt was made from the following location:

    springfox.documentation.spring.web.plugins.DocumentationPluginsManager.createContextBuilder(DocumentationPluginsManager.java:152)

The following method did not exist:

    org.springframework.plugin.core.PluginRegistry.getPluginFor(Ljava/lang/Object;Lorg/springframework/plugin/core/Plugin;)Lorg/springframework/plugin/core/Plugin;

The method's class, org.springframework.plugin.core.PluginRegistry, is available from the following locations:

    jar:file:/C:/Users/regosa/.m2/repository/org/springframework/plugin/spring-plugin-core/2.0.0.RELEASE/spring-plugin-core-2.0.0.RELEASE.jar!/org/springframework/plugin/core/PluginRegistry.class

It was loaded from the following location:

    file:/C:/Users/regosa/.m2/repository/org/springframework/plugin/spring-plugin-core/2.0.0.RELEASE/spring-plugin-core-2.0.0.RELEASE.jar


Action:

Correct the classpath of your application so that it contains a single, …
Run Code Online (Sandbox Code Playgroud)

spring spring-data-jpa spring-boot swagger-2.0 springfox

31
推荐指数
4
解决办法
3万
查看次数

将 spring boot 从 2.1.9 升级到 2.2.0 ,现在启动时出现异常

我将 spring boot 从 2.1.9 升级到 2.2.0 现在我在启动应用程序时遇到了一些异常

java:openjdk11 spring-boot:v2.2.0.RELEASE

我尝试从下面的位置删除 jar 并进行了 mvn 全新安装,但仍然没有运气。

.m2/repository/org/springframework/boot/spring-boot-actuator/2.2.0.RELEASE/spring-boot-actuator-2.2.0.RELEASE.jar

错误 :


***************************
APPLICATION FAILED TO START
***************************

Description:

An attempt was made to call a method that does not exist. The attempt was made from the following location:

    org.springframework.cloud.client.discovery.health.DiscoveryCompositeHealthIndicator.<init>(DiscoveryCompositeHealthIndicator.java:41)

The following method did not exist:

    org.springframework.boot.actuate.health.CompositeHealthIndicator.<init>(Lorg/springframework/boot/actuate/health/HealthAggregator;)V

The method's class, org.springframework.boot.actuate.health.CompositeHealthIndicator, is available from the following locations:

    jar:file:/C:/Users/regosa/.m2/repository/org/springframework/boot/spring-boot-actuator/2.2.0.RELEASE/spring-boot-actuator-2.2.0.RELEASE.jar!/org/springframework/boot/actuate/health/CompositeHealthIndicator.class

It was loaded from the following location:

    file:/C:/Users/regosa/.m2/repository/org/springframework/boot/spring-boot-actuator/2.2.0.RELEASE/spring-boot-actuator-2.2.0.RELEASE.jar


Action:

Correct the classpath of your application so …
Run Code Online (Sandbox Code Playgroud)

spring spring-boot spring-boot-actuator

12
推荐指数
3
解决办法
3万
查看次数

Spring Boot 中的事务同步与 Database+ kafka 示例

我想使用数据库作为 MySQL + Mango 编写一个带有 Spring Boot 的新应用程序,并用于向 Spring Kafka 发送消息。

我尝试使用 Many POC 来同步 Kafka 和 DB 之间的事务,但在某些情况下我失败了,并且我搜索了许多存储库、博客以获取至少一个示例。我现在还没有得到任何例子。

如果有人提供至少一个示例或配置,这将是未来所有人的一个很好的参考。

spring-data-jpa spring-boot spring-kafka

5
推荐指数
1
解决办法
1639
查看次数

spring boot V2.1.9.RELEASE不支持Spring kafka 2.3.1

我有使用 spring boot V2.1.9.RELEASE 版本的 spring boot 应用程序。我只想升级spring Kafka。但是升级后我没有发现这样的方法错误。

我尝试将 Spring Boot 升级到 2.2.0,但由于其他一些插件(如 swagger)不支持。

日志:

2019-10-30 14:35:36.236  WARN [xxxxx-component-workflow-handler,,,] 20192 --- [           main] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.kafka.config.internalKafkaListenerAnnotationProcessor': Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.kafka.annotation.KafkaListenerAnnotationBeanPostProcessor]: Constructor threw exception; nested exception is java.lang.NoClassDefFoundError: org/springframework/core/log/LogAccessor
2019-10-30 14:35:36.256  INFO [xxxxx-component-workflow-handler,,,] 20192 --- [           main] ConditionEvaluationReportLoggingListener : 

Error starting ApplicationContext. To display the conditions report …
Run Code Online (Sandbox Code Playgroud)

apache-kafka spring-boot spring-kafka

4
推荐指数
1
解决办法
4164
查看次数

春季卡夫卡面临org.apache.kafka.common.errors.InvalidPidMappingException

我正在使用 spring boot 2.1.9 和 spring Kafka 2.2.9。

我的 Spring Boot 应用程序在过去 2 周内一直处于空闲状态,它正在运行,但仍然没有人访问 API。但是当我今天开始使用时,对于第一个请求,它给了我以下错误。

2019-12-18 14:43:03.908 ERROR [xxxx-account-service,681c8de32a0d1127,681c8de32a0d1127,false] 10 --- [nio-8080-exec-5] o.s.t.i.TransactionInterceptor           : Application exception overridden by commit exception

org.apache.kafka.common.KafkaException: Cannot perform send because at least one previous transactional or idempotent request has failed with errors.
        at org.apache.kafka.clients.producer.internals.TransactionManager.failIfNotReadyForSend(TransactionManager.java:279)
        at org.apache.kafka.clients.producer.internals.TransactionManager.maybeAddPartitionToTransaction(TransactionManager.java:264)
        at org.apache.kafka.clients.producer.KafkaProducer.doSend(KafkaProducer.java:862)
        at org.apache.kafka.clients.producer.KafkaProducer.send(KafkaProducer.java:803)
        at org.springframework.kafka.core.DefaultKafkaProducerFactory$CloseSafeProducer.send(DefaultKafkaProducerFactory.java:470)
        at brave.kafka.clients.TracingProducer.send(TracingProducer.java:106)
        at org.springframework.kafka.core.KafkaTemplate.doSend(KafkaTemplate.java:407)
        at org.springframework.kafka.core.KafkaTemplate.send(KafkaTemplate.java:217)
        at com.xxxx.service.messaging.impl.MessageProducerImpl.sendStringMessage(MessageProducerImpl.java:61)
        at com.xxxx.service.messaging.impl.MessageProducerImpl.sendIntegerMessage(MessageProducerImpl.java:72)
        at com.xxxx.service.messaging.impl.MessageProducerImpl$$FastClassBySpringCGLIB$$5b6c8aa3.invoke(<generated>)
        at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218)
        at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:750)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)
        at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:295)
        at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:98)
        at …
Run Code Online (Sandbox Code Playgroud)

apache-kafka spring-boot spring-kafka

1
推荐指数
2
解决办法
2108
查看次数