You also need to include the scala-library.jar at a minimum. If you are
doing anything with ZooKeeper you will need the zookeeper and zkclient
jars. Likewise, if you want Snappy compression, you will need snappy-java
HTH
-David
On 7/24/13 4:06 PM, Nandigam, Sujitha wrote:
Hi,
I have one application based on netty client which gets messages from my
server. I want to send these messages to kafka. So I wrote my producer code
along with application by importing kafka jar into this project and made jar
file.
Now I ran application jar file to run producer class but got below exception..I
included kafka jar in classpath.
java.lang.NoClassDefFoundError: scala/ScalaObject
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClassCond(ClassLoader.java:631)
at java.lang.ClassLoader.defineClass(ClassLoader.java:615)
at
java.security.SecureClassLoader.defineClass(SecureClassLoader.java:14
1)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:283)
at java.net.URLClassLoader.access$000(URLClassLoader.java:58)
at java.net.URLClassLoader$1.run(URLClassLoader.java:197)
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)
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClassCond(ClassLoader.java:631)
at java.lang.ClassLoader.defineClass(ClassLoader.java:615)
at
java.security.SecureClassLoader.defineClass(SecureClassLoader.java:14
1)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:283)
at java.net.URLClassLoader.access$000(URLClassLoader.java:58)
at java.net.URLClassLoader$1.run(URLClassLoader.java:197)
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)
Thanks,
Sujitha
"This message (including any attachments) is intended only for the use of the
individual or entity to which it is addressed, and may contain information that is
non-public, proprietary, privileged, confidential and exempt from disclosure under
applicable law or may be constituted as attorney work product. If you are not the
intended recipient, you are hereby notified that any use, dissemination, distribution, or
copying of this communication is strictly prohibited. If you have received this message
in error, notify sender immediately and delete this message immediately."