allora, ho spostato il file mybatis-config.xml in src/main/resources.
e poi ho cambiato così:
codice:
public class MyBatisUtils {
private static SqlSessionFactory factory;
static {
String myBatisConfig = "mybatis-config.xml";
Reader reader = null;
try {
reader = Resources.getResourceAsReader(myBatisConfig);
} catch (IOException e) {
System.out.println(e.getMessage());
}
factory = new SqlSessionFactoryBuilder().build(reader);
}
public static SqlSessionFactory getSqlSessionFactory() {
return factory;
}
}
ma continuo ad avere quell'errore.
non dovrebbe bastare questo??