Coverage As -> JUnit Test in Eclipse Oxygen reports NullPointerException - eclipse

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)

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.

Related

RAD 9.0.1.3 java.lang.NoClassDefFoundError: org.DataFactory error

I have recently updated from RAD 8.5.1 to RAD 9.0.1.3. I am trying to run as JUnit a project that was executing under 8.5.1, and now I am getting an error:
java.lang.NoClassDefFoundError: org.DataFactory
The dataclass in the project and it opens in the editor with no problem. Cleaning the project did not report any errors. Going thru Maven and updating the project does not resolve the issue, The error presents only at run time.
No other changes have been made other than upgrading the version of RAD.

Eclipse Neon cannot start a java debug session

I'm using Eclipse Neon from the release date. Yesterday I got some strange errors in Eclipse and after a reboot of the Eclipse instance everything was gone. I installed Eclipse and my plugins again. Everything is working again but when I launch the Java debugger on one of my project I got the error:
An internal error occurred during: "XXXX".
java.lang.NullPointerException
This error occurs on debugging all my projects also in another workspace. Can someone help me with this? The error is not explaining what the exact problem is.
In the logfile of Eclipse I can found the follow error:
java.lang.NullPointerException
at org.eclipse.jdi.Bootstrap.virtualMachineManager(Bootstrap.java:36)
at org.eclipse.jdt.internal.launching.StandardVMDebugger.getConnector(StandardVMDebugger.java:560)
at org.eclipse.jdt.internal.launching.StandardVMDebugger.run(StandardVMDebugger.java:246)
at org.eclipse.pde.launching.AbstractPDELaunchConfiguration.launch(AbstractPDELaunchConfiguration.java:79)
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:55)
I fully removed my previous Eclipse environment. Settings included.
Installed Eclipse environment from a clean install and installed all my plugins again. The problem was fixed.

Internal error for Jetty plugin in Eclipse

When using the Eclipse Jetty plugin (http://marketplace.eclipse.org/content/eclipse-jetty?mpc=true&mpc_state=), I started to get the following error:
An internal error occurred during: "Launching myProject".
Unknown scope: test,provided
This started to occur for two separate projects, both on Windows and MacOs X systems. Note that a regular Jetty deployment, as well as the Jetty runner Maven plugin, work like a charm, the problem seems to be with the Eclipse plugin only. The problem persists after upgrading the plugin to the newest version. Changing Jetty versions doesn't help as well.
edit: Thanks for the tips so far. The question is what might be the source of this problem and how to get rid of it. The relevant log message is as follows:
!ENTRY org.eclipse.core.jobs 4 2 2016-04-27 09:01:40.914
!MESSAGE An internal error occurred during: "Launching myProject".
!STACK 0
java.lang.IllegalArgumentException: Unknown scope: test,provided
at net.sourceforge.eclipsejetty.util.MavenScope.to(MavenScope.java:109)
at net.sourceforge.eclipsejetty.util.MavenDependencyInfo.create(MavenDependencyInfo.java:98)
at net.sourceforge.eclipsejetty.util.MavenDependencyInfoMap.resolve(MavenDependencyInfoMap.java:141)
at net.sourceforge.eclipsejetty.util.Dependency.create(Dependency.java:39)
at net.sourceforge.eclipsejetty.launch.util.JettyLaunchConfigurationDelegate.getOriginalClasspathEntries(JettyLaunchConfigurationDelegate.java:340)
at net.sourceforge.eclipsejetty.launch.util.JettyLaunchConfigurationDelegate.createJettyConfigurationFile(JettyLaunchConfigurationDelegate.java:791)
at net.sourceforge.eclipsejetty.launch.util.JettyLaunchConfigurationDelegate.getVMArguments(JettyLaunchConfigurationDelegate.java:217)
at org.eclipse.jdt.launching.JavaLaunchDelegate.launch(JavaLaunchDelegate.java:64)
at net.sourceforge.eclipsejetty.launch.util.JettyLaunchConfigurationDelegate.launch(JettyLaunchConfigurationDelegate.java:192)
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:54)
Try running Eclipse with a console and debug info to see if more error details are available: add -console, -consoleLog and -debug to your eclipse.ini to achieve this.
Try using the Run Jetty Run plugin instead of the Maven Jetty plugin

Eclipse error processing file (commencingResolution failed)

