Error: Eclipse 4.5 MARS NullPointerException (JUnit-Tests) - java

I do have a problem with Eclipse 4.5 when building a JUnit Test Class.
I can build all tests with the help of ant in its repository.
I think it is a configuration problem in Eclipse.
I already followed a lot of solutions in this forum:
Cleaning the path of eclipse itself
restarting eclipse
try to compile with JUnit3
try to compile with JUnit4
try another JRE
start the project in a different workspace
The reason why I haven't updated my Eclipse is because my company only uses Eclipse 4.5. So I can't accept an answer to update it.
The error log:
!ENTRY org.eclipse.core.jobs 4 2 2019-09-09 17:55:58.495
!MESSAGE An internal error occurred during: "Launching JUnitEntityDBUtility".
!STACK 0
java.lang.NullPointerException
at org.eclipse.jdt.junit.launcher.JUnitLaunchConfigurationDelegate$ClasspathLocalizer.localURL(JUnitLaunchConfigurationDelegate.java:429)
at org.eclipse.jdt.junit.launcher.JUnitLaunchConfigurationDelegate$ClasspathLocalizer.entryString(JUnitLaunchConfigurationDelegate.java:418)
at org.eclipse.jdt.junit.launcher.JUnitLaunchConfigurationDelegate$ClasspathLocalizer.addEntry(JUnitLaunchConfigurationDelegate.java:405)
at org.eclipse.jdt.junit.launcher.JUnitLaunchConfigurationDelegate$ClasspathLocalizer.localizeClasspath(JUnitLaunchConfigurationDelegate.java:396)
at org.eclipse.jdt.junit.launcher.JUnitLaunchConfigurationDelegate.getClasspath(JUnitLaunchConfigurationDelegate.java:373)
at org.eclipse.jdt.junit.launcher.JUnitLaunchConfigurationDelegate.launch(JUnitLaunchConfigurationDelegate.java:147)
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)

Delete and recreate your JUnitEntityDBUtility launch configuration.
The stack trace can be found here and here. At the second finding you will find the explanation and a workaround by Moritz Eysholdt for your issue as follows (highlighting by me):
That NPE occurs if you execute a test's launch config in an Eclipse
that does not have the plugin org.eclipse.jdt.junit4.runtime.patch
installed when the launch config was created by an Eclipse that did
actually have org.eclipse.jdt.junit4.runtime.patch installed.
Workaround: Install org.eclipse.jdt.junit4.runtime.patch via the Xpect
update site or delete+recreate your launch configuration.
[...]

Related

Intellij Checkstyle gives error NoClassDefFoundError

I have Intellij 2017.2.3 and Checkstyle-IDEA 5.10.0 running on my Ubuntu 17 dekstop. When i try to add a checkstyle for my Java project (at Settings->Other settings->Checkstyle) I get this error message:
java.lang.NoClassDefFoundError: org/apache/commons/collections/FastHashMap
at org.apache.commons.beanutils.PropertyUtilsBean.getPropertyDescriptor(PropertyUtilsBean.java:963)
at org.apache.commons.beanutils.BeanUtilsBean.copyProperty(BeanUtilsBean.java:391)
at com.puppycrawl.tools.checkstyle.api.AutomaticBean.tryCopyProperty(AutomaticBean.java:217)
at com.puppycrawl.tools.checkstyle.api.AutomaticBean.contextualize(AutomaticBean.java:249)
at com.puppycrawl.tools.checkstyle.Checker.setupChild(Checker.java:455)
at com.puppycrawl.tools.checkstyle.api.AutomaticBean.configure(AutomaticBean.java:186)
at org.infernus.idea.checkstyle.service.cmd.OpCreateChecker.execute(OpCreateChecker.java:58)
at org.infernus.idea.checkstyle.service.cmd.OpCreateChecker.execute(OpCreateChecker.java:26)
at org.infernus.idea.checkstyle.service.CheckstyleActionsImpl.executeCommand(CheckstyleActionsImpl.java:126)
at org.infernus.idea.checkstyle.service.CheckstyleActionsImpl.createChecker(CheckstyleActionsImpl.java:56)
at org.infernus.idea.checkstyle.service.CheckstyleActionsImpl.createChecker(CheckstyleActionsImpl.java:47)
at org.infernus.idea.checkstyle.checker.CheckerFactoryWorker.run(CheckerFactoryWorker.java:44)
Is it familiar for anyone?
I got the same issue while migrating the project from WAS 8 to WAS Liberty.
I did copying the jar commons-collections.jar in to the server location /servers/<server_name>/lib/global and resolved it.
So try to place the jar at IntelliJ local server.
java.lang.NoClassDefFoundError: org.apache.commons.collections.FastHashMap
at org.apache.commons.beanutils.PropertyUtilsBean.getPropertyDescriptor(PropertyUtilsBean.java:963)
at org.apache.commons.beanutils.BeanUtilsBean.setProperty(BeanUtilsBean.java:935)
at org.apache.commons.beanutils.BeanUtilsBean.populate(BeanUtilsBean.java:823)
at org.apache.commons.beanutils.BeanUtils.populate(BeanUtils.java:431)
at org.apache.struts.util.RequestUtils.populate(RequestUtils.java:1252)

Lombok Eclipse issue: "Requesting Java AST from selection"

