Caused by: java.lang.ExceptionInInitializerError
at org.hibernate.cfg.Configuration.reset(Configuration.java:168)
at org.hibernate.cfg.Configuration.<init>(Configuration.java:187)
at org.hibernate.cfg.Configuration.<init>(Configuration.java:191)
...
Caused by: java.lang.NullPointerException
at org.hibernate.util.ConfigHelper.getResourceAsStream(ConfigHelper.java:144)
at org.hibernate.cfg.Environment.<clinit>(Environment.java:524)
就是在new Configuration()时出错,很莫名其妙,搜索发现与自定义的Hibernate用户库有关。原因解决办法如下:
原因:set User Library in Eclipse to be a "System Library", which places it into the boot classpath.
解决:Changing your User Library in Eclipse via the User Library Manager from System Library to standard library will resolve this issue.