完整报错如下:

------------------------------看下lines-----------------------------------
lines=Stream(Date,Open,High,Low,Close,Volume, ?)
lines=Stream(31-Dec-13,114.61,117.13,114.46,116.12,12838233, ?)
Exception in thread "main" java.time.format.DateTimeParseException: Text '31-Dec-13' could not be parsed at index 3at java.time.format.DateTimeFormatter.parseResolved0(DateTimeFormatter.java:1949)at java.time.format.DateTimeFormatter.parse(DateTimeFormatter.java:1851)at java.time.LocalDate.parse(LocalDate.java:400)at RunRisk$$anonfun$readGoogleHistory$1.apply(RunRisk.scala:82)at RunRisk$$anonfun$readGoogleHistory$1.apply(RunRisk.scala:80)at scala.collection.immutable.Stream.map(Stream.scala:418)at RunRisk.readGoogleHistory(RunRisk.scala:80)at RunRisk$$anonfun$11.apply(RunRisk.scala:160)at RunRisk$$anonfun$11.apply(RunRisk.scala:160)at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:234)at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:234)at scala.collection.IndexedSeqOptimized$class.foreach(IndexedSeqOptimized.scala:33)at scala.collection.mutable.ArrayOps$ofRef.foreach(ArrayOps.scala:186)at scala.collection.TraversableLike$class.map(TraversableLike.scala:234)at scala.collection.mutable.ArrayOps$ofRef.map(ArrayOps.scala:186)at RunRisk.readStocksAndFactors(RunRisk.scala:160)at RunRisk$.main(RunRisk.scala:36)at RunRisk.main(RunRisk.scala)Process finished with exit code 1

这里的index就是31-Dec-13里面的-

当然了,理解index对于解决问题毫无帮助。

耗时很久,巨恶心,解决方案如下:

import java.time.format.DateTimeFormatter
import java.util.Locale
val formatter = DateTimeFormatter.ofPattern("d-MMM-yy",Locale.ENGLISH)

环境为:

ubuntu18.10,amd64

jdk1.8.0_201

Intellij2018

Exception in thread main java.time.format.DateTimeParseException: Text '31-Dec-13' could not be pa相关推荐

  1. Exception in thread main java.lang.ArrayIndexOutOfBoundsException: 4 at text.Division.main(Divisi

    这是个初学者非常容易遇到的问题,下面请看源代码: public class Division {public static void main(String[] args) {String str = ...

  2. Exception in thread main java.lang.Error: 无法解析的编译问题: 方法 main 不能声明为 static;只能在静态类型或顶级类型中才能声明静态方法

    Exception in thread "main" java.lang.Error: 无法解析的编译问题: 方法 main 不能声明为 static:只能在静态类型或顶级类型中才 ...

  3. exception in thread main java.lang.noclassdeffounderror wrong name

    不含包层次的HelloWorld.java public class HelloWorld{ public static void main(String[] args) { System.out.p ...

  4. Exception in thread main java.lang.Error: Unresolved compilation problem

    初学java,使用eclipse编译时,可能会遇到如下图所示的编译错误(Exception in thread "main" java.lang.Error: Unresolved ...

  5. list.add时报错:Exception in thread “main“ java.lang.UnsupportedOperationException

    用list.add()时报错: Exception in thread "main" java.lang.UnsupportedOperationExceptionat java. ...

  6. Exception in thread main java.lang.OutOfMemoryError: Java heap space

    在做大批量数据测试的时候,服务端初始化出现问题 测试规模,没个站2万点量测数据,整个数据超过20万,初始化过程中对量测数据初始化,按站分别初始化,但是初始化到总数据量10万的时候就会报内存溢出错误. ...

  7. Exception in thread main java.lang.IncompatibleClassChangeError: net/sf/cglib/core/DebuggingClassW

    问题: 今天在运行程序的时候报如下错误. 1. java.lang.NoClassDefFoundError: org/objectweb/asm/CodeVisitor 2. Exception i ...

  8. Eclipse 报 “Exception in thread main java.lang.OutOfMemoryError: Java heap space ”错误的解决办法

    Eclipse 报 "Exception in thread "main" java.lang.OutOfMemoryError: Java heap space &qu ...

  9. Eclipse 报 “Exception in thread main java.lang.OutOfMemoryError: Java heap space ”错误的解决办法...

    Eclipse 报 "Exception in thread "main" java.lang.OutOfMemoryError: Java heap space &qu ...

最新文章

  1. 牛客题霸 SQL1 查找最晚入职员工的所有信息
  2. [机器学习笔记] Note1--机器学习简介
  3. Linux 多线程编程使用pthread_creat()函数条件
  4. 深度隐式表达系列 (二)
  5. 数组作为方法的返回值
  6. 持续集成[代码流水线管理及Jenkins和gitlab集成]-自动化部署05
  7. Shell脚本编程与文件系统修复
  8. Nginx和FastDfs完整配置过程
  9. mysql.h说明文档,mysql.h:没有文件或目录
  10. QQ扫码登录实现与原理
  11. 跑腿源码之外卖人v9.1_9.2的升级过程For 9.0及小程序及(客户端,配送端,商户端)的二次编译方法
  12. 完成端口(CompletionPort)详解 - 手把手教你玩转网络编程系列之三
  13. CTF训练(密码学)——Atbash Cipher
  14. 大学英语六级超全复习资料
  15. 1.Direct2D 捕鱼游戏开发-流程介绍
  16. 在Android应用中使用自定义证书,CER转BKS
  17. mysql客户端连接10060,Navicat远程连接MySQL出现10060解决办法小结
  18. java中最多小数位_在Java中最多2位小数?
  19. C语言——对文件的输入输出
  20. 中国移动光猫桥接模式

热门文章

  1. CSS3定位和浮动详解
  2. 三种常见的SQL分页语句
  3. sql注入一点小心得
  4. UltraEdit 使用操作
  5. 从Hadoop框架与MapReduce模式中谈海量数据处理(含淘宝技术架构)
  6. [小故事大道理] -- 蜜蜂为何不如苍蝇
  7. Vue使用axios,设置axios请求格式为form-data
  8. Ajax拿取JSON格式的数据
  9. idea2020搜索不到插件的问题
  10. 前端那些年----Webstream快捷键备忘(mac)