I got ArrayIndexOutOfBoundsException: 1 at this line  String name = pieces[1]; in the following function:
public static void loadFile() throws FileNotFoundException, IOException {
        file = new File("C:\\Users\\DELL\\OneDrive - Philadelphia University\\Desktop\\NetBeansProjects\\CaloriesIntakeApp\\src\\main\\webapp\\WEB-INF\\data\\data.txt");
      
        try (BufferedReader inputStream = new BufferedReader(new FileReader(file))) {
            String line;
            while ((line = inputStream.readLine()) != null) {
                String[] pieces = line.split(" ");
                String id = pieces[0];
                String name = pieces[1];
                int grms = Integer.parseInt(pieces[2]);
                int calories = Integer.parseInt(pieces[3]);
                String photo = pieces[4];
                Fruit f = new Fruit(id, name, grms, calories, photo);
                fruitList.add(f);
            }
        }
    }
Need to know the reason!
 
     
    