puniverse / pulsar

Fibers, Channels and Actors for Clojure
http://docs.paralleluniverse.co/pulsar/
Other
911 stars 53 forks source link

ClassNotFoundException: co.paralleluniverse.fibers.SuspendExecution #20

Closed dsabanin closed 9 years ago

dsabanin commented 10 years ago

I created an empty leiningen project with pulsar, but any attempt to load the REPL or load the environment in any way (there's no code except for lein boilerplate), result in the following exception:

$ lein repl
Exception in thread "main" java.lang.NoClassDefFoundError: co/paralleluniverse/fibers/SuspendExecution
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:186)
    at clojure.core_proxy__init.load(Unknown Source)
    at clojure.core_proxy__init.<clinit>(Unknown Source)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:264)
    at clojure.lang.RT.loadClassForName(RT.java:2098)
    at clojure.lang.RT.load(RT.java:430)
    at clojure.lang.RT.load(RT.java:411)
    at clojure.core$load$fn__5018.invoke(core.clj:5530)
    at clojure.core$load.doInvoke(core.clj:5529)
    at clojure.lang.RestFn.invoke(RestFn.java:408)
    at clojure.core__init.load(Unknown Source)
    at clojure.core__init.<clinit>(Unknown Source)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:264)
    at clojure.lang.RT.loadClassForName(RT.java:2098)
    at clojure.lang.RT.load(RT.java:430)
    at clojure.lang.RT.load(RT.java:411)
    at clojure.lang.RT.doInit(RT.java:447)
    at clojure.lang.RT.<clinit>(RT.java:329)
    at clojure.main.<clinit>(main.java:20)
Caused by: java.lang.ClassNotFoundException: co.paralleluniverse.fibers.SuspendExecution
    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:423)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
    ... 22 more

Here's more info about my system. The OS is OS X 10.9.2.

$ lein version
Leiningen 2.3.4 on Java 1.7.0_09 Java HotSpot(TM) 64-Bit Server VM

$ java -version
java version "1.7.0_09"
Java(TM) SE Runtime Environment (build 1.7.0_09-b05)
Java HotSpot(TM) 64-Bit Server VM (build 23.5-b02, mixed mode)

$ cat project.clj
(defproject pulsar-text "0.1.0-SNAPSHOT"
  :description "FIXME: write description"
  :url "http://example.com/FIXME"
  :license {:name "Eclipse Public License"
                :url "http://www.eclipse.org/legal/epl-v10.html"}
  :dependencies [[org.clojure/clojure "1.5.1"]
                           [co.paralleluniverse/pulsar "0.5.0"]]
  :java-agents [[co.paralleluniverse/quasar-core "0.5.0"]])

I tried removing ~/.m2 dir, it didn't help. Tried reproducing it on a Linux system with OpenJDK, but same sample project worked fine. Here's some info about the Linux system (plain Ubuntu VM on DigitalOcean):

$ lein version
Leiningen 2.3.4 on Java 1.7.0_55 OpenJDK 64-Bit Server VM

$ uname -a
Linux bs-bench-ny 3.8.0-29-generic #42~precise1-Ubuntu SMP Wed Aug 14 16:19:23 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux

Any ideas?

Thanks!

pron commented 10 years ago

Hmm. I can't reproduce it. Can you try running lein classpath and make sure quasar-0.5.0.jar is there?

dsabanin commented 10 years ago

Can't see quasar-0.5.0.jar, but see quasar-core-0.5.0.jar. Classpath looks like this (full classpath and project.clj below):

/tmp/a$ lein classpath |tr ':' '\n'  | grep quasar
/Users/dsabanin/.m2/repository/co/paralleluniverse/quasar-core/0.5.0/quasar-core-0.5.0.jar
/Users/dsabanin/.m2/repository/co/paralleluniverse/quasar-actors/0.5.0/quasar-actors-0.5.0.jar

/tmp/a$ cat project.clj
(defproject a "0.1.0-SNAPSHOT"
  :description "FIXME: write description"
  :url "http://example.com/FIXME"
  :license {:name "Eclipse Public License"
            :url "http://www.eclipse.org/legal/epl-v10.html"}
  :dependencies [[org.clojure/clojure "1.5.1"]
         [co.paralleluniverse/pulsar "0.5.0"]]
  :java-agents [[co.paralleluniverse/quasar-core "0.5.0"]])