All of a sudden I am getting errors in my eclipse grails project (GGTS 3.6.4). I'm wondering if this might be due to codehaus being terminated...
!ENTRY org.eclipse.jdt.core 4 4 2015-06-07 07:47:09.622
!MESSAGE Internal groovy compiler error.
!STACK 0
BUG! exception in phase 'semantic analysis' in source unit '/Users/paul/Documents/GrailsWorkspace/Invoicer/target/work/plugins/fields-1.5.1/grails-app/taglib/grails/plugin/formfields/FormFieldsTagLib.groovy' commencingResolution failed: declaration found, but unexpectedly found no scope for grails.plugin.formfields.FormFieldsTagLib$BeanAndPrefix
at org.codehaus.groovy.control.CompilationUnit.applyToSourceUnits(CompilationUnit.java:1027)
at org.codehaus.groovy.control.CompilationUnit.doPhaseOperation(CompilationUnit.java:648)
at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:597)
at org.codehaus.jdt.groovy.internal.compiler.ast.GroovyCompilationUnitDeclaration.processToPhase(GroovyCompilationUnitDeclaration.java:202)
at org.codehaus.jdt.groovy.internal.compiler.ast.GroovyCompilationUnitDeclaration.resolve(GroovyCompilationUnitDeclaration.java:2202)
at org.eclipse.jdt.internal.compiler.Compiler.process(Compiler.java:827)
at org.eclipse.jdt.internal.compiler.ProcessTaskManager.run(ProcessTaskManager.java:137)
at java.lang.Thread.run(Thread.java:745)
Caused by: org.codehaus.jdt.groovy.internal.compiler.ast.GroovyEclipseBug: commencingResolution failed: declaration found, but unexpectedly found no scope for grails.plugin.formfields.FormFieldsTagLib$BeanAndPrefix
at org.codehaus.jdt.groovy.internal.compiler.ast.JDTResolver.commencingResolution(JDTResolver.java:511)
at org.codehaus.groovy.control.ResolveVisitor.visitClass(ResolveVisitor.java:1283)
at org.codehaus.groovy.control.ResolveVisitor.startResolving(ResolveVisitor.java:167)
at org.codehaus.jdt.groovy.internal.compiler.ast.JDTResolver.startResolving(JDTResolver.java:565)
at org.codehaus.groovy.control.CompilationUnit$1.call(CompilationUnit.java:714)
at org.codehaus.groovy.control.CompilationUnit.applyToSourceUnits(CompilationUnit.java:1018)
... 7 more
I have tried refreshing dependencies as well as removing target and target-eclipse directories.
It seems that Eclipse just lost its mind. I deleted the project then re-imported it. Eclipse told me that it looked like a Grails project but needed to recreate the project file. I allowed it to do so and now it works fine.
got same error (just using Groovy btw) and a project clean did the trick

InconsistenProjectHierarchyException

I have a project with sub-projects (https://github.com/i23098/Collections) that compiles correctly on the command-line. When I try to import the project in Eclipse I get an error and tells me to check the log... Checking it, it has:
!ENTRY org.springsource.ide.eclipse.gradle.core 4 0 2014-11-09 17:03:13.404
!MESSAGE Gradle project hierarchy is inconsistent for '/home/ralmeida/workspace-collections/Collections'
!STACK 0
java.lang.reflect.InvocationTargetException
at org.springsource.ide.eclipse.gradle.core.util.GradleRunnable.run(GradleRunnable.java:113)
at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:122)
Caused by: org.springsource.ide.eclipse.gradle.core.InconsistenProjectHierarchyException: Gradle project hierarchy is inconsistent for '/home/ralmeida/workspace-collections/Collections'
at org.springsource.ide.eclipse.gradle.core.util.ExceptionUtil.inconsistentProjectHierachy(ExceptionUtil.java:82)
at org.springsource.ide.eclipse.gradle.core.GradleModelProvider$GroupedModelProvider.getCachedModel(GradleModelProvider.java:339)
at org.springsource.ide.eclipse.gradle.core.GradleProject.getGradleModel(GradleProject.java:634)
at org.springsource.ide.eclipse.gradle.core.GradleProject.getSkeletalGradleModel(GradleProject.java:653)
at org.springsource.ide.eclipse.gradle.ui.wizards.GradleImportWizardPageOne$11.doit(GradleImportWizardPageOne.java:516)
at org.springsource.ide.eclipse.gradle.core.util.GradleRunnable.run(GradleRunnable.java:105)
... 1 more
Root exception:
org.springsource.ide.eclipse.gradle.core.InconsistenProjectHierarchyException: Gradle project hierarchy is inconsistent for '/home/ralmeida/workspace-collections/Collections'
at org.springsource.ide.eclipse.gradle.core.util.ExceptionUtil.inconsistentProjectHierachy(ExceptionUtil.java:82)
at org.springsource.ide.eclipse.gradle.core.GradleModelProvider$GroupedModelProvider.getCachedModel(GradleModelProvider.java:339)
at org.springsource.ide.eclipse.gradle.core.GradleProject.getGradleModel(GradleProject.java:634)
at org.springsource.ide.eclipse.gradle.core.GradleProject.getSkeletalGradleModel(GradleProject.java:653)
at org.springsource.ide.eclipse.gradle.ui.wizards.GradleImportWizardPageOne$11.doit(GradleImportWizardPageOne.java:516)
at org.springsource.ide.eclipse.gradle.core.util.GradleRunnable.run(GradleRunnable.java:105)
at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:122)
Eclipse IDE for Java EE Developers 4.4.1.20140925-1820
Gradle IDE 3.6.2.201410090835-RELEASE (configured to use gradle wrapper at http://services.gradle.org/distributions/gradle-2.1-bin.zip)
Any ideas?
I just spontaneously ran into this problem myself with a working project. After a bit of investigation, I found that an incorrect value was written into file:
projectDir/.settings/gradle/org.springsource.ide.eclipse.gradle.core.prefs
for the key:
org.springsource.ide.eclipse.gradle.rootprojectloc=
I found simply deleting the bogus value corrected the problem in my case