Why am I receiveing a NoSuchElementException?

I'm getting this in my Eclipse console when I run my program:

Type a number then press enter.

1. Add a customer

2. Add an order

3. Remove an order

4. Ship an order

5. Print pending orders with customer information

6. Restock parts

7. Exit

1

Loading driver...

Driver loaded!

Connecting database...

Database connected!

Enter 5 letters or less to identify the customer as.

Exception in thread "main" java.util.NoSuchElementException: No line found

at java.util.Scanner.nextLine(Scanner.java:1540)

I've tried using just one Scanner and not closing it but that didn't work. Can someone please help me figure out why I'm getting this message on the line that reads, tempCustID...

Read More »

By: StackOverFlow - Friday, 9 November

Related Posts