2

When I run a JUnit 4 test using Code Coverage from within the Eclipse IDE, All I get is a dialog saying "An internal error occurred during: "Launching AlgebraicNumberTest". java.lang.NullPointerException"

The same JUnit test runs fine under the debugger or using just plain run or from a gradle command line. Code coverage works fine when running the main application rather than JUnit tests. I just can't get Code Coverage and the JUnit test to work together. They were working together on this project at one point several months ago. I don't know what's changed.

I'm using JUnit 4.12 and Eclipse Oxygen.3a Release (4.7.3a).

* * * UPDATE * * *

I found the Eclipse log file at %USERPROFILE%\eclipse-workspace.metadata.log.

Here's the exception detail from the log file:

!ENTRY org.eclipse.core.jobs 4 2 2018-07-17 20:43:33.964
!MESSAGE An internal error occurred during: "Launching AlgebraicNumberTest".
!STACK 0
java.lang.NullPointerException
    at org.eclipse.jdt.junit.launcher.JUnitLaunchConfigurationDelegate.launch(JUnitLaunchConfigurationDelegate.java:204)
    at org.eclipse.visualvm.launcher.java.VisualVMJUnitDelegate.launch(VisualVMJUnitDelegate.java:20)
    at org.eclipse.eclemma.core.launching.CoverageLauncher.launch(CoverageLauncher.java:94)
    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)
5
  • 1
    Look in the .log file in the workspace .metadata directory to see if there is a more detailed message. Commented Jul 17, 2018 at 9:12
  • Thanks for the hint about where to find Eclipse's log file. I've added the details from the log file to the original post. Hope they're helpful to someone. Commented Jul 18, 2018 at 1:01
  • Since stack trace contains org.eclipse.visualvm could you try to uninstall VisualVM Eclipse Plugin ? Commented Jul 18, 2018 at 17:41
  • I uninstalled the "VisualVM Launcher Feature 1.1.2" plugin and it seems to have resolved the problem that I originally posted. I have used VisualVM in the past, but not often. Now I guess I'll have to check and see how that is affected, but at least my original issue is resolved for now. Thanks. Commented Jul 18, 2018 at 22:52
  • Reported to VisualVM team as a bug #104. Commented Aug 28, 2018 at 12:34

1 Answer 1

2

I uninstalled the "VisualVM Launcher Feature 1.1.2" plugin as suggested by @Godin. That seems to have resolved the problem that I originally posted.

I plan to eventually reinstall VisualVM. If it causes any problems, I'll post a new question.

Thanks all.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

Draft saved
Draft discarded

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.