zoukankan      html  css  js  c++  java
  • 关于junit 报空指针异常

    1.junit没有build path

    2.junit的版本有问题,就是说你该换一个junit

    3.Android开发时把Android junit当做java junit使用了,如果你没有安装Android开发环境,就是你不是搞Android开发的,就是1.2的问题

    4.如果前三种没解决问题,这里还有个通用的看日志。查看WorkSpace下的.metadata文件夹下的.log文件,看一下是否存在问题。这里的日志情况我贴一下

    !ENTRY org.python.pydev.shared_core 4 4 2018-07-12 13:49:51.445
    !MESSAGE No message gotten (null message).
    !STACK 0
    java.lang.NullPointerException
    	at org.python.pydev.debug.ui.launching.PythonRunnerConfig.getWorkingDirectory(PythonRunnerConfig.java:210)
    	at org.python.pydev.debug.ui.PythonConsoleLineTracker.initLaunchConfiguration(PythonConsoleLineTracker.java:160)
    	at org.python.pydev.debug.ui.PythonConsoleLineTracker.init(PythonConsoleLineTracker.java:131)
    	at org.eclipse.debug.internal.ui.views.console.ConsoleLineNotifier.connect(ConsoleLineNotifier.java:56)
    	at org.eclipse.ui.internal.console.ConsolePatternMatcher.addPatternMatchListener(ConsolePatternMatcher.java:234)
    	at org.eclipse.ui.console.TextConsole.addPatternMatchListener(TextConsole.java:409)
    	at org.eclipse.debug.internal.ui.views.console.ProcessConsole.<init>(ProcessConsole.java:228)
    	at org.eclipse.debug.internal.ui.views.console.ProcessConsoleManager.launchChanged(ProcessConsoleManager.java:149)
    	at org.eclipse.debug.internal.core.LaunchManager$LaunchNotifier.run(LaunchManager.java:453)
    	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
    	at org.eclipse.debug.internal.core.LaunchManager$LaunchNotifier.notify(LaunchManager.java:433)
    	at org.eclipse.debug.internal.core.LaunchManager.fireUpdate(LaunchManager.java:1043)
    	at org.eclipse.debug.core.Launch.fireChanged(Launch.java:466)
    	at org.eclipse.debug.core.Launch.addProcess(Launch.java:420)
    	at org.eclipse.debug.core.model.RuntimeProcess.<init>(RuntimeProcess.java:126)
    	at org.eclipse.debug.core.DebugPlugin.newProcess(DebugPlugin.java:791)
    	at org.eclipse.jdt.launching.AbstractVMRunner.newProcess(AbstractVMRunner.java:175)
    	at org.eclipse.jdt.internal.launching.StandardVMRunner.run(StandardVMRunner.java:438)
    	at org.eclipse.jdt.junit.launcher.JUnitLaunchConfigurationDelegate.launch(JUnitLaunchConfigurationDelegate.java:204)
    	at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:885)
    	at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:739)
    	at org.eclipse.debug.internal.ui.DebugUIPlugin.buildAndLaunch(DebugUIPlugin.java:1039)
    	at org.eclipse.debug.internal.ui.DebugUIPlugin$8.run(DebugUIPlugin.java:1256)
    	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:56)
    
    !ENTRY org.eclipse.jdt.junit.core 4 4 2018-07-12 13:50:20.011

    看到这里就是junit包出问题了,也就是说出的 问题是2.吧junit jar包版本换一下,问题解决。

  • 相关阅读:
    技术人员转型秘笈
    2007 Office System Beta2 Technical Refresh 下载
    使用Word 2007写blog
    SharePoint WebPart 用户控件包装器 HandsOn Labs
    将Office SharePoint Server 2007 Beta2安装到DC上
    Visual Studio Tools for Office “v3” CTP!
    QuickPart : 用户控件包装器 for SharePoint 2007
    Office SharePoint Server 2007 !
    说说ASP.NET 2.0的书
    闫辉的书:《程序员,建立你的商业意识》
  • 原文地址:https://www.cnblogs.com/Z2978/p/12805901.html
Copyright © 2011-2022 走看看