clj-commons / durable-queue

a disk-backed queue for clojure
Eclipse Public License 1.0
384 stars 31 forks source link

on put! java.lang.NoSuchMethodError: java.util.zip.Checksum.update([B)V #22

Open lkrubner opened 5 years ago

lkrubner commented 5 years ago

I assume this is a version conflict, either of Java or Clojure or durable-queue. My code works fine on my local Macbook Pro, but I created a new EC2 instance with Ubuntu 18.04 and then I added Java:

java -version
openjdk version "1.8.0_191"
OpenJDK Runtime Environment (build 1.8.0_191-8u191-b12-0ubuntu0.18.04.1-b12)
OpenJDK 64-Bit Server VM (build 25.191-b12, mixed mode)

On the EC2 instance I get this error on put!

INFO: java.lang.NoSuchMethodError: java.util.zip.Checksum.update([B)V
  java.lang.NoSuchMethodError: java.util.zip.Checksum.update([B)V
 at durable_queue$checksum.invokeStatic (durable_queue.clj:64)
    durable_queue$checksum.invokePrim (durable_queue.clj:-1)
    durable_queue.TaskSlab.append_to_slab_BANG_ (durable_queue.clj:314)
    durable_queue$queues$reify__6549$slab_BANG___6570.invoke (durable_queue.clj:702)
    durable_queue$queues$reify__6549$fn__6575.invoke (durable_queue.clj:719)
    durable_queue$queues$reify__6549.put_BANG_ (durable_queue.clj:717)
    durable_queue$queues$reify__6549.put_BANG_ (durable_queue.clj:732)
    humongorous_nlp.core$cycle_to_database$fn__13673$fn__13693.invoke (core.clj:665)
    humongorous_nlp.core$cycle_to_database$fn__13673.invoke (core.clj:663)
    clojure.lang.AFn.run (AFn.java:22)
    java.util.concurrent.Executors$RunnableAdapter.call (Executors.java:511)
    java.util.concurrent.FutureTask.runAndReset (FutureTask.java:308)
    java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301 (ScheduledThreadPoolExecutor.java:180)
    java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run (ScheduledThreadPoolExecutor.java:294)
    java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1149)
    java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:624)
    java.lang.Thread.run (Thread.java:748)

Is this a matter of upgrading Java, or is this a matter of doing a data conversion before calling put! ?

I'm puzzled why this works on my Mac but not the EC2 instance.

lkrubner commented 5 years ago

So, I upgraded to Java 11, and now everything works. So I guess this was a version conflict.

Just curious, but is there a way for Factual to make durable-queue to tell Leiningen that Java 11 is necessary?

ztellman commented 5 years ago

I wouldn’t think Java 11 is required, since the library hasn’t changed since it was targeting Java 6. This sounds like a stray compilation artifact, and would likely be fixed by “lein clean”. On Wed, Jan 16, 2019 at 12:29 PM Lawrence Krubner notifications@github.com wrote:

So, I upgraded to Java 11, and now everything works. So I guess this was a version conflict.

Just curious, but is there a way for Factual to make durable-queue to tell Leiningen that Java 11 is necessary?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/Factual/durable-queue/issues/22#issuecomment-454928668, or mute the thread https://github.com/notifications/unsubscribe-auth/AAB6P1g5P0RmZrwH4YlpRSl4FSaISr5tks5vD4u-gaJpZM4aD3MS .

lkrubner commented 5 years ago

Just to be clear, the code worked fine on my MacBook Pro. But if I ran lein uberjar and uploaded the uberjar to the EC2 instance, then I got the error on the EC2 instance. I don't see how that can be a stray compilation artifact. The problem was fixed when I upgraded the version of Java on the EC2 instance.

ztellman commented 5 years ago

Okay, that sounds like a version mismatch between your dev environment and prod. If you compiled it on prod, it’d probably work without any upgrade. On Sat, Jan 19, 2019 at 8:34 AM Lawrence Krubner notifications@github.com wrote:

Just to be clear, the code worked fine on my MacBook Pro. But if I ran lein uberjar and uploaded the uberjar to the EC2 instance, then I got the error on the EC2 instance. I don't see how that can be a stray compilation artifact. The problem was fixed when I upgraded the version of Java on the EC2 instance.

— You are receiving this because you commented.

Reply to this email directly, view it on GitHub https://github.com/Factual/durable-queue/issues/22#issuecomment-455794763, or mute the thread https://github.com/notifications/unsubscribe-auth/AAB6P7k7wChSoO_CrH2Thmg0kGjrwcK4ks5vE0kTgaJpZM4aD3MS .

vedang commented 1 year ago

I think that at this point it's safe to close this issue as "not a bug"