用hibernate 连接Oracle11g时,出现如下错误,请问是怎么回事? Exception in thread "main" java.lang.E
Exceptioninthread"main"java.lang.ExceptionInInitializerErroratcn.jbit.test1.Test.main...
Exception in thread "main" java.lang.ExceptionInInitializerError
at cn.jbit.test1.Test.main(Test.java:15)
Caused by: java.lang.NullPointerException
at org.slf4j.LoggerFactory.singleImplementationSanityCheck(LoggerFactory.java:192)
at org.slf4j.LoggerFactory.performInitialization(LoggerFactory.java:113)
at org.slf4j.LoggerFactory.getILoggerFactory(LoggerFactory.java:269)
at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:242)
at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:255)
at org.hibernate.cfg.Configuration.<clinit>(Configuration.java:152)
... 1 more 展开
at cn.jbit.test1.Test.main(Test.java:15)
Caused by: java.lang.NullPointerException
at org.slf4j.LoggerFactory.singleImplementationSanityCheck(LoggerFactory.java:192)
at org.slf4j.LoggerFactory.performInitialization(LoggerFactory.java:113)
at org.slf4j.LoggerFactory.getILoggerFactory(LoggerFactory.java:269)
at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:242)
at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:255)
at org.hibernate.cfg.Configuration.<clinit>(Configuration.java:152)
... 1 more 展开
2个回答
展开全部
空指针异常!!那个LoggerFactory类是你写的吗?如果是的话,.LoggerFactory.getLogger()这个方法出现异常
at org.hibernate.cfg.Configuration.<clinit>(Configuration.java:152)
或许是配置文件写错了!!
at org.hibernate.cfg.Configuration.<clinit>(Configuration.java:152)
或许是配置文件写错了!!
追问
我的配置文件时Copy的,检查好几遍,没发现错误
追答
路径写对了吗??你写几个System.out.println("*******");调试一下。在仔细找找。
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询