java.lang.NullPointerException

There are no available Samebug tips for this exception. Do you have an idea how to solve this issue? A short tip would help users who saw this issue last week.

  • It looks like Jenkins builds are not sending emails. Email was triggered for: Failure - Any Sending email for trigger: Failure - Any ERROR: Could not send email as a part of the post-build publishers. java.lang.NullPointerException at hudson.plugins.emailext.ExtendedEmailPublisher.sendMail(ExtendedEmailPublisher.java:379) at hudson.plugins.emailext.ExtendedEmailPublisher._perform(ExtendedEmailPublisher.java:350) at hudson.plugins.emailext.ExtendedEmailPublisher.perform(ExtendedEmailPublisher.java:258) at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20) at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:779) at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:720) at hudson.maven.MavenModuleSetBuild$MavenModuleSetBuildExecution.cleanUp(MavenModuleSetBuild.java:1061) at hudson.model.Run.execute(Run.java:1788) at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:529) at hudson.model.ResourceController.execute(ResourceController.java:98) at hudson.model.Executor.run(Executor.java:410) Email was triggered for: Unstable (Test Failures)/Failure -> Success Trigger Success was overridden by another trigger and will not send an email. Sending email for trigger: Unstable (Test Failures)/Failure -> Success ERROR: Could not send email as a part of the post-build publishers. java.lang.NullPointerException at hudson.plugins.emailext.ExtendedEmailPublisher.sendMail(ExtendedEmailPublisher.java:379) at hudson.plugins.emailext.ExtendedEmailPublisher._perform(ExtendedEmailPublisher.java:350) at hudson.plugins.emailext.ExtendedEmailPublisher.perform(ExtendedEmailPublisher.java:258) at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20) at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:779) at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:720) at hudson.maven.MavenModuleSetBuild$MavenModuleSetBuildExecution.cleanUp(MavenModuleSetBuild.java:1061) at hudson.model.Run.execute(Run.java:1788) at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:529) at hudson.model.ResourceController.execute(ResourceController.java:98) at hudson.model.Executor.run(Executor.java:410) Configuration: <hudson.plugins.emailext.ExtendedEmailPublisher plugin="email-ext@2.47"> <recipientList>$DEFAULT_RECIPIENTS</recipientList> <configuredTriggers> <hudson.plugins.emailext.plugins.trigger.FailureTrigger> <email> <subject>$PROJECT_DEFAULT_SUBJECT</subject> <body>$PROJECT_DEFAULT_CONTENT</body> <recipientProviders> <hudson.plugins.emailext.plugins.recipients.DevelopersRecipientProvider/> <hudson.plugins.emailext.plugins.recipients.UpstreamComitterRecipientProvider/> <hudson.plugins.emailext.plugins.recipients.ListRecipientProvider/> <hudson.plugins.emailext.plugins.recipients.CulpritsRecipientProvider/> </recipientProviders> <attachmentsPattern></attachmentsPattern> <attachBuildLog>false</attachBuildLog> <compressBuildLog>false</compressBuildLog> <replyTo>$PROJECT_DEFAULT_REPLYTO</replyTo> <contentType>project</contentType> </email> </hudson.plugins.emailext.plugins.trigger.FailureTrigger> <hudson.plugins.emailext.plugins.trigger.StillFailingTrigger> <email> <subject>$PROJECT_DEFAULT_SUBJECT</subject> <body>$PROJECT_DEFAULT_CONTENT</body> <recipientProviders> <hudson.plugins.emailext.plugins.recipients.DevelopersRecipientProvider/> <hudson.plugins.emailext.plugins.recipients.UpstreamComitterRecipientProvider/> <hudson.plugins.emailext.plugins.recipients.ListRecipientProvider/> <hudson.plugins.emailext.plugins.recipients.CulpritsRecipientProvider/> </recipientProviders> <attachmentsPattern></attachmentsPattern> <attachBuildLog>false</attachBuildLog> <compressBuildLog>false</compressBuildLog> <replyTo>$PROJECT_DEFAULT_REPLYTO</replyTo> <contentType>project</contentType> </email> </hudson.plugins.emailext.plugins.trigger.StillFailingTrigger> <hudson.plugins.emailext.plugins.trigger.BuildingTrigger> <email> <subject>$PROJECT_DEFAULT_SUBJECT</subject> <body>$PROJECT_DEFAULT_CONTENT</body> <recipientProviders> <hudson.plugins.emailext.plugins.recipients.DevelopersRecipientProvider/> <hudson.plugins.emailext.plugins.recipients.ListRecipientProvider/> <hudson.plugins.emailext.plugins.recipients.UpstreamComitterRecipientProvider/> <hudson.plugins.emailext.plugins.recipients.CulpritsRecipientProvider/> </recipientProviders> <attachmentsPattern></attachmentsPattern> <attachBuildLog>false</attachBuildLog> <compressBuildLog>false</compressBuildLog> <replyTo>$PROJECT_DEFAULT_REPLYTO</replyTo> <contentType>project</contentType> </email> </hudson.plugins.emailext.plugins.trigger.BuildingTrigger> <hudson.plugins.emailext.plugins.trigger.UnstableTrigger> <email> <subject>$PROJECT_DEFAULT_SUBJECT</subject> <body>$PROJECT_DEFAULT_CONTENT</body> <recipientProviders> <hudson.plugins.emailext.plugins.recipients.DevelopersRecipientProvider/> <hudson.plugins.emailext.plugins.recipients.UpstreamComitterRecipientProvider/> <hudson.plugins.emailext.plugins.recipients.ListRecipientProvider/> <hudson.plugins.emailext.plugins.recipients.CulpritsRecipientProvider/> </recipientProviders> <attachmentsPattern></attachmentsPattern> <attachBuildLog>false</attachBuildLog> <compressBuildLog>false</compressBuildLog> <replyTo>$PROJECT_DEFAULT_REPLYTO</replyTo> <contentType>project</contentType> </email> </hudson.plugins.emailext.plugins.trigger.UnstableTrigger> <hudson.plugins.emailext.plugins.trigger.StillUnstableTrigger> <email> <subject>$PROJECT_DEFAULT_SUBJECT</subject> <body>$PROJECT_DEFAULT_CONTENT</body> <recipientProviders> <hudson.plugins.emailext.plugins.recipients.DevelopersRecipientProvider/> <hudson.plugins.emailext.plugins.recipients.UpstreamComitterRecipientProvider/> <hudson.plugins.emailext.plugins.recipients.ListRecipientProvider/> <hudson.plugins.emailext.plugins.recipients.CulpritsRecipientProvider/> </recipientProviders> <attachmentsPattern></attachmentsPattern> <attachBuildLog>false</attachBuildLog> <compressBuildLog>false</compressBuildLog> <replyTo>$PROJECT_DEFAULT_REPLYTO</replyTo> <contentType>project</contentType> </email> </hudson.plugins.emailext.plugins.trigger.StillUnstableTrigger> <hudson.plugins.emailext.plugins.trigger.FixedUnhealthyTrigger> <email> <subject>$PROJECT_DEFAULT_SUBJECT</subject> <body>$PROJECT_DEFAULT_CONTENT</body> <recipientProviders> <hudson.plugins.emailext.plugins.recipients.DevelopersRecipientProvider/> <hudson.plugins.emailext.plugins.recipients.UpstreamComitterRecipientProvider/> <hudson.plugins.emailext.plugins.recipients.ListRecipientProvider/> <hudson.plugins.emailext.plugins.recipients.CulpritsRecipientProvider/> </recipientProviders> <attachmentsPattern></attachmentsPattern> <attachBuildLog>false</attachBuildLog> <compressBuildLog>false</compressBuildLog> <replyTo>$PROJECT_DEFAULT_REPLYTO</replyTo> <contentType>project</contentType> </email> </hudson.plugins.emailext.plugins.trigger.FixedUnhealthyTrigger> </configuredTriggers> <contentType>default</contentType> <defaultSubject>$DEFAULT_SUBJECT</defaultSubject> <defaultContent>$DEFAULT_CONTENT</defaultContent> <attachmentsPattern></attachmentsPattern> <presendScript>$DEFAULT_PRESEND_SCRIPT</presendScript> <postsendScript>$DEFAULT_POSTSEND_SCRIPT</postsendScript> <attachBuildLog>false</attachBuildLog> <compressBuildLog>false</compressBuildLog> <replyTo>$DEFAULT_REPLYTO</replyTo> <saveOutput>false</saveOutput> <disabled>false</disabled> </hudson.plugins.emailext.ExtendedEmailPublisher>
    via by Christopher Febles,
  • Since we upgraded to Jenkins 1.577 (we also upgraded the Email Ext plugin to the latest 2.38.2), we now have NPE when our jobs fail and an email is trying to be sent: {noformat} The label "_xwiki_bin_get_Blog_GlobalBlogRss" caused the build to fail Build step 'Publish Performance test result report' changed build result to FAILURE Email was triggered for: Failure - Any Sending email for trigger: Failure - Any ERROR: Could not send email as a part of the post-build publishers. java.lang.NullPointerException at hudson.plugins.emailext.ExtendedEmailPublisher.createMail(ExtendedEmailPublisher.java:515) at hudson.plugins.emailext.ExtendedEmailPublisher.sendMail(ExtendedEmailPublisher.java:290) at hudson.plugins.emailext.ExtendedEmailPublisher._perform(ExtendedEmailPublisher.java:281) at hudson.plugins.emailext.ExtendedEmailPublisher.perform(ExtendedEmailPublisher.java:233) at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20) at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:770) at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:734) at hudson.maven.MavenModuleSetBuild$MavenModuleSetBuildExecution.cleanUp(MavenModuleSetBuild.java:1064) at hudson.model.Run.execute(Run.java:1786) at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:529) at hudson.model.ResourceController.execute(ResourceController.java:89) at hudson.model.Executor.run(Executor.java:240) Finished: FAILURE {noformat} I check the code and the line 515 of ExtendedEmailPublisher.java: {noformat} for (RecipientProvider provider : context.getTrigger().getEmail().getRecipientProviders()) { {noformat} So this means either: * context is null * getTrigger() returns null * getEmail() returns null Any idea? Thanks
    via by Vincent Massol,
  • Since we upgraded to Jenkins 1.577 (we also upgraded the Email Ext plugin to the latest 2.38.2), we now have NPE when our jobs fail and an email is trying to be sent: {noformat} The label "_xwiki_bin_get_Blog_GlobalBlogRss" caused the build to fail Build step 'Publish Performance test result report' changed build result to FAILURE Email was triggered for: Failure - Any Sending email for trigger: Failure - Any ERROR: Could not send email as a part of the post-build publishers. java.lang.NullPointerException at hudson.plugins.emailext.ExtendedEmailPublisher.createMail(ExtendedEmailPublisher.java:515) at hudson.plugins.emailext.ExtendedEmailPublisher.sendMail(ExtendedEmailPublisher.java:290) at hudson.plugins.emailext.ExtendedEmailPublisher._perform(ExtendedEmailPublisher.java:281) at hudson.plugins.emailext.ExtendedEmailPublisher.perform(ExtendedEmailPublisher.java:233) at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20) at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:770) at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:734) at hudson.maven.MavenModuleSetBuild$MavenModuleSetBuildExecution.cleanUp(MavenModuleSetBuild.java:1064) at hudson.model.Run.execute(Run.java:1786) at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:529) at hudson.model.ResourceController.execute(ResourceController.java:89) at hudson.model.Executor.run(Executor.java:240) Finished: FAILURE {noformat} I check the code and the line 515 of ExtendedEmailPublisher.java: {noformat} for (RecipientProvider provider : context.getTrigger().getEmail().getRecipientProviders()) { {noformat} So this means either: * context is null * getTrigger() returns null * getEmail() returns null Any idea? Thanks
    via by Vincent Massol,
  • List of plugins used in project: multiple-scms mercurial subversion nant sonar flexible-publish email-ext I perform a fairly simple build, use the flexible-plugin to only archive on success and then send an email. Without "attach build log" checked everything works, with it checked I get the following error: Run condition [Current build status] enabling perform for step [Archive the artifacts] Archiving artifacts Checking for post-build Performing post-build step Checking if email needs to be generated Email was triggered for: Success Sending email for trigger: Success NOT overriding default server settings, using Mailer to create session messageContentType = text/plain; charset=UTF-8 Request made to attach build log Adding recipients from recipient list Successfully created MimeMessage Sending email to: MY.USERNAME@MYPLACEOFEMPLOYMENT.com ERROR: Could not send email as a part of the post-build publishers. java.lang.NullPointerException at hudson.plugins.emailext.ExtendedEmailPublisher.sendMail(ExtendedEmailPublisher.java:311) at hudson.plugins.emailext.ExtendedEmailPublisher._perform(ExtendedEmailPublisher.java:289) at hudson.plugins.emailext.ExtendedEmailPublisher.perform(ExtendedEmailPublisher.java:249) at hudson.tasks.BuildStepMonitor$3.perform(BuildStepMonitor.java:36) at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:718) at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:693) at hudson.model.Build$BuildExecution.cleanUp(Build.java:192) at hudson.model.Run.execute(Run.java:1546) at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46) at hudson.model.ResourceController.execute(ResourceController.java:88) at hudson.model.Executor.run(Executor.java:237) Some error occured trying to send the email...check the Jenkins log
    via by Mark Orchard,
  • NullPointerException when sending post build emails - all triggers appear to be impacted Seems there may be a conflict between * Jenkins ver. 1.494 * Jenkins Email Extension Plugin ver. 2.25 & 2.24.1 I upgraded my jenkins instance yesterday from 1.493 to 1.494 and then noticed that builds no longer sent email alerts as expected when status changed. Am using the Email Extension Plugin to trigger email alerts mainly when build meets the following conditions: * first time failure * fixed To get things working again, I needed to rollback my jenkins instance to v 1.493 as it appeared that with both ver. 2.25 & 2.24.1 of the mail plugin, mail did not send properly. As soon as I rolled back the jenkins version, mail started working properly again. * 20121217 updated jenkins to v1.494 (and plugins) * 20121218 noticed all email notifications are failing with null pointer error (irc alerts still work) * 20121218 downgraded mail plugin to 2.24.1 (from 2.25.0) - still failing to send emails (all statuses) * 20121218 downgraded jenkins to 1.493 (from 1.494) - mail now sends successfully Info from build log for a build was triggered as 'fixed' (same type of error seen for build that was triggered as 'first failure') {code} IRC notifier plugin: Sending notification to: #alerts Email was triggered for: Fixed Trigger Success was overridden by another trigger and will not send an email. Sending email for trigger: Fixed ERROR: Could not send email as a part of the post-build publishers. java.lang.NullPointerException at hudson.plugins.emailext.ExtendedEmailPublisher.createMail(ExtendedEmailPublisher.java:431) at hudson.plugins.emailext.ExtendedEmailPublisher.sendMail(ExtendedEmailPublisher.java:297) at hudson.plugins.emailext.ExtendedEmailPublisher._perform(ExtendedEmailPublisher.java:289) at hudson.plugins.emailext.ExtendedEmailPublisher.perform(ExtendedEmailPublisher.java:249) at hudson.tasks.BuildStepMonitor$3.perform(BuildStepMonitor.java:36) at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:804) at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:779) at hudson.model.Build$BuildExecution.cleanUp(Build.java:192) at hudson.model.Run.execute(Run.java:1587) at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46) at hudson.model.ResourceController.execute(ResourceController.java:88) at hudson.model.Executor.run(Executor.java:236) Finished: SUCCESS {code}
    via by Jim Yanko,
    • java.lang.NullPointerException at hudson.plugins.emailext.ExtendedEmailPublisher.sendMail(ExtendedEmailPublisher.java:379) at hudson.plugins.emailext.ExtendedEmailPublisher._perform(ExtendedEmailPublisher.java:350) at hudson.plugins.emailext.ExtendedEmailPublisher.perform(ExtendedEmailPublisher.java:258) at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20) at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:779) at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:720) at hudson.maven.MavenModuleSetBuild$MavenModuleSetBuildExecution.cleanUp(MavenModuleSetBuild.java:1061) at hudson.model.Run.execute(Run.java:1788) at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:529) at hudson.model.ResourceController.execute(ResourceController.java:98) at hudson.model.Executor.run(Executor.java:410)
    No Bugmate found.