У меня есть приложение Scala, запущенное в Tomcat7, которое в последнее время случайно начало сбой из-за ошибок ClassNotFoundException
для стандартных классов, таких как scala.collection.immutable.ListSet
, даже если сервер некоторое время работал идеально.Ошибки стали становиться все чаще, и теперь мы получаем несколько сбоев в день на некоторых серверах
Это пример журнала сбоев, который мы получаем в файле журнала catalina.out.
Dec 25, 2018 8:50:47 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["http-bio-8080"]
Dec 25, 2018 8:50:47 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 6938 ms
Uncaught error from thread [TPDispatcher-akka.actor.default-dispatcher-4] shutting down JVM since 'akka.jvm-exit-on-fatal-error' is enabled for ActorSystem[TPDispatcher]
java.lang.NoClassDefFoundError: scala/collection/immutable/ListSet$
at scala.collection.immutable.HashSet$HashSet1.updated0(HashSet.scala:145)
at scala.collection.immutable.HashSet$HashTrieSet.updated0(HashSet.scala:227)
at scala.collection.immutable.HashSet$HashTrieSet.updated0(HashSet.scala:227)
at scala.collection.immutable.HashSet$HashTrieSet.updated0(HashSet.scala:227)
at scala.collection.immutable.HashSet$HashTrieSet.updated0(HashSet.scala:227)
at scala.collection.immutable.HashSet.$plus(HashSet.scala:56)
at scala.collection.immutable.HashSet.$plus(HashSet.scala:33)
at scala.collection.mutable.SetBuilder.$plus$eq(SetBuilder.scala:24)
at scala.collection.mutable.SetBuilder.$plus$eq(SetBuilder.scala:22)
at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:244)
at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:244)
at scala.collection.immutable.HashSet$HashSet1.foreach(HashSet.scala:153)
at scala.collection.immutable.HashSet$HashTrieSet.foreach(HashSet.scala:306)
at scala.collection.immutable.HashSet$HashTrieSet.foreach(HashSet.scala:306)
at scala.collection.immutable.HashSet$HashTrieSet.foreach(HashSet.scala:306)
at scala.collection.immutable.HashSet$HashTrieSet.foreach(HashSet.scala:306)
at scala.collection.TraversableLike$class.map(TraversableLike.scala:244)
at scala.collection.AbstractSet.scala$collection$SetLike$$super$map(Set.scala:47)
at scala.collection.SetLike$class.map(SetLike.scala:93)
at scala.collection.AbstractSet.map(Set.scala:47)
at com.mycompany.lib.actors.BadgeUpdater.updateBadge(BadgeUpdater.scala:23)
at com.mycompany.lib.actors.BadgeUpdater$$anonfun$receive$1.applyOrElse(BadgeUpdater.scala:15)
at akka.actor.Actor$class.aroundReceive(Actor.scala:465)
at com.twinpush.tp_dispatcher.lib.actors.BadgeUpdater.aroundReceive(BadgeUpdater.scala:11)
at akka.actor.ActorCell.receiveMessage(ActorCell.scala:516)
at akka.actor.ActorCell.invoke(ActorCell.scala:487)
at akka.dispatch.Mailbox.processMailbox(Mailbox.scala:238)
at akka.dispatch.Mailbox.run(Mailbox.scala:220)
at akka.dispatch.ForkJoinExecutorConfigurator$AkkaForkJoinTask.exec(AbstractDispatcher.scala:393)
at scala.concurrent.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:260)
at scala.concurrent.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1339)
at scala.concurrent.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1979)
at scala.concurrent.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:107)
Caused by: java.lang.ClassNotFoundException: scala.collection.immutable.ListSet$
at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1859)
at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1702)
... 33 more
Dec 26, 2018 2:15:31 PM org.apache.coyote.AbstractProtocol pause
INFO: Pausing ProtocolHandler ["http-bio-8080"]
Dec 26, 2018 2:15:31 PM org.apache.catalina.core.StandardService stopInternal
INFO: Stopping service Catalina
Я несколько раз пытался перекомпилировать, но безуспешно.Я понятия не имею, что может вызвать ClassNotFoundException
на сервере, который уже работает, поэтому любая подсказка будет высоко оценена.
Информация о среде:
Scala version: 2.10.4
Server version: Apache Tomcat/7.0.68 (Ubuntu)
Server built: Oct 30 2018 12:54:52 UTC
Server number: 7.0.68.0
OS Name: Linux
OS Version: 4.4.0-141-generic
Architecture: amd64
JVM Version: 1.8.0_191-8u191-b12-0ubuntu0.16.04.1-b12
JVM Vendor: Oracle Corporation