NoClassDefFoundError for akka actor when using akka-persistence-redis

1,595 views
Skip to first unread message

Dai Yinhua

unread,
Feb 14, 2017, 8:47:22 PM2/14/17
to Akka User List
Hi team,

Is any one using akka-persistence-redis, I have encountered below exception when I was trying to use akka-persistence-redis 0.6.

Uncaught error from thread [RTAPCluster-akka.persistence.dispatchers.default-plugin-dispatcher-17] shutting down JVM since 'akka.jvm-exit-on-fatal-error' is enabled for ActorSystem[RTAPCluster]
java.lang.NoClassDefFoundError: akka/actor/Actor$class
at com.hootsuite.akka.persistence.redis.snapshot.RedisSnapshotStore.<init>(RedisSnapshotStore.scala:16)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at java.lang.Class.newInstance(Class.java:442)
at akka.util.Reflect$.instantiate(Reflect.scala:44)
at akka.actor.NoArgsReflectConstructor.produce(IndirectActorProducer.scala:105)
at akka.actor.Props.newActor(Props.scala:213)
at akka.actor.ActorCell.newActor(ActorCell.scala:562)
at akka.actor.ActorCell.create(ActorCell.scala:588)
at akka.actor.ActorCell.invokeAll$1(ActorCell.scala:461)
at akka.actor.ActorCell.systemInvoke(ActorCell.scala:483)
at akka.dispatch.Mailbox.processAllSystemMessages(Mailbox.scala:282)
at akka.dispatch.Mailbox.run(Mailbox.scala:223)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.ClassNotFoundException: akka.actor.Actor$class
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 18 more

I can confirm the akka actor is included to the project, and it is running ok when I switch to level db.
I noticed that akka-persistence-redis V0.6 is using rediscala V1.6, which then depends on akka V2.3.6, but I would like to use akka V2.4.12, so I exclude the akka dependency from the dependency of akka-persistence-redis, not sure if this is the reason.
Related part of my pom.xml is as below:

<dependencyManagement>
  <dependencies>
  <dependency>
  <groupId>com.typesafe.akka</groupId>
  <artifactId>akka-actor_2.12</artifactId>
  <version>2.4.12</version>
  </dependency>
  </dependencies>
  </dependencyManagement>

<dependencies>
...
<dependency>
 <groupId>com.hootsuite</groupId>
 <artifactId>akka-persistence-redis_2.11</artifactId>
 <version>0.6.0</version>
 <exclusions>
  <exclusion>
  <groupId>com.typesafe.akka</groupId>
  <artifactId>akka-actor_2.11</artifactId>
  </exclusion>
  <exclusion>
  <groupId>com.typesafe.akka</groupId>
  <artifactId>akka-persistence_2.11</artifactId>
  </exclusion>
  <exclusion>
  <groupId>com.typesafe.akka</groupId>
  <artifactId>akka-remote_2.11</artifactId>
  </exclusion>
  <exclusion>
  <groupId>com.typesafe.akka</groupId>
  <artifactId>akka-contrib_2.11</artifactId>
  </exclusion>
 </exclusions>
</dependency>
...
</dependencies>

Patrik Nordwall

unread,
Feb 15, 2017, 1:01:52 AM2/15/17
to akka...@googlegroups.com
You can't mix versions that were built with Scala 2.11 and 2.12.
akka-actor_2.12 vs akka-persistence-redis_2.11

I suggest that you help the maintainers of akka-persistence-redis to update to latest Akka and Scala versions.

--
>>>>>>>>>> Read the docs: http://akka.io/docs/
>>>>>>>>>> Check the FAQ: http://doc.akka.io/docs/akka/current/additional/faq.html
>>>>>>>>>> Search the archives: https://groups.google.com/group/akka-user
---
You received this message because you are subscribed to the Google Groups "Akka User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email to akka-user+unsubscribe@googlegroups.com.
To post to this group, send email to akka...@googlegroups.com.
Visit this group at https://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.



--

Patrik Nordwall
Akka Tech Lead
Lightbend -  Reactive apps on the JVM
Twitter: @patriknw

Dai Yinhua

unread,
Feb 15, 2017, 2:30:02 AM2/15/17
to Akka User List
Hi Patrik,

Get it, thank you for your response.

Steve Song

unread,
Feb 18, 2017, 1:04:31 PM2/18/17
to Akka User List
We released v0.7 today that supports Scala 2.12 and Akka 2.4.12. Let me know if you run into issues with the release.

Steve


On Tuesday, February 14, 2017 at 11:30:02 PM UTC-8, Dai Yinhua wrote:
Hi Patrik,

Get it, thank you for your response.

id: 7898659753248090

Dai Yinhua

unread,
Feb 19, 2017, 4:15:29 AM2/19/17
to Akka User List
Awesome, I will try it, thank you.
Reply all
Reply to author
Forward
0 new messages