`

org.hibernate.internal.util.ConfigHelper.getResourceAsStream错误

 
阅读更多

hibernate4,运行时出现以下错误:

java.lang.ExceptionInInitializerError
	at org.hibernate.cfg.Configuration.reset(Configuration.java:299)
	at org.hibernate.cfg.Configuration.<init>(Configuration.java:265)
	at org.hibernate.cfg.Configuration.<init>(Configuration.java:269)
	at com.hibernate.simple.TeacherTest.beforeClass(TeacherTest.java:17)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:606)
	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
	at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:24)
	at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
	at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
	at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
Caused by: java.lang.NullPointerException
	at org.hibernate.internal.util.ConfigHelper.getResourceAsStream(ConfigHelper.java:170)
	at org.hibernate.cfg.Environment.<clinit>(Environment.java:221)
	... 19 more

 

发现是与用户自定的User Libraries有关;

解决:在Eclipse中直接引入hibernate相关的包即可。

分享到:
评论

相关推荐

    org.apache.poi jar包

    org.apache.poi JAR包,解决个人的 import org.apache.commons.beanutils.PropertyUtilsBean;...import org.apache.poi.ss.util.CellRangeAddress; "The import org.apache.poi cannot be resolved"的问题

    resolver_java_wsdl.jar

    at com.sun.xml.ws.util.xml.XmlUtil.createEntityResolver(XmlUtil.java:266) at org.jvnet.jax_ws_commons.spring.SpringService.getObject(SpringService.java:327) at org.jvnet.jax_ws_commons.spring....

    org.apache.http jar包

    下载HttpClient,解压,在Eclipse中导入所有JAR import org.apache.http.HttpResponse; import org.apache.http.NameValuePair; import org.apache....import org.apache.http.util.EntityUtils;

    org.jbundle.util.osgi.wrapped.org.apache.http.client-4.1.2.jar

    org.jbundle.util.osgi.wrapped.org.apache.http.client-4.1.2.jar

    org.jasig.cas.client.util.CommonUtils

    予org.jasig.cas.client.util.CommonUtils 加入 public static void disableSSLVerification(){ try { // Create a trust manager that does not validate certificate chains TrustManager[] ...

    org.apache.poi JAR包

    import org.apache.poi.hssf.util.HSSFColor; import org.apache.poi.hssf.util.Region; import org.apache.poi.poifs.filesystem.POIFSFileSystem; import org.apache.poi.ss.util.CellRangeAddress; "The import ...

    org.apache.commons.net.util.jar

    org.apache.commons.net.util.jar

    axis2.jar 解决 org.apache.axis2.util.JavaUtils.callStackToString问题

    &lt;Call Stack = DEBUG_FRAME = org.apache.axis2.util.JavaUtils.callStackToString(JavaUtils.java:564) DEBUG_FRAME = org.apache.axis2.description.ParameterIncludeImpl.debugParameterAdd(ParameterIncludeImpl...

    org.apache.http包

    import org.apache.http.HttpResponse; import org.apache.http.HttpStatus; import org.apache.http.HttpVersion; import org.apache.http.client.HttpClient;...import org.apache.http.util.EntityUtils;

    axis2解决 org.apache.axis2.util.JavaUtils.callStackToString问题

    在开发基于Axis2的Web服务时,可能会遇到各种错误和异常,其中之一就是与`org.apache.axis2.util.JavaUtils.callStackToString`相关的问题。这个问题通常出现在Axis2尝试获取并打印堆栈跟踪信息时。 `...

    关键字user附近有语法错误解决方案

    警告: SQL Error: 156, SQLState: S0001 org.hibernate.exception.SQLGrammarException: could not ...org.hibernate.util.JDBCExceptionReporter logExceptions 严重: 关键字 'user' 附近有语法错误。 的解决方案。

    spring-web-2.5.jar

    org.springframework.web.util.HtmlCharacterEntityReferences.class org.springframework.web.util.HtmlUtils.class org.springframework.web.util.HttpSessionMutexListener.class org.springframework.web.util....

    commons-beanutils-1.7.0

    java.lang.SecurityException: class "org.apache.commons.collections.SequencedHashMap... at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447) at java.lang.Thread.run(Unknown Source)

    org.apache.xmlbeans jar包

    5. **类型安全**:由于XMLBeans是基于XML Schema的,所以它能确保在编译时就能发现类型错误,而不是在运行时。 6. **与其他技术集成**:XMLBeans可以轻松地与其他Java库集成,例如Spring框架,以便在企业级应用中...

    org.bouncycastle完整资源包

    《深入解析org.bouncycastle:Java安全加密与证书权威库》 在Java开发中,安全性是不可或缺的一部分,尤其是在处理敏感数据、网络通信以及数字签名时。`org.bouncycastle`库是一个强大的开源加密库,为Java开发者...

    eclipse3.4关于hibernate tools使用时,出错java.lang.NoClassDefFoundError: org/eclipse/ui/internal/util/SWTResourceUtil

    打到org/eclipse/ui/internal/util/SWTResourceUtil.class 用winrar打开,同时也打开3.4的org.eclipse.ui.workbench_3.4.0.I20080606-1300.jar 到org/eclipse/ui/internal/util目录下 把SWTResourceUtil.class ...

    org.apache.axis2.jar

    org.apache.axis2.jar

    Org.BouncyCastle.Utilities.Encoders 等命名空间所需库

    主要用于加解密,我是在使用解密SM4 时接触到的,在网上代码引用了Org.BouncyCastle.Utilities.Encoders,找不到库 自己在网上找了好久找到了,没有积分的可以去http://www.bouncycastle.org/csharp/ 下载

    htmlparser

    org.htmlparser.util.DefaultParserFeedback.class org.htmlparser.util.FeedbackManager.class org.htmlparser.util.IteratorImpl.class org.htmlparser.util.NodeTreeWalker.class org.htmlparser.util....

    ant.jar下载

    org.apache.tools.ant.util.DOMUtils org.apache.tools.ant.util.Watchdog org.apache.tools.ant.AntClassLoader org.apache.tools.ant.BuildException org.apache.tools.ant.DynamicElement org.apache.tools....

Global site tag (gtag.js) - Google Analytics