为了账号安全,请及时绑定邮箱和手机立即绑定

这是什么问题

StudentsTest.testSaveStudents

testSaveStudents(hibernate_001.StudentsTest)

org.hibernate.MappingNotFoundException: resource: Students.hbm.xml not found


at org.hibernate.cfg.Configuration.addResource(Configuration.java:738)


at org.hibernate.cfg.Configuration.parseMappingElement(Configuration.java:2188)


at org.hibernate.cfg.Configuration.parseSessionFactory(Configuration.java:2160)


at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:2140)


at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:2093)


at org.hibernate.cfg.Configuration.configure(Configuration.java:2008)


at org.hibernate.cfg.Configuration.configure(Configuration.java:1987)


at hibernate_001.StudentsTest.init(StudentsTest.java:26)


at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)


at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)


at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)


at java.lang.reflect.Method.invoke(Unknown Source)


at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:45)


at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)


at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:42)


at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:27)


at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:30)


at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:263)


at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:68)


at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:47)


at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231)


at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60)


at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229)


at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50)


at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222)


at org.junit.runners.ParentRunner.run(ParentRunner.java:300)


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:459)


at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:675)


at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382)


at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192)




java.lang.NullPointerException


at hibernate_001.StudentsTest.destory(StudentsTest.java:40)


at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)


at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)


at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)


at java.lang.reflect.Method.invoke(Unknown Source)


at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:45)


at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)


at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:42)


at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:36)


at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:263)


at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:68)


at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:47)


at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231)


at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60)


at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229)


at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50)


at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222)


at org.junit.runners.ParentRunner.run(ParentRunner.java:300)


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:459)


at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:675)


at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382)


at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192)




正在回答

3 回答

http://img1.sycdn.imooc.com//57db8e7e000117b909530425.jpg

要加入完整的类路径 包名+类名

0 回复 有任何疑惑可以回复我~
#1

宁敏 提问者

非常感谢!
2016-09-17 回复 有任何疑惑可以回复我~

能看看楼主的代码文件结构  我也遇到相同问题

0 回复 有任何疑惑可以回复我~

举报

0/150
提交
取消

这是什么问题

我要回答 关注问题
意见反馈 帮助中心 APP下载
官方微信