本文介绍了天鹅座java.lang.ClassNotFoundException:com.telefonica.iot.cygnus.interceptors.GroupingInterceptor $ Builder的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

运行Ubuntu Trusty的Azure VM.

Azure VM running Ubuntu Trusty.

尝试测试天鹅座时,出现异常java.lang.ClassNotFoundException: com.telefonica.iot.cygnus.interceptors.GroupingInterceptor$Builder

When trying to test Cygnus I get an exception java.lang.ClassNotFoundException: com.telefonica.iot.cygnus.interceptors.GroupingInterceptor$Builder

以下是命令的完整输出.

Below is the full output from the command.

$ APACHE_FLUME_HOME/bin/cygnus-flume-ng agent --conf APACHE_FLUME_HOME/conf/ -f APACHE_FLUME_HOME/conf/agent_test.conf -n cygnusagent -Dflume.root.logger=INFO.console
+ exec /usr/lib/jvm/java-7-openjdk-amd64//bin/java -Xmx20m -Dflume.root.logger=INFO.console -cp '/home/cygnus/APACHE_FLUME_HOME/conf:/home/cygnus/APACHE_FLUME_HOME/lib/*:/home/cygnus/APACHE_FLUME_HOME/plugins.d/cygnus/lib/*:/home/cygnus/APACHE_FLUME_HOME/plugins.d/cygnus/libext/*' -Djava.library.path= com.telefonica.iot.cygnus.nodes.CygnusApplication -f APACHE_FLUME_HOME/conf/agent_test.conf -n cygnusagent
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/home/cygnus/APACHE_FLUME_HOME/lib/slf4j-log4j12-1.6.1.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/home/cygnus/APACHE_FLUME_HOME/plugins.d/cygnus/lib/cygnus-ngsi-1.1.0-jar-with-dependencies.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/home/cygnus/APACHE_FLUME_HOME/plugins.d/cygnus/libext/cygnus-common-1.1.0-jar-with-dependencies.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
16/06/15 15:03:17 INFO nodes.CygnusApplication: Starting Cygnus, version 1.1.0.a2fe807e6b9210d3c0e584ea52c4242458bdc6ff
16/06/15 15:03:17 INFO nodes.CygnusApplication: Waiting for valid Flume components references...
16/06/15 15:03:17 INFO node.PollingPropertiesFileConfigurationProvider: Configuration provider starting
16/06/15 15:03:17 INFO node.PollingPropertiesFileConfigurationProvider: Reloading configuration file:APACHE_FLUME_HOME/conf/agent_test.conf
16/06/15 15:03:17 INFO conf.FlumeConfiguration: Processing:test-sink
16/06/15 15:03:17 INFO conf.FlumeConfiguration: Processing:test_sink
16/06/15 15:03:17 INFO conf.FlumeConfiguration: Processing:test-sink
16/06/15 15:03:17 INFO conf.FlumeConfiguration: Processing:test-sink
16/06/15 15:03:17 INFO conf.FlumeConfiguration: Added sinks: test-sink Agent: cygnusagent
16/06/15 15:03:17 INFO conf.FlumeConfiguration: Post-validation flume configuration contains configuration for agents: [cygnusagent]
16/06/15 15:03:17 INFO node.AbstractConfigurationProvider: Creating channels
16/06/15 15:03:17 INFO channel.DefaultChannelFactory: Creating instance of channel test-channel type memory
16/06/15 15:03:17 INFO node.AbstractConfigurationProvider: Created channel test-channel
16/06/15 15:03:17 INFO source.DefaultSourceFactory: Creating instance of source http-source, type org.apache.flume.source.http.HTTPSource
16/06/15 15:03:17 ERROR handlers.NGSIRestHandler: Bad configuration ('default_service_path' must start with '/')
16/06/15 15:03:17 INFO handlers.NGSIRestHandler: Startup completed
16/06/15 15:03:17 ERROR channel.ChannelProcessor: Builder class not found. Exception follows.
java.lang.ClassNotFoundException: com.telefonica.iot.cygnus.interceptors.GroupingInterceptor$Builder
    at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:195)
    at org.apache.flume.interceptor.InterceptorBuilderFactory.newInstance(InterceptorBuilderFactory.java:46)
    at org.apache.flume.channel.ChannelProcessor.configureInterceptors(ChannelProcessor.java:109)
    at org.apache.flume.channel.ChannelProcessor.configure(ChannelProcessor.java:80)
    at org.apache.flume.conf.Configurables.configure(Configurables.java:41)
    at org.apache.flume.node.AbstractConfigurationProvider.loadSources(AbstractConfigurationProvider.java:353)
    at org.apache.flume.node.AbstractConfigurationProvider.getConfiguration(AbstractConfigurationProvider.java:102)
    at org.apache.flume.node.PollingPropertiesFileConfigurationProvider$FileWatcherRunnable.run(PollingPropertiesFileConfigurationProvider.java:140)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
    at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:304)
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:178)
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    at java.lang.Thread.run(Thread.java:745)
16/06/15 15:03:17 ERROR node.AbstractConfigurationProvider: Source http-source has been removed due to an error during configuration
org.apache.flume.FlumeException: Interceptor.Builder not found.
    at org.apache.flume.channel.ChannelProcessor.configureInterceptors(ChannelProcessor.java:114)
    at org.apache.flume.channel.ChannelProcessor.configure(ChannelProcessor.java:80)
    at org.apache.flume.conf.Configurables.configure(Configurables.java:41)
    at org.apache.flume.node.AbstractConfigurationProvider.loadSources(AbstractConfigurationProvider.java:353)
    at org.apache.flume.node.AbstractConfigurationProvider.getConfiguration(AbstractConfigurationProvider.java:102)
    at org.apache.flume.node.PollingPropertiesFileConfigurationProvider$FileWatcherRunnable.run(PollingPropertiesFileConfigurationProvider.java:140)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
    at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:304)
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:178)
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.ClassNotFoundException: com.telefonica.iot.cygnus.interceptors.GroupingInterceptor$Builder
    at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:195)
    at org.apache.flume.interceptor.InterceptorBuilderFactory.newInstance(InterceptorBuilderFactory.java:46)
    at org.apache.flume.channel.ChannelProcessor.configureInterceptors(ChannelProcessor.java:109)
    ... 12 more

