You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@kafka.apache.org by David Montgomery <da...@gmail.com> on 2014/03/08 07:48:38 UTC

Caused by: java.lang.ClassNotFoundException: scala.ScalaObject

Hi,

I need to solve the below problem  I am using druid realtime as a consumer
for druid and they have zero issue on what is going on.  Whyh would kafka
thow such an error?  When I produce and consume from the python lib called
brod..I have no issues.  Is the below an kafka issues or consumer issue?

using kafka 7.2....

the consumer that I am using throws the below error.

This is how I install and start kafka

tar -xzf kafka-0.7.2-incubating-src.tgz
cd kafka-0.7.2-incubating-src
./sbt update
./sbt package

/var/lib/kafka-0.7.2-incubating-src/bin/kafka-server-start.sh
/var/lib/kafka-0.7.2-incubating-src/config/server.properties


Here is the locations of scala libs

find / -name *scala*
/var/lib/kafka-0.7.2-incubating-src/lib/scala-library.jar
/var/lib/kafka-0.7.2-incubating-src/scala-library.jar
/var/lib/kafka-0.7.2-incubating-src/project/boot/scala-2.7.7/lib/scala-library.jar
/var/lib/kafka-0.7.2-incubating-src/project/boot/scala-2.8.0/lib/scala-library.jar





2014-03-08 06:29:30,606 INFO [main-SendThread(128.199.238.103:2181)]
org.apache.zookeeper.ClientCnxn - Opening socket connection to server
128.199.238.103/128.199.238.103:2181. Will not attempt to authenticate
using SASL (unknown error)
2014-03-08 06:29:30,646 INFO [main]
com.metamx.common.lifecycle.Lifecycle$AnnotationBasedHandler - Invoking
start method[public void io.druid.segment.realtime.RealtimeManager.start()
throws java.io.IOException] on
object[io.druid.segment.realtime.RealtimeManager@3ce0d280].
2014-03-08 06:29:30,647 INFO [main]
io.druid.segment.realtime.RealtimeManager - Calling the FireDepartment and
getting a Firehose.
2014-03-08 06:29:30,649 ERROR [main] io.druid.cli.CliBroker - Error when
starting up.  Failing.
java.lang.reflect.InvocationTargetException
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at
com.metamx.common.lifecycle.Lifecycle$AnnotationBasedHandler.start(Lifecycle.java:331)
    at com.metamx.common.lifecycle.Lifecycle.start(Lifecycle.java:250)
    at io.druid.guice.LifecycleModule$2.start(LifecycleModule.java:136)
    at io.druid.cli.GuiceRunnable.initLifecycle(GuiceRunnable.java:72)
    at io.druid.cli.ServerRunnable.run(ServerRunnable.java:40)
    at io.druid.cli.Main.main(Main.java:91)
Caused by: java.lang.NoClassDefFoundError: scala/ScalaObject
    at java.lang.ClassLoader.defineClass1(Native Method)
    at java.lang.ClassLoader.defineClass(ClassLoader.java:800)
    at
java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
    at java.net.URLClassLoader.defineClass(URLClassLoader.java:449)
    at java.net.URLClassLoader.access$100(URLClassLoader.java:71)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
    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 java.lang.ClassLoader.loadClass(ClassLoader.java:358)
    at
io.druid.firehose.kafka.KafkaSevenFirehoseFactory.connect(KafkaSevenFirehoseFactory.java:89)
    at
io.druid.segment.realtime.FireDepartment.connect(FireDepartment.java:90)
    at
io.druid.segment.realtime.RealtimeManager$FireChief.init(RealtimeManager.java:150)
    at
io.druid.segment.realtime.RealtimeManager.start(RealtimeManager.java:87)
    ... 10 more
Caused by: java.lang.ClassNotFoundException: scala.ScalaObject
    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 java.lang.ClassLoader.loadClass(ClassLoader.java:358)
    ... 25 more

Re: Caused by: java.lang.ClassNotFoundException: scala.ScalaObject

Posted by Neha Narkhede <ne...@gmail.com>.
If you start kafka from the downloaded 0.7.2 release, I don't think you
will see these errors. These are coming from zookeeper and Druid. The error
complains that the scala-library.jar is not on the classpath.

Thanks,
Neha


