空指针java.lang.NullPointerException这是什么问题

来源:1-11 通过Hibernate API编写访问数据库的代码

qq_戴绿化纤_0

2019-05-30 22:07

org.opentest4j.MultipleFailuresError: Multiple Failures (2 failures)
 org/dom4j/io/STAXEventReader
 <no message> in java.lang.NullPointerException
 at org.junit.vintage.engine.execution.TestRun.getStoredResultOrSuccessful(TestRun.java:166)
 at org.junit.vintage.engine.execution.RunListenerAdapter.fireExecutionFinished(RunListenerAdapter.java:202)
 at org.junit.vintage.engine.execution.RunListenerAdapter.testFinished(RunListenerAdapter.java:160)
 at org.junit.vintage.engine.execution.RunListenerAdapter.testFinished(RunListenerAdapter.java:76)
 at org.junit.runner.notification.SynchronizedRunListener.testFinished(SynchronizedRunListener.java:56)
 at org.junit.runner.notification.RunNotifier$7.notifyListener(RunNotifier.java:190)
 at org.junit.runner.notification.RunNotifier$SafeNotifier.run(RunNotifier.java:72)
 at org.junit.runner.notification.RunNotifier.fireTestFinished(RunNotifier.java:187)
 at org.junit.internal.runners.model.EachTestNotifier.fireTestFinished(EachTestNotifier.java:38)
 at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:331)
 at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
 at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
 at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
 at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
 at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
 at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
 at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
 at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
 at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
 at org.junit.runner.JUnitCore.run(JUnitCore.java:115)
 at org.junit.vintage.engine.execution.RunnerExecutor.execute(RunnerExecutor.java:40)
 at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:183)
 at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:195)
 at java.base/java.util.Iterator.forEachRemaining(Iterator.java:133)
 at java.base/java.util.Spliterators$IteratorSpliterator.forEachRemaining(Spliterators.java:1801)
 at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:484)
 at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474)
 at java.base/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:150)
 at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:173)
 at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
 at java.base/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:497)
 at org.junit.vintage.engine.VintageTestEngine.executeAllChildren(VintageTestEngine.java:80)
 at org.junit.vintage.engine.VintageTestEngine.execute(VintageTestEngine.java:71)
 at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:229)
 at org.junit.platform.launcher.core.DefaultLauncher.lambda$execute$6(DefaultLauncher.java:197)
 at org.junit.platform.launcher.core.DefaultLauncher.withInterceptedStreams(DefaultLauncher.java:211)
 at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:191)
 at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:137)
 at org.eclipse.jdt.internal.junit5.runner.JUnit5TestReference.run(JUnit5TestReference.java:89)
 at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:41)
 at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:541)
 at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:763)
 at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:463)
 at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:209)

写回答 关注

3回答

  • 爆米不开花
    2019-08-05 13:45:59

    代码贴出来啊

  • 我爱孙佳怡
    2019-06-18 16:37:21

    楼主,这个该怎么解决

  • 慕粉4369414
    2019-06-16 10:24:06

    在使用对象前,只做的了声明,而没有实例化

    我爱孙佳怡

    如何解决?

    2019-06-18 15:55:22

    共 1 条回复 >

Hibernate初探之单表映射

Java持久化框架Hibernate入门教程,掌握Hibernate基本概念

74810 学习 · 793 问题

查看课程

相似问题