gpt4 book ai didi

java - 水槽配置java异常

转载 作者:可可西里 更新时间:2023-11-01 14:58:52 26 4
gpt4 key购买 nike

我在运行 flume 代理时遇到问题(来自 apache flume 站点的基本示例)。我正在运行的命令是


./bin/flume-ng agent --conf conf --conf-file test.conf --name a1 -Dflume.root.logger=INFO,console

我的 test.conf 文件看起来像

# example.conf: A single-node Flume configuration

# Name the components on this agent
a1.sources = r1
a1.sinks = k1
a1.channels = c1

# Describe/configure the source
a1.sources.r1.type = netcat
a1.sources.r1.bind = localhost
a1.sources.r1.port = 44444

# Describe the sink
a1.sinks.k1.type = logger

# Use a channel which buffers events in memory
a1.channels.c1.type = memory
a1.channels.c1.capacity = 1000
a1.channels.c1.transactionCapacity = 100

# Bind the source and sink to the channel
a1.sources.r1.channels = c1
a1.sinks.k1.channel = c1

我的环境变量在这里:

TERM_PROGRAM=Apple_Terminal
SHELL=/bin/bash
TERM=xterm-256color
TMPDIR=/var/folders/qf/lnn77ppn1mv51vg67hlljpqw0000gn/T/
Apple_PubSub_Socket_Render=/tmp/launch-h7JcOn/Render
TERM_PROGRAM_VERSION=309
OLDPWD=/Users/wolf/Downloads/apache-flume-1.5.0-src/conf
TERM_SESSION_ID=58D255EF-6DF2-4887-8598-844F2BBF0370
USER=wolf
COMMAND_MODE=unix2003
SSH_AUTH_SOCK=/tmp/launch-OdJEdz/Listeners
Apple_Ubiquity_Message=/tmp/launch-x6Ws50/Apple_Ubiquity_Message
__CF_USER_TEXT_ENCODING=0x1F5:0:0
MAVEN_OPTS=-Xms512m -Xmx1024m -XX:PermSize=256m -XX:MaxPermSize=512m
PATH=/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/git/bin
PWD=/Users/wolf/Downloads/apache-flume-1.5.0-src
JAVA_HOME=/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home
LANG=en_US.UTF-8

我得到的错误是

Info: Sourcing environment configuration script /Users/wolf/Downloads/apache-flume-1.5.0-   src/conf/flume-env.sh
Info: Including Hadoop libraries found via (/usr/local/bin/hadoop) for HDFS access
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/flume/tools/GetJavaProperty
Caused by: java.lang.ClassNotFoundException: org.apache.flume.tools.GetJavaProperty
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)

-Djava.library.path= org.apache.flume.node.Application --conf-file test.conf --name a1
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/flume/node/Application
Caused by: java.lang.ClassNotFoundException: org.apache.flume.node.Application
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)

有人知道我可能遗漏了什么吗?

最佳答案

那太壮观了。

我要声明一个显而易见的事实:Java 找不到 Flume 库。

我正在寻找 flume-ng 脚本,看看为什么它没有获得正确的类路径。

关于java - 水槽配置java异常,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23923490/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com