On Fri, Mar 7, 2014 at 10:48 PM, David Montgomery <davidmontgomery@gmail.com
> wrote:

> Hi,
>
> I need to solve the below problem  I am using druid realtime as a consumer
> for druid and they have zero issue on what is going on.  Whyh would kafka
> thow such an error?  When I produce and consume from the python lib called
> brod..I have no issues.  Is the below an kafka issues or consumer issue?
>
> using kafka 7.2....
>
> the consumer that I am using throws the below error.
>
> This is how I install and start kafka
>
> tar -xzf kafka-0.7.2-incubating-src.tgz
> cd kafka-0.7.2-incubating-src
> ./sbt update
> ./sbt package
>
> /var/lib/kafka-0.7.2-incubating-src/bin/kafka-server-start.sh
> /var/lib/kafka-0.7.2-incubating-src/config/server.properties
>
>
> Here is the locations of scala libs
>
> find / -name *scala*
> /var/lib/kafka-0.7.2-incubating-src/lib/scala-library.jar
> /var/lib/kafka-0.7.2-incubating-src/scala-library.jar
>
> /var/lib/kafka-0.7.2-incubating-src/project/boot/scala-2.7.7/lib/scala-library.jar
>
> /var/lib/kafka-0.7.2-incubating-src/project/boot/scala-2.8.0/lib/scala-library.jar
>
>
>
>
>
> 2014-03-08 06:29:30,606 INFO [main-SendThread(128.199.238.103:2181)]
> org.apache.zookeeper.ClientCnxn - Opening socket connection to server
> 128.199.238.103/128.199.238.103:2181. Will not attempt to authenticate
> using SASL (unknown error)
> 2014-03-08 06:29:30,646 INFO [main]
> com.metamx.common.lifecycle.Lifecycle$AnnotationBasedHandler - Invoking
> start method[public void io.druid.segment.realtime.RealtimeManager.start()
> throws java.io.IOException] on
> object[io.druid.segment.realtime.RealtimeManager@3ce0d280].
> 2014-03-08 06:29:30,647 INFO [main]
> io.druid.segment.realtime.RealtimeManager - Calling the FireDepartment and
> getting a Firehose.
> 2014-03-08 06:29:30,649 ERROR [main] io.druid.cli.CliBroker - Error when
> starting up.  Failing.
> java.lang.reflect.InvocationTargetException
>     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>     at
>
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
>     at
>
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>     at java.lang.reflect.Method.invoke(Method.java:606)
>     at
>
> com.metamx.common.lifecycle.Lifecycle$AnnotationBasedHandler.start(Lifecycle.java:331)
>     at com.metamx.common.lifecycle.Lifecycle.start(Lifecycle.java:250)
>     at io.druid.guice.LifecycleModule$2.start(LifecycleModule.java:136)
>     at io.druid.cli.GuiceRunnable.initLifecycle(GuiceRunnable.java:72)
>     at io.druid.cli.ServerRunnable.run(ServerRunnable.java:40)
>     at io.druid.cli.Main.main(Main.java:91)
> Caused by: java.lang.NoClassDefFoundError: scala/ScalaObject
>     at java.lang.ClassLoader.defineClass1(Native Method)
>     at java.lang.ClassLoader.defineClass(ClassLoader.java:800)
>     at
> java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
>     at java.net.URLClassLoader.defineClass(URLClassLoader.java:449)
>     at java.net.URLClassLoader.access$100(URLClassLoader.java:71)
>     at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
>     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 java.lang.ClassLoader.loadClass(ClassLoader.java:358)
>     at
>
> io.druid.firehose.kafka.KafkaSevenFirehoseFactory.connect(KafkaSevenFirehoseFactory.java:89)
>     at
> io.druid.segment.realtime.FireDepartment.connect(FireDepartment.java:90)
>     at
>
> io.druid.segment.realtime.RealtimeManager$FireChief.init(RealtimeManager.java:150)
>     at
> io.druid.segment.realtime.RealtimeManager.start(RealtimeManager.java:87)
>     ... 10 more
> Caused by: java.lang.ClassNotFoundException: scala.ScalaObject
>     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 java.lang.ClassLoader.loadClass(ClassLoader.java:358)
>     ... 25 more
>