clojurewerkz / spyglass

A Clojure Memcached client (also: Couchbase, Kestrel). Built on top of SpyMemcached, supports ASCII and binary protocols, strives to be 100% feature complete.
http://clojurememcached.info
67 stars 17 forks source link

Unsupported major.minor version #2

Closed lsh-0 closed 12 years ago

lsh-0 commented 12 years ago

I'm getting this error:

$ lein repl
REPL started; server listening on localhost port 32060
user=> (require '[clojurewerkz.spyglass.client :as c])
UnsupportedClassVersionError clojurewerkz/spyglass/OperationFuture : Unsupported major.minor version 51.0  java.lang.ClassLoader.defineClass1 (ClassLoader.java:-2)

Using: Clojure 1.4 spyglass 1.0.0 Leiningen 1.7.0 Java 1.6.0_26 Java HotSpot(TM) 64-Bit Server VM

Identical behaviour is replicated in Leiningen 2 preview 7. Lein2 is still frustratingly slow+buggy for me so I don't use it unless I really have to.

To install spyglass I added [clojurewerkz/spyglass "1.0.0"] to my project :dependencies and then ran $ lein deps

This is the output I got.

[INFO] artifact org.clojure:clojure: checking for updates from clojars
[INFO] artifact org.clojure:clojure: checking for updates from central
[INFO] artifact org.clojure:clojure: checking for updates from clojure
[INFO] artifact org.clojure:clojure: checking for updates from clojure-snapshots
Downloading: clojurewerkz/spyglass/1.0.0/spyglass-1.0.0.pom from central
Unable to locate resource in repository
[INFO] Unable to find resource 'clojurewerkz:spyglass:pom:1.0.0' in repository central (http://repo1.maven.org/maven2)
Downloading: clojurewerkz/spyglass/1.0.0/spyglass-1.0.0.pom from clojars
Transferring 4K from clojars
Downloading: spy/spymemcached/2.8.1/spymemcached-2.8.1.pom from clojars
Unable to locate resource in repository
[INFO] Unable to find resource 'spy:spymemcached:pom:2.8.1' in repository clojars (http://clojars.org/repo/)
Downloading: spy/spymemcached/2.8.1/spymemcached-2.8.1.pom from central
Unable to locate resource in repository
[INFO] Unable to find resource 'spy:spymemcached:pom:2.8.1' in repository central (http://repo1.maven.org/maven2)
Downloading: spy/spymemcached/2.8.1/spymemcached-2.8.1.pom from spy-memcached
Transferring 1K from spy-memcached
[WARNING] *** CHECKSUM FAILED - Error retrieving checksum file for spy/spymemcached/2.8.1/spymemcached-2.8.1.pom - IGNORING
[WARNING] Overriding profile: 'null' (source: pom) with new instance from source: pom
[WARNING] Overriding profile: 'null' (source: pom) with new instance from source: pom
[WARNING] Overriding profile: 'null' (source: pom) with new instance from source: pom
Downloading: org/clojure/clojure/1.+/clojure-1.+.pom from clojars
Unable to locate resource in repository
[INFO] Unable to find resource 'org.clojure:clojure:pom:1.+' in repository clojars (http://clojars.org/repo/)
Downloading: org/clojure/clojure/1.+/clojure-1.+.pom from stuartsierra-releases
Unable to locate resource in repository
[INFO] Unable to find resource 'org.clojure:clojure:pom:1.+' in repository stuartsierra-releases (http://stuartsierra.com/maven2)
Downloading: org/clojure/clojure/1.+/clojure-1.+.pom from central
Unable to locate resource in repository
[INFO] Unable to find resource 'org.clojure:clojure:pom:1.+' in repository central (http://repo1.maven.org/maven2)
Downloading: clojurewerkz/spyglass/1.0.0/spyglass-1.0.0.jar from central
Downloading: spy/spymemcached/2.8.1/spymemcached-2.8.1.jar from clojars
Unable to locate resource in repository
[INFO] Unable to find resource 'spy:spymemcached:jar:2.8.1' in repository clojars (http://clojars.org/repo/)
Downloading: spy/spymemcached/2.8.1/spymemcached-2.8.1.jar from central
Unable to locate resource in repository
[INFO] Unable to find resource 'clojurewerkz:spyglass:jar:1.0.0' in repository central (http://repo1.maven.org/maven2)
Downloading: clojurewerkz/spyglass/1.0.0/spyglass-1.0.0.jar from clojars
Transferring 9K from clojars
Unable to locate resource in repository
[INFO] Unable to find resource 'spy:spymemcached:jar:2.8.1' in repository central (http://repo1.maven.org/maven2)
Downloading: spy/spymemcached/2.8.1/spymemcached-2.8.1.jar from spy-memcached
Transferring 381K from spy-memcached
[WARNING] *** CHECKSUM FAILED - Error retrieving checksum file for spy/spymemcached/2.8.1/spymemcached-2.8.1.jar - IGNORING

It looks successful despite failing checksums. I deleted spyglass-1.0.0.jar and spymemcached-2.8.1.jar and ran deps again, however I think they were pulled from a cache somewhere and not re-downloaded.

mvid commented 12 years ago

I am also having this issue.

michaelklishin commented 12 years ago

I did not realize that README still suggests 1.0.0. 1.0.1 has been out for more than a week. I don't know what may be up with the SpyMemcached repo but artifacts are not always redownloaded. With lein1, you need to delete lib/* and with lein2, artifacts under ~/.m2/repository (not everything, just net/spy/memcached).

Failing checksums suggest something is wrong with the SpyMemcached artifact. Please report it to their mailing list.

michaelklishin commented 12 years ago

I don't see these warnings on master after removing ~/.m2/repository/spy/memcached because I have checksum setting set to :ignore. The SpyMemcached repository does not seem to have checksums at all. I also had no idea 2.8.4 is out.

I will bump the dependency and push a new 1.1.0-SNAPSHOT, feel free to try it.

michaelklishin commented 12 years ago

I haven't noticed the end of the exception.

Unsupported major.minor version 51.0

is due to 1.0.0 being accidentally compiled for JDK 7 and you are running JDK 6. The version here is the class file version. Move to 1.0.1, it is compiled for JDK 6+.

lsh-0 commented 12 years ago

This now works:

user=> (require '[clojurewerkz.spyglass.client :as c])

Thanks for providing a fix.