/tmp/a$ lein classpath |tr ':' '\n' 
/private/tmp/a/test
/private/tmp/a/src
/private/tmp/a/dev-resources
/private/tmp/a/resources
/private/tmp/a/target/classes
/Users/dsabanin/.m2/repository/com/codahale/metrics/metrics-core/3.0.2/metrics-core-3.0.2.jar
/Users/dsabanin/.m2/repository/org/clojure/core.match/0.2.1/core.match-0.2.1.jar
/Users/dsabanin/.m2/repository/com/google/guava/guava/16.0.1/guava-16.0.1.jar
/Users/dsabanin/.m2/repository/org/slf4j/slf4j-api/1.7.6/slf4j-api-1.7.6.jar
/Users/dsabanin/.m2/repository/co/paralleluniverse/quasar-core/0.5.0/quasar-core-0.5.0.jar
/Users/dsabanin/.m2/repository/org/apache/ant/ant-launcher/1.9.3/ant-launcher-1.9.3.jar
/Users/dsabanin/.m2/repository/org/clojure/math.combinatorics/0.0.2/math.combinatorics-0.0.2.jar
/Users/dsabanin/.m2/repository/org/flatland/useful/0.9.0/useful-0.9.0.jar
/Users/dsabanin/.m2/repository/co/paralleluniverse/quasar-actors/0.5.0/quasar-actors-0.5.0.jar
/Users/dsabanin/.m2/repository/com/lmax/disruptor/3.2.1/disruptor-3.2.1.jar
/Users/dsabanin/.m2/repository/de/javakaffee/kryo-serializers/0.26/kryo-serializers-0.26.jar
/Users/dsabanin/.m2/repository/org/objenesis/objenesis/2.1/objenesis-2.1.jar
/Users/dsabanin/.m2/repository/org/clojure/core.contracts/0.0.4/core.contracts-0.0.4.jar
/Users/dsabanin/.m2/repository/lamina/lamina/0.5.0/lamina-0.5.0.jar
/Users/dsabanin/.m2/repository/org/ow2/asm/asm-analysis/5.0.1/asm-analysis-5.0.1.jar
/Users/dsabanin/.m2/repository/org/apache/logging/log4j/log4j-core/2.0-rc1/log4j-core-2.0-rc1.jar
/Users/dsabanin/.m2/repository/org/apache/logging/log4j/log4j-slf4j-impl/2.0-rc1/log4j-slf4j-impl-2.0-rc1.jar
/Users/dsabanin/.m2/repository/org/clojure/tools.macro/0.1.1/tools.macro-0.1.1.jar
/Users/dsabanin/.m2/repository/com/esotericsoftware/kryo/kryo/2.23.0/kryo-2.23.0.jar
/Users/dsabanin/.m2/repository/org/clojure/core.typed/0.2.39/core.typed-0.2.39.jar
/Users/dsabanin/.m2/repository/org/clojure/tools.nrepl/0.2.3/tools.nrepl-0.2.3.jar
/Users/dsabanin/.m2/repository/com/esotericsoftware/minlog/minlog/1.2/minlog-1.2.jar
/Users/dsabanin/.m2/repository/org/clojure/data.priority-map/0.0.4/data.priority-map-0.0.4.jar
/Users/dsabanin/.m2/repository/org/clojure/tools.logging/0.2.4/tools.logging-0.2.4.jar
/Users/dsabanin/.m2/repository/potemkin/potemkin/0.3.2/potemkin-0.3.2.jar
/Users/dsabanin/.m2/repository/org/clojure/clojure/1.5.1/clojure-1.5.1.jar
/Users/dsabanin/.m2/repository/org/apache/logging/log4j/log4j-api/2.0-rc1/log4j-api-2.0-rc1.jar
/Users/dsabanin/.m2/repository/clojure-complete/clojure-complete/0.2.3/clojure-complete-0.2.3.jar
/Users/dsabanin/.m2/repository/org/clojure/core.cache/0.6.3/core.cache-0.6.3.jar
/Users/dsabanin/.m2/repository/org/clojure/jvm.tools.analyzer/0.6.1/jvm.tools.analyzer-0.6.1.jar
/Users/dsabanin/.m2/repository/org/ow2/asm/asm-tree/5.0.1/asm-tree-5.0.1.jar
/Users/dsabanin/.m2/repository/org/ow2/asm/asm-util/5.0.1/asm-util-5.0.1.jar
/Users/dsabanin/.m2/repository/org/ow2/asm/asm/5.0.1/asm-5.0.1.jar
/Users/dsabanin/.m2/repository/useful/useful/0.8.8/useful-0.8.8.jar
/Users/dsabanin/.m2/repository/org/clojure/tools.namespace/0.2.4/tools.namespace-0.2.4.jar
/Users/dsabanin/.m2/repository/org/ow2/asm/asm-commons/5.0.1/asm-commons-5.0.1.jar
/Users/dsabanin/.m2/repository/org/apache/ant/ant/1.9.3/ant-1.9.3.jar
/Users/dsabanin/.m2/repository/gloss/gloss/0.2.2/gloss-0.2.2.jar
/Users/dsabanin/.m2/repository/co/paralleluniverse/pulsar/0.5.0/pulsar-0.5.0.jar
pron commented 10 years ago

