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.

riptide-micrometer has hard dependency on riptide-failsafe classes

See original GitHub issue

When using the starter 3.0.0-RC.4 with riptide-micrometer, but without riptide-failsafe, exception java.lang.ClassNotFoundException: org.zalando.riptide.failsafe.RetryListener is thrown because of hard dependency in MicrometerPluginFactory class.

Description

Full stacktrace:

Caused by: java.lang.IllegalStateException: Failed to load ApplicationContext
	at org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContext(DefaultCacheAwareContextLoaderDelegate.java:132)
	at org.springframework.test.context.support.DefaultTestContext.getApplicationContext(DefaultTestContext.java:122)
	at org.springframework.test.context.junit.jupiter.SpringExtension.getApplicationContext(SpringExtension.java:202)
	at org.springframework.test.context.junit.jupiter.SpringExtension.resolveParameter(SpringExtension.java:188)
	at org.junit.jupiter.engine.execution.ExecutableInvoker.resolveParameter(ExecutableInvoker.java:209)
	... 56 more
Caused by: java.lang.IllegalStateException: Failed to introspect Class [org.zalando.riptide.autoconfigure.MicrometerPluginFactory] from ClassLoader [java.net.URLClassLoader@6bc7c054]
	at org.springframework.util.ReflectionUtils.getDeclaredMethods(ReflectionUtils.java:476)
	at org.springframework.util.ReflectionUtils.doWithMethods(ReflectionUtils.java:354)
	at org.springframework.util.ReflectionUtils.getUniqueDeclaredMethods(ReflectionUtils.java:410)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.lambda$getTypeForFactoryMethod$2(AbstractAutowireCapableBeanFactory.java:742)
	at java.util.concurrent.ConcurrentHashMap.computeIfAbsent(ConcurrentHashMap.java:1660)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.getTypeForFactoryMethod(AbstractAutowireCapableBeanFactory.java:741)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.determineTargetType(AbstractAutowireCapableBeanFactory.java:680)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.predictBeanType(AbstractAutowireCapableBeanFactory.java:648)
	at org.springframework.beans.factory.support.AbstractBeanFactory.isFactoryBean(AbstractBeanFactory.java:1518)
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.doGetBeanNamesForType(DefaultListableBeanFactory.java:513)
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanNamesForType(DefaultListableBeanFactory.java:483)
	at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:115)
	at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:705)
	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:531)
	at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:748)
	at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:395)
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:314)
	at org.springframework.boot.test.context.SpringBootContextLoader.loadContext(SpringBootContextLoader.java:124)
	at org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContextInternal(DefaultCacheAwareContextLoaderDelegate.java:99)
	at org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContext(DefaultCacheAwareContextLoaderDelegate.java:124)
	... 60 more
Caused by: java.lang.NoClassDefFoundError: org/zalando/riptide/failsafe/RetryListener
	at java.lang.Class.getDeclaredMethods0(Native Method)
	at java.lang.Class.privateGetDeclaredMethods(Class.java:2701)
	at java.lang.Class.getDeclaredMethods(Class.java:1975)
	at org.springframework.util.ReflectionUtils.getDeclaredMethods(ReflectionUtils.java:458)
	... 79 more
Caused by: java.lang.ClassNotFoundException: org.zalando.riptide.failsafe.RetryListener
	at java.net.URLClassLoader.findClass(URLClassLoader.java:382)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
	... 83 more

Expected Behavior

Micrometer plugin works without failsafe plugin when using the starter.

Actual Behavior

Application does not load.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
whiskeysierracommented, Sep 9, 2019

@jrehwaldt Would be interested in opening a PR?

1reaction
jrehwaldtcommented, Sep 9, 2019

It might be enough to extract the static factory methods related to failsafe from MicrometerPluginFactory into it’s own class 🤷‍♂

Read more comments on GitHub >

github_iconTop Results From Across the Web

Unexpected dependency on httpclient-cache #714 - GitHub
In DefaultRiptideRegistrar the class HttpCacheStorage is always loaded, failing if httpclient-cache is not on the classpath.
Read more >
org.zalando » riptide-micrometer » 3.0.0-RC.3 (Usages)
1. Riptide: HTTP Client17 usages · org.zalando » riptide-httpclientMIT. Client side response routing with stream support · 2. Riptide: Failsafe5 usages · org....
Read more >
Untitled
... milliseconds Reports True iff the second item (a number) is equal to the ... ,play,means,needs,try,came,ca,based,hard,thought,products,national,quality ...
Read more >
bigwords.txt
... claspers clasping clasps claspt class classed classer classers classes ... riprapping ripraps rips ripsaw ripsaws riptide riptides rise risen riser ...
Read more >
corpus of words - Department of Computer Science
... clarsach clary clash clasp clasping class classic classical classicism classicist ... departmentalize departure depend dependable dependence dependency ...
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