Я недавно начал работать в новом месте, где они используют scala и играют для этого старого приложения. К сожалению, здесь никто не знаком с этой ошибкой, и я надеюсь, что какой-нибудь гораздо более опытный scala человек сможет пролить немного света здесь.
На Ма c ОС (Каталина) Я получаю эти ошибки, но когда я помещаю все в linux ВМ, я могу заставить его работать! Так, это специфицирует c для OS X.
Java 8 SBT. 13
Вот несколько трассировок стека с консоли SBT при попытке запустить программу:
[info] Loading global plugins from /Users/me/.sbt/0.13/plugins
[info] Loading project definition from /Users/me/dev/.../projectDirectory/project
[info] Set current project to RedactedProjectName (in build file:/Users/me/dev/.../projectDirectory/)
[warn] Error loading JNotify watch service: null
--- (Running the application, auto-reloading is enabled) ---
java.lang.ExceptionInInitializerError
at net.contentobjects.jnotify.macosx.JNotifyAdapterMacOSX.<init>(Unknown Source)
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 net.contentobjects.jnotify.JNotify.<clinit>(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at play.runsupport.JNotifyFileWatchService$JNotifyDelegate.ensureLoaded(FileWatchService.scala:188)
at play.runsupport.JNotifyFileWatchService$$anonfun$5.apply(FileWatchService.scala:243)
at play.runsupport.JNotifyFileWatchService$$anonfun$5.apply(FileWatchService.scala:199)
at scala.util.control.Exception$Catch$$anonfun$withTry$1.apply(Exception.scala:129)
at scala.util.control.Exception$Catch$$anonfun$withTry$1.apply(Exception.scala:129)
at scala.util.control.Exception$Catch.apply(Exception.scala:102)
at scala.util.control.Exception$Catch.withTry(Exception.scala:129)
at play.runsupport.JNotifyFileWatchService$.apply(FileWatchService.scala:199)
at play.runsupport.FileWatchService$$anon$1.delegate$lzycompute(FileWatchService.scala:80)
at play.runsupport.FileWatchService$$anon$1.delegate(FileWatchService.scala:76)
at play.runsupport.FileWatchService$$anon$1.watch(FileWatchService.scala:89)
at play.runsupport.Reloader.<init>(Reloader.scala:310)
at play.runsupport.Reloader$.reloader$lzycompute$1(Reloader.scala:210)
at play.runsupport.Reloader$.play$runsupport$Reloader$$reloader$1(Reloader.scala:210)
at play.runsupport.Reloader$.startDevMode(Reloader.scala:234)
at play.sbt.run.PlayRun$$anonfun$playRunTask$1$$anonfun$apply$2$$anonfun$apply$3.devModeServer$lzycompute$1(PlayRun.scala:74)
at play.sbt.run.PlayRun$$anonfun$playRunTask$1$$anonfun$apply$2$$anonfun$apply$3.play$sbt$run$PlayRun$$anonfun$$anonfun$$anonfun$$devModeServer$1(PlayRun.scala:74)
at play.sbt.run.PlayRun$$anonfun$playRunTask$1$$anonfun$apply$2$$anonfun$apply$3.apply(PlayRun.scala:100)
at play.sbt.run.PlayRun$$anonfun$playRunTask$1$$anonfun$apply$2$$anonfun$apply$3.apply(PlayRun.scala:53)
at scala.Function1$$anonfun$compose$1.apply(Function1.scala:47)
at sbt.$tilde$greater$$anonfun$$u2219$1.apply(TypeFunctions.scala:40)
at sbt.std.Transform$$anon$4.work(System.scala:63)
at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:228)
at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:228)
at sbt.ErrorHandling$.wideConvert(ErrorHandling.scala:17)
at sbt.Execute.work(Execute.scala:237)
at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:228)
at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:228)
at sbt.ConcurrentRestrictions$$anon$4$$anonfun$1.apply(ConcurrentRestrictions.scala:159)
at sbt.CompletionService$$anon$2.call(CompletionService.scala:28)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.NullPointerException
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1847)
at java.lang.Runtime.loadLibrary0(Runtime.java:871)
at java.lang.System.loadLibrary(System.java:1124)
at net.contentobjects.jnotify.macosx.JNotify_macosx.<clinit>(Unknown Source)
at net.contentobjects.jnotify.macosx.JNotifyAdapterMacOSX.<init>(Unknown Source)
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 net.contentobjects.jnotify.JNotify.<clinit>(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at play.runsupport.JNotifyFileWatchService$JNotifyDelegate.ensureLoaded(FileWatchService.scala:188)
at play.runsupport.JNotifyFileWatchService$$anonfun$5.apply(FileWatchService.scala:243)
at play.runsupport.JNotifyFileWatchService$$anonfun$5.apply(FileWatchService.scala:199)
at scala.util.control.Exception$Catch$$anonfun$withTry$1.apply(Exception.scala:129)
at scala.util.control.Exception$Catch$$anonfun$withTry$1.apply(Exception.scala:129)
at scala.util.control.Exception$Catch.apply(Exception.scala:102)
at scala.util.control.Exception$Catch.withTry(Exception.scala:129)
at play.runsupport.JNotifyFileWatchService$.apply(FileWatchService.scala:199)
at play.runsupport.FileWatchService$$anon$1.delegate$lzycompute(FileWatchService.scala:80)
at play.runsupport.FileWatchService$$anon$1.delegate(FileWatchService.scala:76)
at play.runsupport.FileWatchService$$anon$1.watch(FileWatchService.scala:89)
at play.runsupport.Reloader.<init>(Reloader.scala:310)
at play.runsupport.Reloader$.reloader$lzycompute$1(Reloader.scala:210)
at play.runsupport.Reloader$.play$runsupport$Reloader$$reloader$1(Reloader.scala:210)
at play.runsupport.Reloader$.startDevMode(Reloader.scala:234)
at play.sbt.run.PlayRun$$anonfun$playRunTask$1$$anonfun$apply$2$$anonfun$apply$3.devModeServer$lzycompute$1(PlayRun.scala:74)
at play.sbt.run.PlayRun$$anonfun$playRunTask$1$$anonfun$apply$2$$anonfun$apply$3.play$sbt$run$PlayRun$$anonfun$$anonfun$$anonfun$$devModeServer$1(PlayRun.scala:74)
at play.sbt.run.PlayRun$$anonfun$playRunTask$1$$anonfun$apply$2$$anonfun$apply$3.apply(PlayRun.scala:100)
at play.sbt.run.PlayRun$$anonfun$playRunTask$1$$anonfun$apply$2$$anonfun$apply$3.apply(PlayRun.scala:53)
at scala.Function1$$anonfun$compose$1.apply(Function1.scala:47)
at sbt.$tilde$greater$$anonfun$$u2219$1.apply(TypeFunctions.scala:40)
at sbt.std.Transform$$anon$4.work(System.scala:63)
at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:228)
at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:228)
at sbt.ErrorHandling$.wideConvert(ErrorHandling.scala:17)
at sbt.Execute.work(Execute.scala:237)
at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:228)
at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:228)
at sbt.ConcurrentRestrictions$$anon$4$$anonfun$1.apply(ConcurrentRestrictions.scala:159)
at sbt.CompletionService$$anon$2.call(CompletionService.scala:28)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
java.lang.NullPointerException
at java.util.concurrent.ConcurrentHashMap.putVal(ConcurrentHashMap.java:1011)
at java.util.concurrent.ConcurrentHashMap.putIfAbsent(ConcurrentHashMap.java:1535)
at io.netty.util.internal.ConcurrentSet.add(ConcurrentSet.java:48)
at io.netty.channel.group.DefaultChannelGroup.add(DefaultChannelGroup.java:133)
at play.core.server.NettyServer.bind(NettyServer.scala:140)
at play.core.server.NettyServer.play$core$server$NettyServer$$bindChannel(NettyServer.scala:224)
at play.core.server.NettyServer$$anonfun$1.apply(NettyServer.scala:216)
at play.core.server.NettyServer$$anonfun$1.apply(NettyServer.scala:216)
at scala.Option.map(Option.scala:146)
at play.core.server.NettyServer.<init>(NettyServer.scala:216)
at play.core.server.NettyServerProvider.createServer(NettyServer.scala:279)
at play.core.server.NettyServerProvider.createServer(NettyServer.scala:278)
at play.core.server.DevServerStart$$anonfun$mainDev$1.apply(DevServerStart.scala:235)
at play.core.server.DevServerStart$$anonfun$mainDev$1.apply(DevServerStart.scala:65)
at play.utils.Threads$.withContextClassLoader(Threads.scala:21)
at play.core.server.DevServerStart$.mainDev(DevServerStart.scala:64)
at play.core.server.DevServerStart$.mainDevHttpMode(DevServerStart.scala:54)
at play.core.server.DevServerStart.mainDevHttpMode(DevServerStart.scala)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at play.runsupport.Reloader$.startDevMode(Reloader.scala:234)
at play.sbt.run.PlayRun$$anonfun$playRunTask$1$$anonfun$apply$2$$anonfun$apply$3.devModeServer$lzycompute$1(PlayRun.scala:74)
at play.sbt.run.PlayRun$$anonfun$playRunTask$1$$anonfun$apply$2$$anonfun$apply$3.play$sbt$run$PlayRun$$anonfun$$anonfun$$anonfun$$devModeServer$1(PlayRun.scala:74)
at play.sbt.run.PlayRun$$anonfun$playRunTask$1$$anonfun$apply$2$$anonfun$apply$3.apply(PlayRun.scala:100)
at play.sbt.run.PlayRun$$anonfun$playRunTask$1$$anonfun$apply$2$$anonfun$apply$3.apply(PlayRun.scala:53)
at scala.Function1$$anonfun$compose$1.apply(Function1.scala:47)
[trace] Stack trace suppressed: run last compile:run for the full output.
[error] (compile:run) java.lang.reflect.InvocationTargetException
[error] Total time: 1 s, completed Apr 2, 2020 4:14:45 PM
Если я sbt evicted
, то sbt run
снова, проект запускается, все выглядит нормально:
git:(master) ✗ sbt run
[info] Loading global plugins from /Users/me/.sbt/0.13/plugins
[info] Loading project definition from /Users/me/dev/.../projectDir/project
[info] Set current project to theProject (in build file:/Users/me/dev/.../projectDir/ocpapi/)
[info] Updating {file:/Users/jonbuck/dev/.../projectDir/}root...
[info] Resolving jline#jline;2.14.3 ...
[info] Done updating.
[warn] There may be incompatibilities among your library dependencies.
[warn] Here are some of the libraries that were evicted:
[warn] * com.typesafe.akka:akka-slf4j_2.11:2.4.20 -> 2.5.14
[warn] * com.typesafe.akka:akka-actor_2.11:(2.4.20, 2.5.1, 2.3.13) -> 2.5.14
[warn] Run 'evicted' to see detailed eviction warnings
[warn] Error loading JNotify watch service: null
--- (Running the application, auto-reloading is enabled) ---
[info] p.c.s.NettyServer - Listening for HTTP on /0:0:0:0:0:0:0:0:9000
(Server started, use Ctrl+D to stop and go back to the console...)
Затем, когда я нажимаю localhost: 9000, я начинаю видеть это:
[info] p.c.s.NettyServer - Listening for HTTP on /0:0:0:0:0:0:0:0:9000
(Server started, use Ctrl+D to stop and go back to the console...)
[warn] i.n.c.s.n.NioServerSocketChannel - Failed to create a new channel from an accepted socket.
java.lang.ExceptionInInitializerError: null
at sun.nio.ch.SocketChannelImpl$DefaultOptionsHolder.defaultOptions(SocketChannelImpl.java:239)
at sun.nio.ch.SocketChannelImpl$DefaultOptionsHolder.<clinit>(SocketChannelImpl.java:226)
at sun.nio.ch.SocketChannelImpl.supportedOptions(SocketChannelImpl.java:248)
at sun.nio.ch.SocketChannelImpl.setOption(SocketChannelImpl.java:166)
at sun.nio.ch.SocketAdaptor.setBooleanOption(SocketAdaptor.java:284)
at sun.nio.ch.SocketAdaptor.setTcpNoDelay(SocketAdaptor.java:319)
at io.netty.channel.socket.DefaultSocketChannelConfig.setTcpNoDelay(DefaultSocketChannelConfig.java:254)
at io.netty.channel.socket.DefaultSocketChannelConfig.<init>(DefaultSocketChannelConfig.java:54)
at io.netty.channel.socket.nio.NioSocketChannel$NioSocketChannelConfig.<init>(NioSocketChannel.java:391)
at io.netty.channel.socket.nio.NioSocketChannel$NioSocketChannelConfig.<init>(NioSocketChannel.java:389)
Caused by: java.lang.NullPointerException: null
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1847)
at java.lang.Runtime.loadLibrary0(Runtime.java:871)
at java.lang.System.loadLibrary(System.java:1124)
at sun.net.ExtendedOptionsImpl.lambda$static$0(ExtendedOptionsImpl.java:48)
at java.security.AccessController.doPrivileged(Native Method)
at sun.net.ExtendedOptionsImpl.<clinit>(ExtendedOptionsImpl.java:47)
at sun.nio.ch.SocketChannelImpl$DefaultOptionsHolder.defaultOptions(SocketChannelImpl.java:239)
at sun.nio.ch.SocketChannelImpl$DefaultOptionsHolder.<clinit>(SocketChannelImpl.java:226)
at sun.nio.ch.SocketChannelImpl.supportedOptions(SocketChannelImpl.java:248)
at sun.nio.ch.SocketChannelImpl.setOption(SocketChannelImpl.java:166)
[warn] i.n.c.s.n.NioServerSocketChannel - Failed to create a new channel from an accepted socket.
java.lang.NoClassDefFoundError: Could not initialize class sun.nio.ch.SocketChannelImpl$DefaultOptionsHolder
at sun.nio.ch.SocketChannelImpl.supportedOptions(SocketChannelImpl.java:248)
at sun.nio.ch.SocketChannelImpl.setOption(SocketChannelImpl.java:166)
at sun.nio.ch.SocketAdaptor.setBooleanOption(SocketAdaptor.java:284)
at sun.nio.ch.SocketAdaptor.setTcpNoDelay(SocketAdaptor.java:319)
at io.netty.channel.socket.DefaultSocketChannelConfig.setTcpNoDelay(DefaultSocketChannelConfig.java:254)
at io.netty.channel.socket.DefaultSocketChannelConfig.<init>(DefaultSocketChannelConfig.java:54)
at io.netty.channel.socket.nio.NioSocketChannel$NioSocketChannelConfig.<init>(NioSocketChannel.java:391)
at io.netty.channel.socket.nio.NioSocketChannel$NioSocketChannelConfig.<init>(NioSocketChannel.java:389)
at io.netty.channel.socket.nio.NioSocketChannel.<init>(NioSocketChannel.java:98)
at io.netty.channel.socket.nio.NioServerSocketChannel.doReadMessages(NioServerSocketChannel.java:145)
[warn] i.n.c.s.n.NioServerSocketChannel - Failed to create a new channel from an accepted socket.
java.lang.NoClassDefFoundError: Could not initialize class sun.nio.ch.SocketChannelImpl$DefaultOptionsHolder
at sun.nio.ch.SocketChannelImpl.supportedOptions(SocketChannelImpl.java:248)
at sun.nio.ch.SocketChannelImpl.setOption(SocketChannelImpl.java:166)
at sun.nio.ch.SocketAdaptor.setBooleanOption(SocketAdaptor.java:284)
at sun.nio.ch.SocketAdaptor.setTcpNoDelay(SocketAdaptor.java:319)
at io.netty.channel.socket.DefaultSocketChannelConfig.setTcpNoDelay(DefaultSocketChannelConfig.java:254)
at io.netty.channel.socket.DefaultSocketChannelConfig.<init>(DefaultSocketChannelConfig.java:54)
at io.netty.channel.socket.nio.NioSocketChannel$NioSocketChannelConfig.<init>(NioSocketChannel.java:391)
at io.netty.channel.socket.nio.NioSocketChannel$NioSocketChannelConfig.<init>(NioSocketChannel.java:389)
at io.netty.channel.socket.nio.NioSocketChannel.<init>(NioSocketChannel.java:98)
at io.netty.channel.socket.nio.NioServerSocketChannel.doReadMessages(NioServerSocketChannel.java:145)