这是我的agent_test.conf

This is my agent_test.conf

$ cat APACHE_FLUME_HOME/conf/agent_test.conf 
cygnusagent.sources = http-source
cygnusagent.sinks = test-sink
cygnusagent.channels = test-channel

cygnusagent.sources.http-source.channels = test-channel
cygnusagent.sources.http-source.type = org.apache.flume.source.http.HTTPSource
cygnusagent.sources.http-source.port = 5050
cygnusagent.sources.http-source.handler = com.telefonica.iot.cygnus.handlers.NGSIRestHandler
cygnusagent.sources.http-source.handler.notification_target = /notify
cygnusagent.sources.http-source.handler.default_service = def_serv
cygnusagent.sources.http-source.handler.default_service_path = def_servpath
cygnusagent.sources.http-source.handler.events_ttl = 2
cygnusagent.sources.http-source.interceptors = ts gi
cygnusagent.sources.http-source.interceptors.ts.type = timestamp
cygnusagent.sources.http-source.interceptors.gi.type = com.telefonica.iot.cygnus.interceptors.GroupingInterceptor$Builder
cygnusagent.sources.http-source.interceptors.gi.grouping_rules_conf_file = /Applications/apache-flume-1.4.0-bin/conf/grouping_rules.conf

cygnusagent.channels.test-channel.type = memory
cygnusagent.channels.test-channel.capacity = 1000
cygnusagent.channels.test-channel.transactionCapacity = 100

cygnusagent.sinks.test-sink.channel = test-channel
cygnusagent.sinks.test-sink.type = com.telefonica.iot.cygnus.sinks.NGSITestSink
cygnusagent.sinks.test-sink.batch_size = 1
cygnusagent.sinks.test_sink.batch_timeout = 10

推荐答案

分组拦截器的错误已通过@frb在:

The error with the Grouping interceptor is solved as said by @frb in this question comments:

从Cygnus 1.0.0开始,您必须使用NGSIGroupingInterceptor而不是GroupingInterceptor

From Cygnus 1.0.0, you must use NGSIGroupingInterceptor instead of GroupingInterceptor

这篇关于天鹅座java.lang.ClassNotFoundException:com.telefonica.iot.cygnus.interceptors.GroupingInterceptor $ Builder的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-15 22:02