Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[reporter][kafka]ClassNotFoundException : io.gravitee.reporter.kafka.spring.EnabledKafkaReporter #1805

Closed
sjoss opened this Issue Jan 10, 2019 · 5 comments

Comments

@sjoss
Copy link

sjoss commented Jan 10, 2019

Expected Behavior

we want to used Kafka reporter to exploit the logs

Current Behavior

if we install the reporter-kafka from https://download.gravitee.io/graviteeio-apim/plugins/reporters/gravitee-reporter-kafka/ : the gatway send a ClassNotFoundException

java.lang.IllegalArgumentException: Could not find class [io.gravitee.reporter.kafka.spring.EnabledKafkaReporter]
	at org.springframework.util.ClassUtils.resolveClassName(ClassUtils.java:313)
	at org.springframework.context.annotation.ConditionEvaluator.getCondition(ConditionEvaluator.java:124)
	at org.springframework.context.annotation.ConditionEvaluator.shouldSkip(ConditionEvaluator.java:96)
	at org.springframework.context.annotation.ConditionEvaluator.shouldSkip(ConditionEvaluator.java:88)
	at org.springframework.context.annotation.ConditionEvaluator.shouldSkip(ConditionEvaluator.java:71)
	at org.springframework.context.annotation.AnnotatedBeanDefinitionReader.doRegisterBean(AnnotatedBeanDefinitionReader.java:217)
	at org.springframework.context.annotation.AnnotatedBeanDefinitionReader.registerBean(AnnotatedBeanDefinitionReader.java:145)
	at org.springframework.context.annotation.AnnotatedBeanDefinitionReader.register(AnnotatedBeanDefinitionReader.java:135)
	at org.springframework.context.annotation.AnnotationConfigApplicationContext.register(AnnotationConfigApplicationContext.java:158)
	at io.gravitee.plugin.core.internal.AnnotationBasedPluginContextConfigurer.lambda$applicationContext$0(AnnotationBasedPluginContextConfigurer.java:86)
	at java.lang.Iterable.forEach(Iterable.java:75)
	at io.gravitee.plugin.core.internal.AnnotationBasedPluginContextConfigurer.applicationContext(AnnotationBasedPluginContextConfigurer.java:86)
	at io.gravitee.plugin.core.internal.PluginContextFactoryImpl.create(PluginContextFactoryImpl.java:51)
	at io.gravitee.plugin.core.internal.PluginContextFactoryImpl.create(PluginContextFactoryImpl.java:73)
	at io.gravitee.node.reporter.plugin.ReporterPluginHandler.handle(ReporterPluginHandler.java:60)
	at io.gravitee.plugin.core.internal.PluginEventListener.lambda$null$2(PluginEventListener.java:110)
	at java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:184)
	at java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:175)
	at java.util.Iterator.forEachRemaining(Iterator.java:116)
	at java.util.Spliterators$IteratorSpliterator.forEachRemaining(Spliterators.java:1801)
	at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:481)
	at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471)
	at java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:151)
	at java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:174)
	at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
	at java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:418)
	at io.gravitee.plugin.core.internal.PluginEventListener.lambda$deployPlugins$3(PluginEventListener.java:108)
	at java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:184)
	at java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:175)
	at java.util.HashMap$ValueSpliterator.forEachRemaining(HashMap.java:1625)
	at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:481)
	at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471)
	at java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:151)
	at java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:174)
	at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
	at java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:418)
	at io.gravitee.plugin.core.internal.PluginEventListener.deployPlugins(PluginEventListener.java:105)
	at io.gravitee.plugin.core.internal.PluginEventListener.deployPlugins(PluginEventListener.java:93)
	at io.gravitee.plugin.core.internal.PluginEventListener.onEvent(PluginEventListener.java:63)
	at io.gravitee.common.event.impl.EventManagerImpl.publishEvent(EventManagerImpl.java:44)
	at io.gravitee.common.event.impl.EventManagerImpl.publishEvent(EventManagerImpl.java:36)
	at io.gravitee.plugin.core.internal.PluginRegistryImpl.init(PluginRegistryImpl.java:105)
	at io.gravitee.plugin.core.internal.PluginRegistryImpl.doStart(PluginRegistryImpl.java:81)
	at io.gravitee.common.component.AbstractLifecycleComponent.start(AbstractLifecycleComponent.java:32)
	at io.gravitee.node.container.AbstractNode.doStart(AbstractNode.java:74)
	at io.gravitee.common.component.AbstractLifecycleComponent.start(AbstractLifecycleComponent.java:32)
	at io.gravitee.node.container.AbstractContainer.doStart(AbstractContainer.java:89)
	at io.gravitee.common.component.AbstractLifecycleComponent.start(AbstractLifecycleComponent.java:32)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at io.gravitee.gateway.standalone.boostrap.Bootstrap.start(Bootstrap.java:162)
	at io.gravitee.gateway.standalone.boostrap.Bootstrap.main(Bootstrap.java:171)
Caused by: java.lang.ClassNotFoundException: io.gravitee.reporter.kafka.spring.EnabledKafkaReporter
	at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
	at org.springframework.util.ClassUtils.forName(ClassUtils.java:274)
	at org.springframework.util.ClassUtils.resolveClassName(ClassUtils.java:310)
	... 53 common frames omitted

We have the same issue if we build from master (gravitee-reporter-kafka-1.1.0-snap.zip)

Possible Solution

quick fix : remove the spring controler (it call EnabledKafkaReporter)

Context

we cannot log in kafka

Your Environment

  • Version used: 1..20.9 / kafka-reporter 1.0.0 and 1.1.0
  • Browser Name and version: Chrome
  • Operating System and version: Linux
@brasseld

This comment has been minimized.

Copy link
Member

brasseld commented Jan 10, 2019

Why not providing a PR instead of saying what we have to do to fix the issue ?

@sjoss

This comment has been minimized.

Copy link
Author

sjoss commented Jan 10, 2019

you're right and I'm doing code (and PR). 😃
it's just a process problem : if you preffer an issue to discuss the problem then a PR or PR directly ...

@brasseld

This comment has been minimized.

Copy link
Member

brasseld commented Jan 10, 2019

@sjoss

This comment has been minimized.

Copy link
Author

sjoss commented Jan 10, 2019

ok, I do it again my PR cleanly ...

@brasseld

This comment has been minimized.

Copy link
Member

brasseld commented Mar 11, 2019

@brasseld brasseld closed this Mar 11, 2019

@brasseld brasseld self-assigned this Mar 11, 2019

@brasseld brasseld added this to the APIM - 1.24.0 milestone Mar 11, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.