storm-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "唐思成" <jadetan...@qq.com>
Subject Re: java.lang.ClassNotFoundException: storm.kafka.BrokerHosts
Date Tue, 01 Jul 2014 08:09:28 GMT
I think you should change the scope of storm-kafka, the storm server only provides the storm-core.

<dependency>
    <groupId>org.apache.storm</groupId>
    <artifactId>storm-kafka</artifactId>
    <version>0.9.2-incubating</version>
    <scope>compile</scope>
</dependency>

2014-07-01 



唐思成 



发件人: Josh J 
发送时间: 2014-07-01  16:06:26 
收件人: user 
抄送: 
主题: java.lang.ClassNotFoundException: storm.kafka.BrokerHosts 
 
Hi,

I'm using the 0.9.2-incubating which includes KafkaSpout.


I create a uber jar which includes the dependencies using the assembly plugin.


Storm is also included as provided scope


    <dependency>
      <groupId>org.apache.storm</groupId>
      <artifactId>storm-core</artifactId>
      <version>0.9.2-incubating</version>
        <scope>provided</scope>
    </dependency>
<dependency>
    <groupId>org.apache.storm</groupId>
    <artifactId>storm-kafka</artifactId>
    <version>0.9.2-incubating</version>
    <scope>provided</scope>
</dependency>



Though I'm receiving the following error

Exception in thread "main" java.lang.NoClassDefFoundError: storm/kafka/BrokerHosts
    at java.lang.Class.getDeclaredMethods0(Native Method)
    at java.lang.Class.privateGetDeclaredMethods(Class.java:2531)
    at java.lang.Class.getMethod0(Class.java:2774)
    at java.lang.Class.getMethod(Class.java:1663)
    at sun.launcher.LauncherHelper.getMainMethod(LauncherHelper.java:494)
    at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:486)
Caused by: java.lang.ClassNotFoundException: storm.kafka.BrokerHosts
    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)
    ... 6 more




Any ideas?

Thanks,
Josh
Mime
View raw message