You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@flume.apache.org by khadar basha <kh...@gmail.com> on 2012/07/27 07:48:39 UTC

Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/flume/node/Application

Hi,

I am using flume1.2 version.  Having the following configuration.



agent1Test1.sources = seqGenSrc
agent1Test1.channels = memoryChannel
agent1Test1.sinks = loggerSink

# For each one of the sources, the type is defined
agent1Test1.sources.seqGenSrc.type = exec
agent1Test1.sources.seqGenSrc.command= tail -f /tomcat/logs/catalina.out
agent1Test1.sources.seqGenSrc.interceptors = hostInterceptor
agent1Test1.sources.seqGenSrc.interceptors.hostInterceptor.type =
org.apache.flume.interceptor.HostInterceptor$Builder
agent1Test1.sources.seqGenSrc.interceptors.hostInterceptor.hostHeader =
myhostname

# The channel can be defined as follows.
agent1Test1.sources.seqGenSrc.channels = memoryChannel

# Each sink's type must be defined
agent1Test1.sinks.loggerSink.type = hdfs
agent1Test1.sinks.loggerSink.hdfs.path = hdfs://host:8020/data/%{host}/Logs

agent1Test1.sinks.loggerSink.hdfs.fileType = DataStream

#Specify the channel the sink should use
agent1Test1.sinks.loggerSink.channel = memoryChannel

# Each channel's type is defined.
agent1Test1.channels.memoryChannel.type = memory

# Other config values specific to each type of channel(sink or source)
# can be defined as well
# In this case, it specifies the capacity of the memory channel
agent1Test1.channels.memoryChannel.capacity = 1000


Gettting the following exception:


*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)*
*Could not find the main class: org.apache.flume.node.Application.  Program
will exit.*
-- 
Thanks,
Khadar

Re: Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/flume/node/Application

Posted by khadar basha <kh...@gmail.com>.
Hi Mark,

Some of the jars are missing in lib. now i am able to run the agent. I am
able to get time stamp buckets and host buckets get created in HDFS.

Config:
================
agent1Test1.sources.seqGenSrc.interceptors = hostInterceptor
agent1Test1.sources.seqGenSrc.interceptors.hostInterceptor.type =
org.apache.flume.interceptor.HostInterceptor$Builder
agent1Test1.sources.seqGenSrc.interceptors.hostInterceptor.hostHeader = *
host *

agent1Test1.sinks.loggerSink.hdfs.path = hdfs://host:8020/data/%Y/%m/%d/%{*
host*}/Logs

================

Thanks,
Khadar

On Fri, Jul 27, 2012 at 1:20 PM, Stern, Mark <ms...@iskoot.com> wrote:

> I am not sure if this is the cause of your problem, but you seem to have a
> mismatch for the hostname header key
> between your interceptor (myhostname) and your sink (host).
> ________________________________________
> From: khadar basha [khadarskb@gmail.com]
> Sent: Friday, July 27, 2012 8:48 AM
> To: user@flume.apache.org
> Subject: Exception in thread "main" java.lang.NoClassDefFoundError:
> org/apache/flume/node/Application
>
> Hi,
>
> I am using flume1.2 version.  Having the following configuration.
>
>
>
> agent1Test1.sources = seqGenSrc
> agent1Test1.channels = memoryChannel
> agent1Test1.sinks = loggerSink
>
> # For each one of the sources, the type is defined
> agent1Test1.sources.seqGenSrc.type = exec
> agent1Test1.sources.seqGenSrc.command= tail -f /tomcat/logs/catalina.out
> agent1Test1.sources.seqGenSrc.interceptors = hostInterceptor
> agent1Test1.sources.seqGenSrc.interceptors.hostInterceptor.type =
> org.apache.flume.interceptor.HostInterceptor$Builder
> agent1Test1.sources.seqGenSrc.interceptors.hostInterceptor.hostHeader =
> myhostname
>
> # The channel can be defined as follows.
> agent1Test1.sources.seqGenSrc.channels = memoryChannel
>
> # Each sink's type must be defined
> agent1Test1.sinks.loggerSink.type = hdfs
> agent1Test1.sinks.loggerSink.hdfs.path = hdfs://host:8020/data/%{host}/Logs
>
> agent1Test1.sinks.loggerSink.hdfs.fileType = DataStream
>
> #Specify the channel the sink should use
> agent1Test1.sinks.loggerSink.channel = memoryChannel
>
> # Each channel's type is defined.
> agent1Test1.channels.memoryChannel.type = memory
>
> # Other config values specific to each type of channel(sink or source)
> # can be defined as well
> # In this case, it specifies the capacity of the memory channel
> agent1Test1.channels.memoryChannel.capacity = 1000
>
>
> Gettting the following exception:
>
>
> 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)
> Could not find the main class: org.apache.flume.node.Application.  Program
> will exit.
> --
> Thanks,
> Khadar
>
>


