question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

using riptide-spring-boot-starter causes field error

See original GitHub issue

tried to integrate riptide-spring-boot-starter:2.6.0-RC2 into a project. but running the application results in a bean creation error. adding converters for TimeSpan and Ratio didn’t help. any idea what is missing? see code for converter and error log below.

package org.zalando.riptide.spring;

import org.springframework.boot.context.properties.ConfigurationPropertiesBinding;
import org.springframework.core.convert.converter.Converter;
import org.springframework.stereotype.Component;

@Component
@ConfigurationPropertiesBinding
public class TimeSpanConverter implements Converter<String, TimeSpan> {

    @Override
    public TimeSpan convert(final String source) {
        if (source == null) {
            return null;
        }
        return TimeSpan.valueOf(source);
    }

}
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'restClientPostProcessor' defined in class path resource [org/zalando/riptide/spring/RiptideAutoConfiguration.class]: Initialization of bean failed; nested exception is org.springframework.validation.BindException: org.springframework.boot.bind.RelaxedDataBinder$RelaxedBeanPropertyBindingResult: 14 errors
Field error in object 'riptide' on field 'oauth.schedulingPeriod': rejected value [10 seconds]; codes [typeMismatch.riptide.oauth.schedulingPeriod,typeMismatch.oauth.schedulingPeriod,typeMismatch.schedulingPeriod,typeMismatch.org.zalando.riptide.spring.TimeSpan,typeMismatch]; arguments [org.springframework.context.support.DefaultMessageSourceResolvable: codes [riptide.oauth.schedulingPeriod,oauth.schedulingPeriod]; arguments []; default message [oauth.schedulingPeriod]]; default message [Failed to convert property value of type 'java.lang.String' to required type 'org.zalando.riptide.spring.TimeSpan' for property 'oauth.schedulingPeriod'; nested exception is org.springframework.core.convert.ConverterNotFoundException: No converter found capable of converting from type [java.lang.String] to type [org.zalando.riptide.spring.TimeSpan]]
Field error in object 'riptide' on field 'oauth.connectTimeout': rejected value [1 second]; codes [typeMismatch.riptide.oauth.connectTimeout,typeMismatch.oauth.connectTimeout,typeMismatch.connectTimeout,typeMismatch.org.zalando.riptide.spring.TimeSpan,typeMismatch]; arguments [org.springframework.context.support.DefaultMessageSourceResolvable: codes [riptide.oauth.connectTimeout,oauth.connectTimeout]; arguments []; default message [oauth.connectTimeout]]; default message [Failed to convert property value of type 'java.lang.String' to required type 'org.zalando.riptide.spring.TimeSpan' for property 'oauth.connectTimeout'; nested exception is org.springframework.core.convert.ConverterNotFoundException: No converter found capable of converting from type [java.lang.String] to type [org.zalando.riptide.spring.TimeSpan]]
Field error in object 'riptide' on field 'oauth.socketTimeout': rejected value [1500 milliseconds]; codes [typeMismatch.riptide.oauth.socketTimeout,typeMismatch.oauth.socketTimeout,typeMismatch.socketTimeout,typeMismatch.org.zalando.riptide.spring.TimeSpan,typeMismatch]; arguments [org.springframework.context.support.DefaultMessageSourceResolvable: codes [riptide.oauth.socketTimeout,oauth.socketTimeout]; arguments []; default message [oauth.socketTimeout]]; default message [Failed to convert property value of type 'java.lang.String' to required type 'org.zalando.riptide.spring.TimeSpan' for property 'oauth.socketTimeout'; nested exception is org.springframework.core.convert.ConverterNotFoundException: No converter found capable of converting from type [java.lang.String] to type [org.zalando.riptide.spring.TimeSpan]]
Field error in object 'riptide' on field 'clients[nakadi].connectTimeout': rejected value [1000 milliseconds]; codes [typeMismatch.riptide.clients[nakadi].connectTimeout,typeMismatch.riptide.clients.connectTimeout,typeMismatch.clients[nakadi].connectTimeout,typeMismatch.clients.connectTimeout,typeMismatch.connectTimeout,typeMismatch.org.zalando.riptide.spring.TimeSpan,typeMismatch]; arguments [org.springframework.context.support.DefaultMessageSourceResolvable: codes [riptide.clients[nakadi].connectTimeout,clients[nakadi].connectTimeout]; arguments []; default message [clients[nakadi].connectTimeout]]; default message [Failed to convert property value of type 'java.lang.String' to required type 'org.zalando.riptide.spring.TimeSpan' for property 'clients[nakadi].connectTimeout'; nested exception is org.springframework.core.convert.ConverterNotFoundException: No converter found capable of converting from type [java.lang.String] to type [org.zalando.riptide.spring.TimeSpan]]
Field error in object 'riptide' on field 'clients[nakadi].socketTimeout': rejected value [12000 milliseconds]; codes [typeMismatch.riptide.clients[nakadi].socketTimeout,typeMismatch.riptide.clients.socketTimeout,typeMismatch.clients[nakadi].socketTimeout,typeMismatch.clients.socketTimeout,typeMismatch.socketTimeout,typeMismatch.org.zalando.riptide.spring.TimeSpan,typeMismatch]; arguments [org.springframework.context.support.DefaultMessageSourceResolvable: codes [riptide.clients[nakadi].socketTimeout,clients[nakadi].socketTimeout]; arguments []; default message [clients[nakadi].socketTimeout]]; default message [Failed to convert property value of type 'java.lang.String' to required type 'org.zalando.riptide.spring.TimeSpan' for property 'clients[nakadi].socketTimeout'; nested exception is org.springframework.core.convert.ConverterNotFoundException: No converter found capable of converting from type [java.lang.String] to type [org.zalando.riptide.spring.TimeSpan]]
Field error in object 'riptide' on field 'clients[nakadi].connectionTimeToLive': rejected value [30 seconds]; codes [typeMismatch.riptide.clients[nakadi].connectionTimeToLive,typeMismatch.riptide.clients.connectionTimeToLive,typeMismatch.clients[nakadi].connectionTimeToLive,typeMismatch.clients.connectionTimeToLive,typeMismatch.connectionTimeToLive,typeMismatch.org.zalando.riptide.spring.TimeSpan,typeMismatch]; arguments [org.springframework.context.support.DefaultMessageSourceResolvable: codes [riptide.clients[nakadi].connectionTimeToLive,clients[nakadi].connectionTimeToLive]; arguments []; default message [clients[nakadi].connectionTimeToLive]]; default message [Failed to convert property value of type 'java.lang.String' to required type 'org.zalando.riptide.spring.TimeSpan' for property 'clients[nakadi].connectionTimeToLive'; nested exception is org.springframework.core.convert.ConverterNotFoundException: No converter found capable of converting from type [java.lang.String] to type [org.zalando.riptide.spring.TimeSpan]]
Field error in object 'riptide' on field 'clients[nakadi].threadPool.keepAlive': rejected value [1 minute]; codes [typeMismatch.riptide.clients[nakadi].threadPool.keepAlive,typeMismatch.riptide.clients.threadPool.keepAlive,typeMismatch.clients[nakadi].threadPool.keepAlive,typeMismatch.clients.threadPool.keepAlive,typeMismatch.keepAlive,typeMismatch.org.zalando.riptide.spring.TimeSpan,typeMismatch]; arguments [org.springframework.context.support.DefaultMessageSourceResolvable: codes [riptide.clients[nakadi].threadPool.keepAlive,clients[nakadi].threadPool.keepAlive]; arguments []; default message [clients[nakadi].threadPool.keepAlive]]; default message [Failed to convert property value of type 'java.lang.String' to required type 'org.zalando.riptide.spring.TimeSpan' for property 'clients[nakadi].threadPool.keepAlive'; nested exception is org.springframework.core.convert.ConverterNotFoundException: No converter found capable of converting from type [java.lang.String] to type [org.zalando.riptide.spring.TimeSpan]]
Field error in object 'riptide' on field 'clients[nakadi].retry.backoff.delay': rejected value [110 milliseconds]; codes [typeMismatch.riptide.clients[nakadi].retry.backoff.delay,typeMismatch.riptide.clients.retry.backoff.delay,typeMismatch.clients[nakadi].retry.backoff.delay,typeMismatch.clients.retry.backoff.delay,typeMismatch.delay,typeMismatch.org.zalando.riptide.spring.TimeSpan,typeMismatch]; arguments [org.springframework.context.support.DefaultMessageSourceResolvable: codes [riptide.clients[nakadi].retry.backoff.delay,clients[nakadi].retry.backoff.delay]; arguments []; default message [clients[nakadi].retry.backoff.delay]]; default message [Failed to convert property value of type 'java.lang.String' to required type 'org.zalando.riptide.spring.TimeSpan' for property 'clients[nakadi].retry.backoff.delay'; nested exception is org.springframework.core.convert.ConverterNotFoundException: No converter found capable of converting from type [java.lang.String] to type [org.zalando.riptide.spring.TimeSpan]]
Field error in object 'riptide' on field 'clients[nakadi].retry.backoff.maxDelay': rejected value [200 milliseconds]; codes [typeMismatch.riptide.clients[nakadi].retry.backoff.maxDelay,typeMismatch.riptide.clients.retry.backoff.maxDelay,typeMismatch.clients[nakadi].retry.backoff.maxDelay,typeMismatch.clients.retry.backoff.maxDelay,typeMismatch.maxDelay,typeMismatch.org.zalando.riptide.spring.TimeSpan,typeMismatch]; arguments [org.springframework.context.support.DefaultMessageSourceResolvable: codes [riptide.clients[nakadi].retry.backoff.maxDelay,clients[nakadi].retry.backoff.maxDelay]; arguments []; default message [clients[nakadi].retry.backoff.maxDelay]]; default message [Failed to convert property value of type 'java.lang.String' to required type 'org.zalando.riptide.spring.TimeSpan' for property 'clients[nakadi].retry.backoff.maxDelay'; nested exception is org.springframework.core.convert.ConverterNotFoundException: No converter found capable of converting from type [java.lang.String] to type [org.zalando.riptide.spring.TimeSpan]]
Field error in object 'riptide' on field 'clients[nakadi].retry.maxDuration': rejected value [20 seconds]; codes [typeMismatch.riptide.clients[nakadi].retry.maxDuration,typeMismatch.riptide.clients.retry.maxDuration,typeMismatch.clients[nakadi].retry.maxDuration,typeMismatch.clients.retry.maxDuration,typeMismatch.maxDuration,typeMismatch.org.zalando.riptide.spring.TimeSpan,typeMismatch]; arguments [org.springframework.context.support.DefaultMessageSourceResolvable: codes [riptide.clients[nakadi].retry.maxDuration,clients[nakadi].retry.maxDuration]; arguments []; default message [clients[nakadi].retry.maxDuration]]; default message [Failed to convert property value of type 'java.lang.String' to required type 'org.zalando.riptide.spring.TimeSpan' for property 'clients[nakadi].retry.maxDuration'; nested exception is org.springframework.core.convert.ConverterNotFoundException: No converter found capable of converting from type [java.lang.String] to type [org.zalando.riptide.spring.TimeSpan]]
Field error in object 'riptide' on field 'clients[nakadi].retry.jitter': rejected value [100 milliseconds]; codes [typeMismatch.riptide.clients[nakadi].retry.jitter,typeMismatch.riptide.clients.retry.jitter,typeMismatch.clients[nakadi].retry.jitter,typeMismatch.clients.retry.jitter,typeMismatch.jitter,typeMismatch.org.zalando.riptide.spring.TimeSpan,typeMismatch]; arguments [org.springframework.context.support.DefaultMessageSourceResolvable: codes [riptide.clients[nakadi].retry.jitter,clients[nakadi].retry.jitter]; arguments []; default message [clients[nakadi].retry.jitter]]; default message [Failed to convert property value of type 'java.lang.String' to required type 'org.zalando.riptide.spring.TimeSpan' for property 'clients[nakadi].retry.jitter'; nested exception is org.springframework.core.convert.ConverterNotFoundException: No converter found capable of converting from type [java.lang.String] to type [org.zalando.riptide.spring.TimeSpan]]
Field error in object 'riptide' on field 'clients[nakadi].circuitBreaker.failureThreshold': rejected value [5 out of 20]; codes [typeMismatch.riptide.clients[nakadi].circuitBreaker.failureThreshold,typeMismatch.riptide.clients.circuitBreaker.failureThreshold,typeMismatch.clients[nakadi].circuitBreaker.failureThreshold,typeMismatch.clients.circuitBreaker.failureThreshold,typeMismatch.failureThreshold,typeMismatch.org.zalando.riptide.spring.Ratio,typeMismatch]; arguments [org.springframework.context.support.DefaultMessageSourceResolvable: codes [riptide.clients[nakadi].circuitBreaker.failureThreshold,clients[nakadi].circuitBreaker.failureThreshold]; arguments []; default message [clients[nakadi].circuitBreaker.failureThreshold]]; default message [Failed to convert property value of type 'java.lang.String' to required type 'org.zalando.riptide.spring.Ratio' for property 'clients[nakadi].circuitBreaker.failureThreshold'; nested exception is org.springframework.core.convert.ConverterNotFoundException: No converter found capable of converting from type [java.lang.String] to type [org.zalando.riptide.spring.Ratio]]
Field error in object 'riptide' on field 'clients[nakadi].circuitBreaker.delay': rejected value [10 seconds]; codes [typeMismatch.riptide.clients[nakadi].circuitBreaker.delay,typeMismatch.riptide.clients.circuitBreaker.delay,typeMismatch.clients[nakadi].circuitBreaker.delay,typeMismatch.clients.circuitBreaker.delay,typeMismatch.delay,typeMismatch.org.zalando.riptide.spring.TimeSpan,typeMismatch]; arguments [org.springframework.context.support.DefaultMessageSourceResolvable: codes [riptide.clients[nakadi].circuitBreaker.delay,clients[nakadi].circuitBreaker.delay]; arguments []; default message [clients[nakadi].circuitBreaker.delay]]; default message [Failed to convert property value of type 'java.lang.String' to required type 'org.zalando.riptide.spring.TimeSpan' for property 'clients[nakadi].circuitBreaker.delay'; nested exception is org.springframework.core.convert.ConverterNotFoundException: No converter found capable of converting from type [java.lang.String] to type [org.zalando.riptide.spring.TimeSpan]]
Field error in object 'riptide' on field 'clients[nakadi].circuitBreaker.successThreshold': rejected value [3 out of 5]; codes [typeMismatch.riptide.clients[nakadi].circuitBreaker.successThreshold,typeMismatch.riptide.clients.circuitBreaker.successThreshold,typeMismatch.clients[nakadi].circuitBreaker.successThreshold,typeMismatch.clients.circuitBreaker.successThreshold,typeMismatch.successThreshold,typeMismatch.org.zalando.riptide.spring.Ratio,typeMismatch]; arguments [org.springframework.context.support.DefaultMessageSourceResolvable: codes [riptide.clients[nakadi].circuitBreaker.successThreshold,clients[nakadi].circuitBreaker.successThreshold]; arguments []; default message [clients[nakadi].circuitBreaker.successThreshold]]; default message [Failed to convert property value of type 'java.lang.String' to required type 'org.zalando.riptide.spring.Ratio' for property 'clients[nakadi].circuitBreaker.successThreshold'; nested exception is org.springframework.core.convert.ConverterNotFoundException: No converter found capable of converting from type [java.lang.String] to type [org.zalando.riptide.spring.Ratio]]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:564)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:483)
	at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306)
	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)
	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202)
	at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:115)
	at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:686)
	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:524)
	at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:737)
	at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:370)
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:314)
	at org.springframework.boot.test.context.SpringBootContextLoader.loadContext(SpringBootContextLoader.java:120)
	at org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContextInternal(DefaultCacheAwareContextLoaderDelegate.java:98)
	at org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContext(DefaultCacheAwareContextLoaderDelegate.java:116)
	... 24 more

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:11 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
whiskeysierracommented, Dec 10, 2017