Sorry, I meant quasar-core-0.5.0.jar. Can you maybe do:

sum ~/.m2/repository/co/paralleluniverse/quasar-core/0.5.0/quasar-core-0.5.0.jar

I'm getting 31413 1099.

I know it's grasping at straws, but this has to be some configuration problem, and since the same project works on a different machine with seemingly the same configuration (Oracle vs. OpenJDK shouldn't make a difference)...

dsabanin commented 10 years ago

Unfortunately I'm getting the same result from sum:

$ sum ~/.m2/repository/co/paralleluniverse/quasar-core/0.5.0/quasar-core-0.5.0.jar
31413 1099 ~/.m2/repository/co/paralleluniverse/quasar-core/0.5.0/quasar-core-0.5.0.jar

I tried removing my ~/.m2 directory, it didn't help. All other leiningen-based projects build just fine.

I noticed that if I remove the :java-agents part from the project.clj, but move [co.paralleluniverse/quasar-core "0.5.0"] into the :dependencies, lein repl loads fine. I assume this means that the problem is in the agent part, the jar itself is loaded fine as a regular dependency.

I've tried adding this line to the project.clj, for the sake of investigation, but it didn't help – printed the same exceptions:

:jvm-opts ["-javaagent:~/.m2/repository/co/paralleluniverse/quasar-core/0.5.0/quasar-core-0.5.0.jar"]
pron commented 10 years ago

Can you maybe try upgrading your Java version (to a higher 1.7.0 update)? I can't explain why this would matter, but so far this is a glaring difference between the machine it fails on and your other machine (as well as ours).

pron commented 9 years ago

Closing due to inactivity.

darth10 commented 9 years ago

I'm getting the same above error with pulsar/quasar 0.7.2 and Java 1.7.0_21. The project I'm using is from @yogothos - https://github.com/yogthos/pulsar-example.

Cloning this project, and running lein repl throws the same error.

java.lang.NoClassDefFoundError: co/paralleluniverse/fibers/SuspendExecution, compiling:(still.clj:43:9)

Any advice would be great. :smile:

pron commented 9 years ago

Can you share your project file?

darth10 commented 9 years ago

It's the same one of the project mentioned in the link - https://github.com/yogthos/pulsar-example/blob/master/project.clj. Like I mentioned, I simply cloned the project and ran lein deps followed by lein repl.

Thanks for your speedy response!

darth10 commented 9 years ago

Resolved it! Everything seemed working fine after removing the [refactor-nrepl "1.2.0-SNAPSHOT"] dependency from my profiles.clj file.

Thanks again!

malchmih commented 9 years ago

Having the same issue as @darth10. I don't think that removing refactor-nrepl is a solution, since my primary editor is Emacs and I'd like to keep it :blush: @pron Could you comment on this? clojure-emacs/refactor-nrepl#107 has more info.

malchmih commented 9 years ago

I'm sorry, didn't notice #43