question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

NPE during analysis

See original GitHub issue

Hi, when doing analysis I get this error:

Analyzing directoy '/home/vnoel/Linagora/Petals/dev/git/petals/container/petals-esb-default-zip'...
possible options: quiet, nofetch, offline, profiles
analyzing '/home/vnoel/Linagora/Petals/dev/git/petals/container/petals-esb-default-zip'
loaded 1 projects


loaded projects:
org.ow2.petals:petals-esb-default-zip:5.0.3-SNAPSHOT (/home/vnoel/Linagora/Petals/dev/git/petals/container/petals-esb-default-zip/pom.xml)
Read profiles to use in the analyze...
fetching missing parents and boms...
fetched missing projects, 5 resolved projects and 0 unresolved projects
adding projects to graph
Cannot add project org.ow2.petals:petals-esb-default-zip:5.0.3-SNAPSHOT (/home/vnoel/Linagora/Petals/dev/git/petals/container/petals-esb-default-zip/pom.xml) to graph. Cause: null
java.lang.NullPointerException
fr.lteconsulting.pomexplorer.Project.getDeclaredDependencyManagement(Project.java:538)
fr.lteconsulting.pomexplorer.Project.getLocalDependencyManagement(Project.java:450)
fr.lteconsulting.pomexplorer.model.transitivity.DependencyNode.collectDependencyManagement(DependencyNode.java:39)
fr.lteconsulting.pomexplorer.Project.buildDependencyTree(Project.java:798)
fr.lteconsulting.pomexplorer.Project.getDependencyTree(Project.java:654)
fr.lteconsulting.pomexplorer.PomAnalyzer.addProjectToGraph(PomAnalyzer.java:138)
fr.lteconsulting.pomexplorer.PomAnalyzer.analyze(PomAnalyzer.java:85)
fr.lteconsulting.pomexplorer.commands.AnalyzeCommand.directory(AnalyzeCommand.java:28)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
java.lang.reflect.Method.invoke(Method.java:498)
fr.lteconsulting.pomexplorer.commands.Commands.takeCommand(Commands.java:248)
fr.lteconsulting.pomexplorer.AppFactory$1.onWebsocketMessage(AppFactory.java:169)
fr.lteconsulting.pomexplorer.webserver.WebServer$3$1.lambda$onFullTextMessage$0(WebServer.java:190)
java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
java.util.concurrent.FutureTask.run(FutureTask.java:266)
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
java.lang.Thread.run(Thread.java:745)

I ran it with the debugger and apparently dependencyMap is null!

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
gcaliscommented, Sep 28, 2016

The quick fix I applied was to add a null check at Project.Java line 531: if( projectProfiles != null && dependencyMap != null)

0reactions
ltearnocommented, Dec 8, 2016

Thanks to you both, it’s already a long time ago, and i could not find any time before today to re-open the project. Your commit fixes the problem, thank you!

Read more comments on GitHub >

github_iconTop Results From Across the Web

NPE annotation scenarios and static-analysis tools for Java
NPE annotation scenarios and static-analysis tools for Java ... Here is a number of code snippets that can throw NullPointerException. 01: public void...
Read more >
Retrofitting null-safety onto Java at Meta
We developed a new static analysis tool called Nullsafe that is used at Meta to detect NullPointerException (NPE) errors in Java code.
Read more >
Null Pointer Static Analysis
If this happens, we could end up with an NPE when working with fullName. The static null-safety analysis enables tools to report such...
Read more >
NPE.STAT - Klocwork Static Code Analysis
NPE.STAT is reported for the result of a method call being dereferenced when the source code of the method is unavailable, but statistics...
Read more >
How to Fix and Avoid NullPointerException in Java - Rollbar
The java.lang.NullPointerException is a runtime exception in Java that occurs when a variable is accessed which is not pointing to any ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found