It looks like the problem is our usage of Preconditions.checkArgument(..).

Version 22.0 (which we compile against) defines it as:

  public static void checkArgument(
      boolean b, @Nullable String errorMessageTemplate, @Nullable Object p1) {
    if (!b) {
      throw new IllegalArgumentException(format(errorMessageTemplate, p1));
    }
  }

Version 19.0 on the other hand:

  public static void checkArgument(
      boolean expression,
      @Nullable String errorMessageTemplate,
      @Nullable Object... errorMessageArgs) {
    if (!expression) {
      throw new IllegalArgumentException(format(errorMessageTemplate, errorMessageArgs));
    }
  }

See release log of version 20.0.

0reactions
whiskeysierracommented, Sep 18, 2018

Since this comes up once in a while I’d like to get rid of the usages of Preconditions that cause the error.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Riptide: Client-side Response Routing for Spring - Morioh
Integration of your typical Spring Boot Application with Riptide, Logbook and Tracer can be greatly simplified by using the Riptide: Spring Boot Starter....
Read more >
Riptide Alternatives - Java Networking | LibHunt
Riptide is a library that implements client-side response routing. It tries to fill the gap between the HTTP protocol and Java. Riptide allows ......
Read more >
Client-side response routing for Spring - JavaRepos
tried to integrate riptide-spring-boot-starter:2.6.0-RC2 into a project. but running the application results in a bean creation error.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found