An internal error occurred during: "Updating the Maven Project". java.lang.NullPointerException

I am developing a Java EE web project. When I try to add a dependency, this error message appears. I am using Eclipse Kepler.

An internal error occurred during: "Updating the Maven Project". java.lang.NullPointerException

could you help me? Thank.

enter image description here

+85
eclipse java-ee maven m2eclipse
Oct 22 '13 at 16:03
source share
19 answers

I decided to solve the problem by deleting the .settings and .project in the project and then re-import the project.

+139
Nov 12 '13 at 23:00
source share

For me, the answer that I found on CodeRanch by user Maneesh Godbole worked :

  • Close eclipse.
  • Go to the "Workspace" folder
  • Make sure that the setting on your OS to view hidden files is enabled.
  • Identify and delete the directory. metadata li>
  • Restart eclipse
  • Import project
+24
Jun 03 '14 at 13:05
source share

I had the same problem in one of my modules.

Running "mvn eclipse: eclipse" in the / cmd console solved the problem for me.

+5
Oct 23 '13 at 15:18
source share

In our example of this problem, we had pom.xml files, where the m2e life cycle display configuration

 <pluginManagement> <plugins> <plugin> <groupId>org.eclipse.m2e</groupId> <artifactId>lifecycle-mapping</artifactId> <version>1.0.0</version> <configuration> <lifecycleMappingMetadata> ... 

there was no <version>1.0.0</version> . When you do Maven -> Update Project ..., this results in a NullPointerException message without a stack trace. When using the new import ... β†’ Existing Maven projects, the same exception occurred, but with a stack trace that made me find higher.

(This is with m2e 1.6.1.20150625-2338 in Eclipse Luna Service Release 2 (4.4.2).)

+3
Oct 28 '15 at 8:56
source share

In case this helps someone other than removing .settings and .project , I had to remove .classpath and .factorypath before I could successfully import the project into Eclipse.

+2
Dec 16 '14 at 11:35
source share

The org.eclipse.m2e.core.prefs file is located in the .settings folder. If you encounter a problem

An internal error occurred during: "Updating Maven Project". java.lang.NullPointerException

Delete the project from eclipse, and then delete the .settings and .project folder in the project β†’, then re-import the project.

+1
Feb 16 '15 at 19:51
source share

It helped me: Project menu -> Clean... -> clean all projects

+1
Feb 06 '16 at 11:20
source share

removing maven local storage helped me

+1
Jun 09 '17 at 18:07 on
source share

Eclipse has an error log. There you will see a full stack trace. In my case, this is apparently caused by a bad jar file in combination with java.util.zip libs not throwing the correct exception, just a NullPointerException exception.

+1
Jun 13 '17 at 20:42 on
source share

I use:

Eclipse Java EE IDE for web developers.

Version: Neon.3 Release (4.6.3) Build ID: 20170314-1500

The fix / trick for me was deleting my local repository in ~ / .m2 / repository in order to remove local dependencies and rebuild my project in which new dependencies were removed.

+1
Feb 14 '18 at 19:01
source share

I had the same problem. None of the solutions worked here. I had to completely reinstall eclipse and create a new workspace. Then it worked!

0
Dec 03 '14 at 19:52
source share

None of the above methods worked for me. This may also occur due to the presence of a circular dependency in the eclipse workspace. Therefore, if there are any other errors in any of the other projects in your workspace, try fixing them, and then this problem will disappear. This is how I fixed the error.

0
Mar 10 '15 at 12:24
source share

I had the same problem for several projects and several workspaces, none of the solutions that I found on the Internet worked for me. I use STS, and the only thing that worked was to go into my STS directory and add "-clean" to the top of the STS.ini file. Then you can start your workspace and start maven without errors. (you can also remove the -clean tag from the ini file so that it does not clear every time you run it)

Hope this helps someone.

0
May 21 '15 at 13:58
source share

The root problem in my case was a file conflict in the .settings folder. Thus, deleting the .settings folder would resolve the Maven error, but I wanted to save some of my local configuration files. I resolved the conflict, and then tried the Maven update again, and it worked.

0
Aug 19 '15 at 13:30
source share

I had the same ... decision at the end!

