java.lang.ClassNotFoundException: org.yaml.snakeyaml.Yaml

9,093 views
Skip to first unread message

Guo-Guang Chiou

unread,
Jan 23, 2013, 1:48:14 AM1/23/13
to storm...@googlegroups.com
I downloaded storm-starter and unpacked it.
Then I issued command "mvn -f m2-pom.xml compile exec:java -Dexec.classpathScope=compile -Dexec.mainClass=storm.starter.WordCountTopology"
It failed and showed following error mesage.
what did I miss?
Please help.

Guo-Guang
===========================================================================================================
[INFO] Scanning for projects...
[INFO] Searching repository for plugin with prefix: 'exec'.
[WARNING] While downloading org.apache.commons:commons-io:1.3.2
  This artifact has been relocated to commons-io:commons-io:1.3.2.
  https://issues.sonatype.org/browse/MVNCENTRAL-244


[INFO] ------------------------------------------------------------------------
[INFO] Building storm-starter
[INFO]    task-segment: [compile, exec:java]
[INFO] ------------------------------------------------------------------------
[INFO] [resources:resources {execution: default-resources}]
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 4 resources
[INFO] [compiler:compile {execution: default-compile}]
[INFO] Compiling 2 source files to /home/chiou/Downloads/storm_examples/storm-starter/target/classes
[INFO] [clojure:compile {execution: compile}]
[INFO] Preparing exec:java
[INFO] No goals needed for project - skipping
[INFO] [exec:java {execution: default-cli}]
0    [storm.starter.WordCountTopology.main()] INFO  backtype.storm.zookeeper  - Starting inprocess zookeeper at port 2000 and dir /tmp/0ef75b18-87af-411e-9f05-4dc78cb9153c
[WARNING]
java.lang.reflect.InvocationTargetException
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.codehaus.mojo.exec.ExecJavaMojo$1.run(ExecJavaMojo.java:297)
    at java.lang.Thread.run(Thread.java:662)
Caused by: java.lang.NoClassDefFoundError: org/yaml/snakeyaml/Yaml
    at backtype.storm.utils.Utils.findAndReadConfigFile(Utils.java:109)
    at backtype.storm.utils.Utils.readDefaultConfig(Utils.java:126)
    at backtype.storm.utils.Utils.readStormConfig(Utils.java:146)
    at backtype.storm.config$read_storm_config.invoke(config.clj:66)
    at backtype.storm.testing$mk_local_storm_cluster.doInvoke(testing.clj:102)
    at clojure.lang.RestFn.invoke(RestFn.java:421)
    at backtype.storm.LocalCluster$_init.invoke(LocalCluster.clj:12)
    at backtype.storm.LocalCluster.<init>(Unknown Source)
    at storm.starter.WordCountTopology.main(WordCountTopology.java:82)
    ... 6 more
Caused by: java.lang.ClassNotFoundException: org.yaml.snakeyaml.Yaml
    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 java.lang.ClassLoader.loadClass(ClassLoader.java:247)
    ... 15 more


Enno Shioji

unread,
Jan 23, 2013, 8:37:10 PM1/23/13
to storm...@googlegroups.com
Try adding the following to your pom and let me know if it works..

  <dependency>
            <groupId>org.yaml</groupId>
            <artifactId>snakeyaml</artifactId>
            <version>1.6</version>
  </dependency>

Guo-Guang Chiou

unread,
Jan 23, 2013, 10:38:27 PM1/23/13
to storm...@googlegroups.com
Enno, thank you for your remind. It works now.

Guo-Guang
Reply all
Reply to author
Forward
0 new messages