I have made a simple spring application followin a tutorial. Running the application gives me no errors in the console.
Problem: But unfortunately I do not get any prints by the program in the console. I am also not able to debug because Eclipse does not stop at the break point.
Note: I have also found a post about the eclipse console but the solutions do not really seem to work for me. I think it is a problem in my project.
Question: Do I have to open a special perspective to see the prinln output in the console?
Main Class:
public class SpringDataDemo {
public static void main(String[] args) {
try {
ApplicationContext context = new ClassPathXmlApplicationContext("resources\\spring-configuration.xml");
// Fetch the DAO from Spring Bean Factory
EmployeeDao employeeDao = (EmployeeDao) context.getBean("EmployeeDaoImpl");
Employee employee = new Employee("Employee123");
// employee.setEmployeeId("1");
// Save an employee Object using the configured Data source
employeeDao.save(employee);
System.out.println("Employee Saved with EmployeeId " + employee.getEmployeeId());
// find an object using Primary Key
Employee emp = employeeDao.findByPrimaryKey(employee.getEmployeeId());
System.out.println(emp);
// Close the ApplicationContext
((ConfigurableApplicationContext) context).close();
} catch (BeansException | SQLException e) {
e.printStackTrace();
}
}
}