here is the eclipse log:

 java.lang.NullPointerException at com.google.appengine.eclipse.wtp.maven.GaeRuntimeManager.getGaeRuntime(GaeRuntimeManager.java:85) at com.google.appengine.eclipse.wtp.maven.GaeRuntimeManager.ensureGaeRuntimeWithSdk(GaeRuntimeManager.java:55) at com.google.appengine.eclipse.wtp.maven.GaeFacetManager.addGaeFacet(GaeFacetManager.java:59) at com.google.appengine.eclipse.wtp.maven.GaeProjectConfigurator.configure(GaeProjectConfigurator.java:46) 

... it comes from the "appengine maven wtp plugin", which tries to get the type of the GAE executable, but here it is null (... getRuntimeType () β†’ NPE):

see class com.google.appengine.eclipse.wtp.maven / GaeRuntimeManager.java

  private static IRuntime getGaeRuntime(String sdkVersion) { IRuntime[] runtimes = ServerCore.getRuntimes(); for (IRuntime runtime : runtimes) { if (runtime != null && **runtime.getRuntimeType()**.equals(GAE_RUNTIME_TYPE)) { 

So, if you close eclipse, the Google App Engine will be visible, but when you select it, you will see that the SDK is not connected ... preference / server / runtime environment

SOLUTION: on red in the screenshot; -)

0
Sep 08 '15 at 16:12
source share

I came across the same symptom, and none of the above solutions helped. I finally got the problem stack trace by importing the ear project again to eclipse, and was able to trace it back to org.eclipse.m2e.wtp.MavenDeploymentDescriptorManagement, which tried to delete the directory in the Windows temporary files directory called .mavenDeploymentDescriptorManagement, which caused an irrational exception NullPointerException from the java.io.File.exists () method, especially because the code already successfully executed the same in the previous method with the same variable, and then threw file.isFile () without a problem.

Checking this file in the file system showed that access to the file is possible only with administrator rights. Apparently, at some point I started eclipse from the admin console by mistake. In the end, I just made the hidden files visible in Windows Explorer and deleted the temporary file manually, which solved the problem.

0
Mar 31 '16 at 11:05
source share

Another possible source of the problem!

I found out that in my case it was the following resource block that called it:

 <project> <build> <resources> <resource> <directory>${basedir}/../some-folder</directory> <targetPath>outputFolder</targetPath> </resource> <resources> </build> </project> 

It includes a folder from the project folder (the eclipse project is a subfolder of the folder with the project version).

In my case, I could remove the error by deleting the block and replacing it with a call to Build Assistant Maven plugin:

 <build> <plugins> <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>build-helper-maven-plugin</artifactId> <version>1.9.1</version> <executions> <execution> <id>my-own-very-cool-id-for-this-step</id> <phase>generate-resources</phase> <goals> <goal>add-resource</goal> </goals> <configuration> <resources> <resource> <directory>${basedir}/../some-folder</directory> <targetPath>outputFolder</targetPath> </resource> </resources> </configuration> </execution> </executions> </plugin> </plugins> </build> 
0
Sep 22 '16 at 9:18
source share

I had to reinstall eclipse, delete the .m2 folder and rebuild the banks.

0
May 23 '17 at 14:20
source share

In my case, the problem was a conflict of derived dependencies that were used by other dependencies, and some of these versions of derived dependencies were not available, possibly because some deployments I forgot to do because everything worked with resolution of the workspace, but when moving in another environment, everything suddenly broke. I also worked with version ranges

maven gave me this error:

Failed to resolve dependencies for project MyProject: MyProject: jar: 1.0.0: Failed to resolve version conflict between Dependency-A: 1.0.1 β†’ Dependency-B: 1.1.0 β†’ Dependency-C: 1.0.0 , Dependency-X: 1.0.1 β†’ Dependency-Y: 1.1.0 β†’ Dependency-C: 1.0.0 , Dependency-I: 1.0.1 β†’ Dependency-J: 1.1.0 β†’ Dependency-C: 1.0.0

I tried everything above and nothing worked, so ...

SOLUTION : use LATEST as the version in all dependencies, so maven does not need to resolve all dependencies in ranges, which should be used with caution, because if you skip the deployment of one of the dependencies, the assembly will fail

0
Jun 28 '19 at 16:36
source share



All Articles