-- 
Thanks,
Khadar

Re: Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/flume/node/Application

Posted by khadar basha <kh...@gmail.com>.
you are right. It is working fine now.


On Fri, Jul 27, 2012 at 6:37 PM, David Capwell <dc...@gmail.com> wrote:

> Which tarball did you download the 1 with with bin in the name? If you
> download the tar that does not have bin in the name then this is the source
> so scripts don't work
> On Jul 27, 2012 12:50 AM, "Stern, Mark" <ms...@iskoot.com> wrote:
>
>> I am not sure if this is the cause of your problem, but you seem to have
>> a mismatch for the hostname header key
>> between your interceptor (myhostname) and your sink (host).
>> ________________________________________
>> From: khadar basha [khadarskb@gmail.com]
>> Sent: Friday, July 27, 2012 8:48 AM
>> To: user@flume.apache.org
>> Subject: Exception in thread "main" java.lang.NoClassDefFoundError:
>> org/apache/flume/node/Application
>>
>> Hi,
>>
>> I am using flume1.2 version.  Having the following configuration.
>>
>>
>>
>> agent1Test1.sources = seqGenSrc
>> agent1Test1.channels = memoryChannel
>> agent1Test1.sinks = loggerSink
>>
>> # For each one of the sources, the type is defined
>> agent1Test1.sources.seqGenSrc.type = exec
>> agent1Test1.sources.seqGenSrc.command= tail -f /tomcat/logs/catalina.out
>> agent1Test1.sources.seqGenSrc.interceptors = hostInterceptor
>> agent1Test1.sources.seqGenSrc.interceptors.hostInterceptor.type =
>> org.apache.flume.interceptor.HostInterceptor$Builder
>> agent1Test1.sources.seqGenSrc.interceptors.hostInterceptor.hostHeader =
>> myhostname
>>
>> # The channel can be defined as follows.
>> agent1Test1.sources.seqGenSrc.channels = memoryChannel
>>
>> # Each sink's type must be defined
>> agent1Test1.sinks.loggerSink.type = hdfs
>> agent1Test1.sinks.loggerSink.hdfs.path =
>> hdfs://host:8020/data/%{host}/Logs
>>
>> agent1Test1.sinks.loggerSink.hdfs.fileType = DataStream
>>
>> #Specify the channel the sink should use
>> agent1Test1.sinks.loggerSink.channel = memoryChannel
>>
>> # Each channel's type is defined.
>> agent1Test1.channels.memoryChannel.type = memory
>>
>> # Other config values specific to each type of channel(sink or source)
>> # can be defined as well
>> # In this case, it specifies the capacity of the memory channel
>> agent1Test1.channels.memoryChannel.capacity = 1000
>>
>>
>> Gettting the following exception:
>>
>>
>> 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)
>> Could not find the main class: org.apache.flume.node.Application.
>>  Program will exit.
>> --
>> Thanks,
>> Khadar
>>
>>


-- 
Thanks,
Khadar

RE: Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/flume/node/Application

Posted by David Capwell <dc...@gmail.com>.
Which tarball did you download the 1 with with bin in the name? If you
download the tar that does not have bin in the name then this is the source
so scripts don't work
On Jul 27, 2012 12:50 AM, "Stern, Mark" <ms...@iskoot.com> wrote:

