Exception in thread “main” java.lang.NoClassDefFoundError: Could not initialize class XXX
ClassLoader classLoader = JDBCUtils.class.getClassLoader();
URL res = classLoader.getResource("jdbc.properties");
String path = res.getPath();
System.out.println(path);
出现这个error的表层原因为String path = res.getPath();,将该代码注释后,程序正常,具体原因不知晓,望补充。