• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Error when trying to run Spring project

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello.
I'm trying to run my first Spring project and I'm getting the error below. I'm tearing my hair out at this stage. I cannot fix it. Any suggestion would be great. Thank You.

Exception in thread "main" java.lang.IllegalStateException: Failed to execute CommandLineRunner
at org.springframework.boot.SpringApplication.runCommandLineRunners(SpringApplication.java:675)
at org.springframework.boot.SpringApplication.afterRefresh(SpringApplication.java:690)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:321)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:957)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:946)
at ie.cit.caf.GroupProjectApplication.main(GroupProjectApplication.java:82)

Caused by: java.lang.ArrayIndexOutOfBoundsException: 0
at ie.cit.caf.GroupProjectApplication.run(GroupProjectApplication.java:132)
at org.springframework.boot.SpringApplication.runCommandLineRunners(SpringApplication.java:672)
... 5 more

 
Bartender
Posts: 1845
10
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi! Welcome to the Ranch.

The secret of interpreting stack traces is to look at the "Caused by" section - and find the last bit where it leaves 'your' code.

In this case, the issue seems to be in GroupProjectApplication.java - in the run method.
What is happening on line 132 of this class ?
What does that code look like?
Does it reference an Array or similar via an index/number?
Does whatever you are referencing have values in it?

Hopefully that should point you in the right direction.
In order to be of any further help, we will need to see the mentioned class/method.
 
Samantha Spillane
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank You. I've looked at line 132. I'm guessing the array is the issue

ERR.png
[Thumbnail for ERR.png]
 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Hi ,

At line No 132 you are trying to get Element from String Array , ,May be you are not passing any args for your main class ,you must pass command line parameter .
 
reply
    Bookmark Topic Watch Topic
  • New Topic