> I am not sure if this is the cause of your problem, but you seem to have a
> mismatch for the hostname header key
> between your interceptor (myhostname) and your sink (host).
> ________________________________________
> From: khadar basha [khadarskb@gmail.com]
> Sent: Friday, July 27, 2012 8:48 AM
> To: user@flume.apache.org
> Subject: Exception in thread "main" java.lang.NoClassDefFoundError:
> org/apache/flume/node/Application
>
> Hi,
>
> I am using flume1.2 version.  Having the following configuration.
>
>
>
> agent1Test1.sources = seqGenSrc
> agent1Test1.channels = memoryChannel
> agent1Test1.sinks = loggerSink
>
> # For each one of the sources, the type is defined
> agent1Test1.sources.seqGenSrc.type = exec
> agent1Test1.sources.seqGenSrc.command= tail -f /tomcat/logs/catalina.out
> agent1Test1.sources.seqGenSrc.interceptors = hostInterceptor
> agent1Test1.sources.seqGenSrc.interceptors.hostInterceptor.type =
> org.apache.flume.interceptor.HostInterceptor$Builder
> agent1Test1.sources.seqGenSrc.interceptors.hostInterceptor.hostHeader =
> myhostname
>
> # The channel can be defined as follows.
> agent1Test1.sources.seqGenSrc.channels = memoryChannel
>
> # Each sink's type must be defined
> agent1Test1.sinks.loggerSink.type = hdfs
> agent1Test1.sinks.loggerSink.hdfs.path = hdfs://host:8020/data/%{host}/Logs
>
> agent1Test1.sinks.loggerSink.hdfs.fileType = DataStream
>
> #Specify the channel the sink should use
> agent1Test1.sinks.loggerSink.channel = memoryChannel
>
> # Each channel's type is defined.
> agent1Test1.channels.memoryChannel.type = memory
>
> # Other config values specific to each type of channel(sink or source)
> # can be defined as well
> # In this case, it specifies the capacity of the memory channel
> agent1Test1.channels.memoryChannel.capacity = 1000
>
>
> Gettting the following exception:
>
>
> 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)
> Could not find the main class: org.apache.flume.node.Application.  Program
> will exit.
> --
> Thanks,
> Khadar
>
>

RE: Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/flume/node/Application

Posted by "Stern, Mark" <ms...@iskoot.com>.
I am not sure if this is the cause of your problem, but you seem to have a mismatch for the hostname header key
between your interceptor (myhostname) and your sink (host).
________________________________________
From: khadar basha [khadarskb@gmail.com]
Sent: Friday, July 27, 2012 8:48 AM
To: user@flume.apache.org
Subject: Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/flume/node/Application

Hi,

I am using flume1.2 version.  Having the following configuration.



agent1Test1.sources = seqGenSrc
agent1Test1.channels = memoryChannel
agent1Test1.sinks = loggerSink

# For each one of the sources, the type is defined
agent1Test1.sources.seqGenSrc.type = exec
agent1Test1.sources.seqGenSrc.command= tail -f /tomcat/logs/catalina.out
agent1Test1.sources.seqGenSrc.interceptors = hostInterceptor
agent1Test1.sources.seqGenSrc.interceptors.hostInterceptor.type = org.apache.flume.interceptor.HostInterceptor$Builder
agent1Test1.sources.seqGenSrc.interceptors.hostInterceptor.hostHeader = myhostname

# The channel can be defined as follows.
agent1Test1.sources.seqGenSrc.channels = memoryChannel

# Each sink's type must be defined
agent1Test1.sinks.loggerSink.type = hdfs
agent1Test1.sinks.loggerSink.hdfs.path = hdfs://host:8020/data/%{host}/Logs

agent1Test1.sinks.loggerSink.hdfs.fileType = DataStream

#Specify the channel the sink should use
agent1Test1.sinks.loggerSink.channel = memoryChannel

# Each channel's type is defined.
agent1Test1.channels.memoryChannel.type = memory

# Other config values specific to each type of channel(sink or source)
# can be defined as well
# In this case, it specifies the capacity of the memory channel
agent1Test1.channels.memoryChannel.capacity = 1000


Gettting the following exception:


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)
Could not find the main class: org.apache.flume.node.Application.  Program will exit.
--
Thanks,
Khadar