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.

NullPointerException when writing report

See original GitHub issue

Please delete any un-needed section from the following issue template:

Reporting Bugs/Errors

We get a NullPointerException when running org.owasp:dependency-check-maven:3.3.0:aggregate Log https://gist.github.com/Jidehem/e9b89cb7bd61d2a1973a2f3ec38cb6dc Log summary Failed to execute goal org.owasp:dependency-check-maven:3.3.0:aggregate (default-cli) on project shared-parent […] Caused by: java.lang.NullPointerException at org.owasp.dependencycheck.Engine.writeReports(Engine.java:1115) at org.owasp.dependencycheck.maven.BaseDependencyCheckMojo.runCheck(BaseDependencyCheckMojo.java:1135) at org.owasp.dependencycheck.maven.BaseDependencyCheckMojo.execute(BaseDependencyCheckMojo.java:697) at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)

We have the same issue using version 3.2.1. Main candidates:

  • breaking change in newer version
  • switch to using an oracle database instead of downloading files
  • Enable artifactory analyser I’ll test with earlier versions and check why it worked before. And test only one of the change above if I am allowed to…

Configuration

Maven plugin configuration can be seen here: https://gist.github.com/Jidehem/e9b89cb7bd61d2a1973a2f3ec38cb6dc#file-maven-properties

StackTrace Analysis

According to code https://github.com/jeremylong/DependencyCheck/blob/master/core/src/main/java/org/owasp/dependencycheck/Engine.java, the “database” field is null.

Any idea why this field may be null ?

Issue Analytics

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

github_iconTop GitHub Comments

2reactions
malejpavoukcommented, Feb 13, 2019

We have now encountered the same issue on 4.0.2 gradle plugin. We are using local embedded database for the data.

Caused by: java.lang.NullPointerException
        at org.owasp.dependencycheck.Engine.writeReports(Engine.java:1115)
        at org.owasp.dependencycheck.Engine$writeReports$1.call(Unknown Source)
        at org.owasp.dependencycheck.gradle.tasks.AbstractAnalyze.analyze(AbstractAnalyze.groovy:112)
        at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:73)
        at org.gradle.api.internal.project.taskfactory.StandardTaskAction.doExecute(StandardTaskAction.java:48)
        at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:41)
        at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:28)
        at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:704)
        at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:671)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$2.run(ExecuteActionsTaskExecuter.java:284)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:301)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:293)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:175)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:91)
1reaction
jeremylongcommented, Feb 15, 2019

I found the spot where the exception message was being hidden. This will be resolved in the 5.0.0 release.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Java NullPointerException - Detect, Fix, and Best Practices
The NullPointerException can occur if the argument is being passed as null. The same method can be written as below to avoid  ......
Read more >
java - What is a NullPointerException, and how do I fix it?
A null pointer exception is an indicator that you are using an object without initializing it. For example, below ...
Read more >
Null Pointer Exception In Java - GeeksforGeeks
NullPointerException is thrown when program attempts to use an object reference that has the null value.
Read more >
NullPointerException when running reports with SP24
Some of the reports are failing with NullPointer exception. Below is the stack trace. Same reports are generating fine through the designer.
Read more >
Report Null pointer exception - KNIME Forum
NullPointerExceptions are exceptions that occur when you try to use a reference that points to no location in memory (null) as though it...
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