I have Lombok plugin installed in my Eclipse. It was working fine till now since many days. All of a sudden I am frequently getting a popup in my Eclipse with the following details:
An error has occurred. See error log for more details.
lombok/launch/PatchFixesHider$PatchFixes
An internal error occurred during: "Requesting Java AST from selection".
lombok/launch/PatchFixesHider$PatchFixes
The Eclipse error log has this:
!ENTRY org.eclipse.ui.workbench 4 2 2016-08-29 13:18:38.631
!MESSAGE Problems occurred when invoking code from plug-in: "org.eclipse.ui.workbench".
!STACK 0
java.lang.LinkageError: lombok/launch/PatchFixesHider$PatchFixes
at org.eclipse.jdt.internal.ui.search.OccurrencesFinder.addUsage(OccurrencesFinder.java)
at org.eclipse.jdt.internal.ui.search.OccurrencesFinder.visit(OccurrencesFinder.java:158)
at org.eclipse.jdt.core.dom.QualifiedName.accept0(QualifiedName.java:168)
at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:2711)
at org.eclipse.jdt.core.dom.ASTNode.acceptChild(ASTNode.java:2759)
at org.eclipse.jdt.core.dom.PackageDeclaration.accept0(PackageDeclaration.java:225)
at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:2711)
at org.eclipse.jdt.core.dom.ASTNode.acceptChild(ASTNode.java:2759)
Eclipse version :
Eclipse Java EE IDE for Web Developers.
Version: Neon Release (4.6.0)
Build id: 20160613-1800
This popup is occurring quite frequently and its very annoying.Does anyone knows the solution to fix this?
Removed older jar and updated with latest lombok jar (version 1.16.10).. restarted my system. this fixed this issue. Not sure what was the cause of this issue though.
Had the same issue, restarting Eclipse was sufficient for me.

Error Installing Maven Software in Eclipse Juno

While trying to install maven in eclipse juno in ubuntu 14 am getting following error:
An error occurred while collecting items to be installed session context was:
(profile=epp.package.jee, phase=org.eclipse.equinox.internal.p2.engine.phases.Collect, operand=, action=). Artifact not found: http://download.eclipse.org/technology/m2e/releases/1.4/1.4.1.20140328-1905/plugins/org.eclipse.m2e.maven.indexer_1.4.1.20140328-1501.jar. http://download.eclipse.org/technology/m2e/releases/1.4/1.4.1.20140328-1905/plugins/org.eclipse.m2e.maven.indexer_1.4.1.20140328-1501.jar
I tried following suggestion given for questions similar to this issue, but am not able to install maven. Your earliest response is appreciated.

Anypoint Studio 5.1.1 with empty properties view

I am running the new Version of AnypointStudio for win 64bit-5.1.0-201503171252 on a Windows 8.1 with Java 8.
If I click on a Element in the flow, I will see only:
.
I check the Eclipse Logfile (AnypointStudio\workspace\.metadata\.log) and find this error:
!ENTRY org.eclipse.e4.ui.workbench 4 2 2015-04-09 19:42:58.236
!MESSAGE Problems occurred when invoking code from plug-in: org.eclipse.e4.ui.workbench".
!STACK 0
java.lang.NoClassDefFoundError: org/mule/tooling/apikit/common/metadata/resolver/APIkitRouterInvokerMetadataResolver$1$1
at org.mule.tooling.apikit.common.metadata.resolver.APIkitRouterInvokerMetadataResolver$1.call(APIkitRouterInvokerMetadataResolver.java:65)
at org.mule.tooling.apikit.common.metadata.resolver.APIkitRouterInvokerMetadataResolver$1.call(APIkitRouterInvokerMetadataResolver.java:1)
at org.mule.tooling.utils.SilentRunner.run(SilentRunner.java:16)
I try this on different Workstation with the same error.
I search the missing class and found this file in the plugin folder:
AnypointStudio-for-win-64bit-5.1.0-201503171252\AnypointStudio\plugins\org.mule.tooling.apikit.common_1.6.1.201503121950\org\mule\tooling\apikit\common\metadata\resolver\APIkitRouterInvokerMetadataResolver$1$1.class
have you tried removing the older APIKit plugin and only installing the latest? It could be a conflict between the different versions.
HTH,
Eva

java.lang.NullPointerException when creating first android app in OS X 10.9.4

I just download Eclipse JUNO IDE for Android Developers v. 23.0.2.1259578
I am using as a jre:
/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home
but i can't get rid of this error when i build my first android app.
Errors occurred during the build.
Errors running builder 'Android Resource Manager' on project 'HelloWorld'.
java.lang.NullPointerException
I am following this tutorial, but i can't even reach the last step (the problem occurs when i click the Finish button) : http://developer.android.com/training/basics/firstapp/creating-project.html
Here the see workspace/.metadata/.log :
!MESSAGE Errors running builder 'Android Resource Manager' on project 'HelloWorld'.
!STACK 0
java.lang.NullPointerException
at com.android.ide.eclipse.adt.internal.build.builders.BaseBuilder.abortOnBadSetup(BaseBuilder.java:327)
at com.android.ide.eclipse.adt.internal.build.builders.ResourceManagerBuilder.build(ResourceManagerBuilder.java:92)
at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:726)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:199)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:239)
at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:292)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:295)
at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:351)
at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:374)
at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:143)
at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:241)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:53)
Solved !
Bring up $ADT_DIR/eclipse/Eclipse.app/Contents/MacOS/eclipse.ini in an editor. Before the -vmargs line, insert these two lines:
-vm
/System/Library/Frameworks/JavaVM.framework/Versions/1.6/Commands/java
The newer versions of Android require JDK 1.7. I would try using that.
I run into such problem recently too. When i create a new Activity, i click the finish or next button in the final step, but nothing happens. When i create a new project that error message pop up every time. Then i recalled that i installed SVN on Eclipse about two month ago. So i uninstalled SVN yesterday, everything works out fine now!!! So i think maybe some plugins you installed on your eclipse prevent Android Resource Manager form working properly.
So i suggest you uninstall your plugins and find out whether some of them is wrong.
Hope this would help!

Categories

Resources