Welcome to the CSC Q&A, on our server named in honor of Ada Lovelace. Write great code! Get help and give help!
It is our choices... that show what we truly are, far more than our abilities.


+17 votes

InputStream inputStream =

            if (inputStream != null) {
                beans = new CsvToBeanBuilder(new FileReader("src/main/resources/GymSoftwarePics/DEMO1.csv"))
            } else {
                System.err.println("CSV file not found in the classpath.");

That is the code I have right now, and it is throwing a ClassNotFoundException at the withType(Card.class) line. However, it doesn't throw the same exception in the inputStream line(yes I know it doesn't do anything). Does anyone know why it is throwing a class not found exception? the class does exist and is called Card

asked in CSC305 Fall 2023 by (1 point)
edited by

Can you edit your question to include the full error message? E.g. Is it a ClassNotFoundException, or a FileNotFoundException?

1 Answer

+2 votes

I have figured it out, I was misreading the exception message and needed to add a requirement to the module. I had to add java.sql if anyone else runs into this problem

answered by (1 point)