我目前正在玩kotlin,Spring社交和Google应用引擎。 我试图每秒钟追回一些追随者。 这是我的代码: @Service class SubscribeService { var subscriber : Disposable? = null var twitter : Twitter = TwitterTemplate( "XXXAUTHXXX", "XXXAUTHXXX", "XXXAUTHXXX", "XXXAUTHXXX") fun subscribe() { subscriber = Observable.interval(1, TimeUnit.SECONDS).subscribe {println(twitter.userOperations().getUserProfile("azeaze").followersCount)} } fun unsubscribe() { subscriber?.dispose() } } 当我执行订阅功能时,我得到这个异常: [INFO] io.reactivex.exceptions.OnErrorNotImplementedException: Can't make API call urlfetch.Fetch in a thread that is neither the original request […]
我有Kotlin代码: cluster.removeIf { t: SolutionElement -> t.timeStart < minimumDate } //Clusters.kt:66 集群对象是kotlin可变列表。 当我尝试在Google App Engine标准环境中运行此代码时,出现错误: java.lang.NoClassDefFoundError: java/util/function/Predicate at com.google.appengine.runtime.Request.process-4a2a3dcd2b375db7(Request.java) at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:820) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142) at java.net.URLClassLoader.defineClass(URLClassLoader.java:449) at sun.reflect.GeneratedMethodAccessor5.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at java.lang.ClassLoader.loadClass(ClassLoader.java:375) at net.toolla.teamly.services.matcher.Clusters.removeExpired(Clusters.kt:66) at net.toolla.teamly.services.matcher.Clusters.pickMore(Clusters.kt:31) at net.toolla.teamly.services.matcher.BestMatchWorker.getSolutionElements(BestMatchWorker.java:232) at net.toolla.teamly.services.matcher.BestMatchWorker.match(BestMatchWorker.java:116) at net.toolla.teamly.services.matcher.MatcherService.doPost(MatcherService.java:37) at javax.servlet.http.HttpServlet.service(HttpServlet.java:637) at javax.servlet.http.HttpServlet.service(HttpServlet.java:717) at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:511) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1166) […]