storm-kafka-0.8-plus-test icon indicating copy to clipboard operation
storm-kafka-0.8-plus-test copied to clipboard

adding required packages to avoid NoClassDefFoundError

Open strat0sphere opened this issue 10 years ago • 5 comments

strat0sphere avatar Dec 23 '14 08:12 strat0sphere

Hi, could you please explain when you get the log4 related errors?

Thanks

wurstmeister avatar Jan 02 '15 16:01 wurstmeister

Hi, You will get these errors if you compile with the cluster profile (mvn clean package -P cluster) Unfortunately my cluster is down now because of a university network outage the past 4 days and I cannot send you the stack trace, but I guess you will be able to reproduce the problem. Otherwise I can repeat the steps and send you the trace soon...

strat0sphere avatar Jan 05 '15 20:01 strat0sphere

Could you please try with the latest version when you get a chance? I can't reproduce the issue.

Thanks

wurstmeister avatar Jan 06 '15 22:01 wurstmeister

I am sorry for the vague comment - Its been a time since I was testing this and I cannot remember what exactly was wrong. Sure I will reproduce the error and let you know as long as I get my cluster running. I cannot really test your last version though because I am using the 0.9.2-incubating version on top of Mesos. Last time I tried 0.9.3 on Mesos I was getting errors...

strat0sphere avatar Jan 08 '15 00:01 strat0sphere

OK so the error is caused because you have the org.slf4j dependency with provided scope for the cluster profile. If you comment this then its fine. Leaving it as is makes sense depending on the cluster setup and you could assume that someone will provide slf4j at runtime. I wasn't so I was getting the error as you can see bellow: And btw sorry I haven't paid much attention to your pom - too much after midnight setups lately! :-/

java -cp /root/testing/storm-kafka-0.8-plus-test/target/storm-kafka-0.8-plus-test-0.2.0-SNAPSHOT-jar-with-dependencies.jar storm.kafka.tools.StormProducer $ACTIVE_MASTER_PRIVATE:9092

Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/log4j/Logger at kafka.utils.Logging$class.logger(Logging.scala:24) at kafka.utils.VerifiableProperties.logger(VerifiableProperties.scala:24) at kafka.utils.Logging$class.info(Logging.scala:67) at kafka.utils.VerifiableProperties.info(VerifiableProperties.scala:24) at kafka.utils.VerifiableProperties.verify(VerifiableProperties.scala:197) at kafka.producer.ProducerConfig.(ProducerConfig.scala:57) at storm.kafka.tools.StormProducer.main(StormProducer.java:25) Caused by: java.lang.ClassNotFoundException: org.apache.log4j.Logger 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)

strat0sphere avatar Jan 08 '15 05:01 strat0sphere