The Author Online Book Forums are Moving

The Author Online Book Forums will soon redirect to Manning's liveBook and liveVideo. All book forum content will migrate to liveBook's discussion forum and all video forum content will migrate to liveVideo. Log in to liveBook or liveVideo with your Manning credentials to join the discussion!

Thank you for your engagement in the AoF over the years! We look forward to offering you a more enhanced forum experience.

smingins (8) [Avatar] Offline
#1
Hi

I am just wondering if you might know what would be causing an ArrayIndexOutOfBoundsException in the reading of the csv file in the ch02 example.

I have a gist of the full stack trace here:

https://gist.github.com/smingins/935dc4c9b1e2e25d62d6574fd5b231c8

Thanks in advance smilie

Shane
Jean Georges Perrin (15) [Avatar] Offline
#2
Hi Shane,

Thanks for catching this one! It looks like an issue with Scala 2.12 (well, there is a few reason I do not like Scala that much). I changed the pom.xml to:

  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <java.version>1.8</java.version>
    <scala.version>2.11</scala.version>
    <spark.version>2.4.0</spark.version>
    <postgresql.version>42.1.4</postgresql.version>
  </properties>


Cleaned and it should work (I just tried on a freshly installed machine with PostgreSQL yet, so I will have to install it to fully check this lab).

Thanks so much for catching it and sharing with us!

jg
smingins (8) [Avatar] Offline
#3
Awesome, that now works fine smilie

image

I haven't use Java regularly for over 10 years now (I'm a Ruby guy) so I know I'm a little rusty ... and I never used Maven (it was Ant back then) ... so I am working through the code examples slowly.

Glad I could help test the example smilie

Cheers
Shane
Jean Georges Perrin (15) [Avatar] Offline
#4
Ah... Java and its ways of doing things smilie I used make on my first Java programs smilie. I’m glad I could be helpful. Sorry you had the issue, i should have checked more carefully.

Happy Thanksgiving if you celebrate it!