M using #helpshift app got crash or initializetion of help shift. please follow the logs   java.lang.RuntimeException: Unable to start service com.helpshift.support.HSRetryService@1aba47b with Intent { cmp=com.quizup.core/com.helpshift.support.HSRetryService }: java.lang.NullPointerException: Attempt to invoke virtual method 'android.database.sqlite.SQLiteDatabase android.content.Context.openOrCreateDatabase(java.lang.String, int, android.database.sqlite.SQLiteDatabase$CursorFactory, android.database.DatabaseErrorHandler)' on a null object reference     at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:4079)     at android.app.ActivityThread.access$2400(ActivityThread.java:221)     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1897)     at android.os.Handler.dispatchMessage(Handler.java:102)     at android.os.Looper.loop(Looper.java:158)     at android.app.ActivityThread.main(ActivityThread.java:7224)     at java.lang.reflect.Method.invoke(Method.java)     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230)     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120) Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'android.database.sqlite.SQLiteDatabase android.content.Context.openOrCreateDatabase(java.lang.String, int, android.database.sqlite.SQLiteDatabase$CursorFactory, android.database.DatabaseErrorHandler)' on a null object reference     at android.database.sqlite.SQLiteOpenHelper.getDatabaseLocked(SQLiteOpenHelper.java:223)     at android.database.sqlite.SQLiteOpenHelper.getReadableDatabase(SQLiteOpenHelper.java:187)     at com.helpshift.support.storage.ProfilesDataSource.read(ProfilesDataSource.java:27)     at com.helpshift.support.storage.ProfilesDataSource.getProfile(ProfilesDataSource.java:61)     at com.helpshift.support.ProfilesManager.getProfile(ProfilesManager.java:25)     at com.helpshift.support.ProfilesManager.getProfileId(ProfilesManager.java:34)     at com.helpshift.support.HSApiData.getProfileId(HSApiData.java:2059)     at com.helpshift.support.HSApiData.sendFailedMessages(HSApiData.java:1626)     at com.helpshift.support.HSRetryService.onStartCommand(HSRetryService.java:17)     at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:4062)
129
What are Null Pointer Exceptions (java.lang.NullPointerException) and what causes them?  What methods/tools can be used to determine the cause so that you stop the exception from causing the program to terminate prematurely?
90464
We noticed that lots of bugs in our software developed in C# (or Java) cause a NullReferenceException.  Is there a reason why "null" has even been included in the language?  After all, if there were no "null", I would have no bug, right?  In other words, what feature in the language couldn't work without null?
7898
The StackExchange app crashes for me on every start when I click a link in the browser. It seems (based on the StackTrace) that the url parser causes a null pointer exception. I'm using 0.1.90.
17767
I've been receiving this error every few days but have no idea what program is causing it.  The error window isn't resizable, so I'm not able to see the program's location.  Is there some other way I can find out what program is causing this? (*Finding the program location is my main objective, see below for the reasoning,)  It doesn't occur when I've just opened/closed a program (Googling, I noticed other people were getting runtime errors when they would open a program, that's not the case for me), it randomly appears while I'm in the middle of doing something (e.g. browsing on Chrome, editing a video, etc. or even with nothing actively open and just looking at a blank Desktop).  Nothing crashes when the error comes up either, all active windows and programs in the system tray stay active.  *:Given how unoften it happens it would be pretty difficult to take suggestions on how to fix the error itself (because I wouldn't be able to simply answer "did it work?" for maybe a week at a time).  For now I think I'll just focus on suggestions for finding the specific program that's causing the error, from there I should be able to search and find the solution myself.  Text version of error:  Microsoft Visual C++ Runtime Library --------------------------- Runtime Error!  Program: C:...  R6025  - pure virtual function call
32438
I've been working on the Android SDK platform, and it is a little unclear how to save an application's state. So given this minor re-tooling of the 'Hello, Android' example:  package com.android.hello;  import android.app.Activity; import android.os.Bundle; import android.widget.TextView;  public class HelloAndroid extends Activity {    private TextView mTextView = null;    /** Called when the activity is first created. */   @Override   public void onCreate(Bundle savedInstanceState) {     super.onCreate(savedInstanceState);      mTextView = new TextView(this);      if (savedInstanceState == null) {        mTextView.setText("Welcome to HelloAndroid!");     } else {        mTextView.setText("Welcome back.");     }      setContentView(mTextView);   } }   I thought it would be enough for the simplest case, but it always responds with the first message, no matter how I navigate away from the app.  I'm sure the solution is as simple as overriding onPause or something like that, but I've been poking away in the documentation for 30 minutes or so and haven't found anything obvious.
56738
In Field Service Lightning I have a Trigger on ServiceReport which sends an email with attachment coming from ContentVersion.   This is the Test class I have written.  @isTest  private class testCreateServiceReport{       static testMethod void validateWO() {       WorkOrder wo = new WorkOrder();       wo.subject = 'Testing';       insert wo;       ServiceAppointment sa = new ServiceAppointment();       sa.ParentRecordId = wo.Id;       sa.EarliestStartTime = DateTime.now();       sa.DueDate = DateTime.now();       insert sa;       List&lt;ServiceReportLayout&gt; srl = [Select Id FROM ServiceReportLayout];       ServiceReport sr = new ServiceReport();       sr.ParentId = sa.Id;       sr.Template = srl[0].Id; //Need to check if there is a way to avoid srl[0] notation       insert sr; //If I comment this the text result is pass. When I enable it I get too see the below mentioned error.  }  }   This is the error Methods defined as TestMethod do not support Web service callouts I know that we need to write Test Classes for code that involves web service callouts using setMock() but I dont understand in what way inserting ServiceReport is related to making a callout.  Any help on this will be really helpful.
90240
I have the below code:  public class CallOutForGet {      HttpRequest request=new Httprequest(); http http=new http(); request.setEndPoint('https://th-apex-http-callout.herokuapp.com/animals'); request.setmethod('GET');  HttpResponse response=http.send(request);  if(response.getStatusCode()==200){      Map&lt;String,Object&gt; results= (Map&lt;String,Object&gt;)JSON.deserializeUntyped(response.getBody());      List&lt;object&gt; animals=(List&lt;object&gt;)results.get('animals');     System.debug('Received Animals************');     for(object anim:animals){         System.debug(anim);     } }  }   This error at line -  request.setEndPoint('https://th-apex-http-callout.herokuapp.com/animals');  says expecting right parenthesis.
104361
I have a test class which calls a method from a helper class :  @isTest private class OpportunityCheckTest {      private CheckTestHelper helper = new CheckTestHelper();      @isTest     static void checkTest() {          helper.incrementCount();  &lt;-- ERROR INDICATES THIS LINE      } }   At the moment when I try to save my file, I'm getting the following error:  Result: [DEPLOYMENT FAILED]: OpportunityCheckTest.cls: Variable does not exist: helper     Can anyone explain what the problem is here?
39520
I opened the Android app and was met by the "Loading stack exchange sites" splash screen. The spinner froze, then a black screen appeared, then the entire app froze. I tried a few more times and was met with the same results.  The full site also works fine on my phone, so it appears to just be the app.   On the iPhone app, I keep getting a "Request timed out. Tap to retry." message when loading the question body. The title gets loaded, as is the HNQ list and my own notifications, but no posts. The mobile site is working.    Requests to the API never load:
113486
I am getting an exception of System.CalloutException: You have uncommitted work pending. Detail of the Exception is given Below:     Exception: :System.CalloutException: You have uncommitted work   pending. Please commit or rollback before calling out   I am using Apex for calling a Webservice. Based on the data returning from the WebService, performing upsert operation in Salesforce Instance. I am performing the following operation on the Salesforce Instance.  1 Performing upsert operation in Campaign Object.  2 Performing upsert Operation in Account Object.  3 Performing upsert Object in Contact Object using AccountID of the earlier inserted Account.  4 Then Adding Contacts as CampaignMember in the Campaign that I have Created earlier.  My code is working fine when There is only one record in the Webservice API but when there are more than one record in the API then getting the Exception of System.CalloutException: You have uncommitted work pending. I have spend one week but did not able to get rid off the exception.  Any help will be much appreciated.  Thanks in advance.
18034
when i try to save the following code, i got the error below. Following same instructions given in this link, but still errors. Am i doing anything wrong here? please suggest.    @isTest private class WebSvcCalloutTest {     @isTest static void testEchoString() {         Account a = new Account(name='Tester',SAP_KUNNR__c='1172');         insert a;                       // This causes a fake response to be generated         Test.setMock(WebServiceMock.class, new WebServiceMockImpl());      } }   Error:  Save error: Method does not exist or incorrect signature: Test.setMock(Type, WebServiceMockImpl)    WebSvcCalloutTest.cls         @isTest global class WebServiceMockImpl implements WebServiceMock {    global void doInvoke(            Object stub,            Object request,            Map&lt;String, Object&gt; response,            String endpoint,            String soapAction,            String requestName,            String responseNS,            String responseName,            String responseType) {          sapComDocumentSapSoapFunctionsMcS.Z_GSSMWFM_HNDL_EVNTRQST00 sap1 = new sapComDocumentSapSoapFunctionsMcS.Z_GSSMWFM_HNDL_EVNTRQST00();                Map&lt;String,String&gt; mapSAP = new Map&lt;String,String&gt; {};         sapComDocumentSapSoapFunctionsMcS.ZgssmbstDatarcrd01 req = new sapComDocumentSapSoapFunctionsMcS.ZgssmbstDatarcrd01();               sapComDocumentSapSoapFunctionsMcS.ZGssmwfmHndlEvntrqst00Response_element ret =  sap1.ZGssmwfmHndlEvntrqst00('',req);         response.put('response_x', ret);     } }
109534
I am trying to write a test class.  My Apex class has the following constructor:  public NController(ApexPages.StandardController controller) {      cas =  (Case) controller.getRecord();     csId = cas.Id;     owner = cas.OwnerId;      N_SSettings__c nhdsms = N_SSettings__c.getValues('Int');     rate=nhdsms.Rate_Code__c;     accId=nhdsms.Acc_Id__c;  }   Here N_SSettings__c is a custom settings which has two fields Rate_Code__c and Acc_Id__c. It has a record called 'Int' with both Rate_Code__c and Acc_Id__c field values populated.  I am using the following test class method:  @isTest public class NHSsendSMSController_Test {     public static testMethod void NHSsendSMSControllerTest()     {         Case caseObj = new Case();         insert caseObj;         ApexPages.StandardController sc = new ApexPages.standardController(caseObj);         NController nControllerObj = new NController(sc);         nControllerObj.methodName();     } }   When I run the test method, it is throwing a null pointer exception on the line :  rate = nhdsms.Rate_Code__c;   The custom setting is definitely present with the required values of both the fields of Int.
92671
public class ExampleClass {       public static void publishCaseUpdateNotifications(List&lt;Case&gt; cases) {     List&lt;Case_Updated__e&gt; notifications = new List&lt;Case_Updated__e&gt;();     for (Case c: cases) {         notifications.add(new Case_Updated__e(             Case__c = (String)c.Id,             CreatedByName__c = UserInfo.getName(),             CaseNumber__c = c.CaseNumber         ));     }       List&lt;Database.SaveResult&gt; results = EventBus.publish(notifications);      for (Database.SaveResult result : results) {         if (!result.isSuccess()) {             for (Database.Error error : result.getErrors()) {                 System.debug('Error returned: ' +                     error.getStatusCode() +' - '+                     error.getMessage());             }         }       }      }    }   My Test Class: getting error   @isTest   public class ExampleTestClass {    @isTest   static void testClassforExample(){         Case testcase = new Case(Subject ='Test',);      list&lt;Case_Updated__e&gt; caseUpdate =      ExampleClass.publishCaseUpdateNotifications(testcase );       }      }   My Error is Method does not exist or incorrect signature: void publishCaseUpdateNotifications(Case) from the type ExampleTestClass   Please suggest me how to resolve this error.     trigger Cases on Case (after insert) { if(Trigger.isAfter) {     System.debug('I will be replaced shortly!'); }  }   Do we need test class for above trigger. Please suggest me too
22922
I have the following versions of OpenJDK installed:  java-1.11.0-openjdk-amd64      1101       /usr/lib/jvm/java-1.11.0-openjdk-amd64 java-1.8.0-openjdk-amd64       1081       /usr/lib/jvm/java-1.8.0-openjdk-amd64   I get the following error using PDFsam in Lubuntu 18.04:   INFO   [12:15:47]: Starting PDFsam INFO   [12:15:48]: Transparent windows not supported by the platform INFO   [12:15:48]: Configuring Sejda 3.2.38 INFO   [12:15:48]: Gestarted in 1 second INFO   [12:15:57]: 3.pdf loaded INFO   [12:15:57]: 4.pdf loaded INFO   [12:15:57]: 5.pdf loaded INFO   [12:15:58]: Starting task (org.sejda.impl.sambox.MergeTask@81b1817) execution. WARN   [12:15:59]: New fonts found, font cache will be re-built WARN   [12:15:59]: Building on-disk font cache, this may take a while ERROR  [12:15:59]: Unexpected error java.lang.NoClassDefFoundError: Could not initialize class org.sejda.sambox.pdmodel.font.PDType1Font at org.sejda.impl.sambox.util.FontUtils.&lt;clinit&gt;(FontUtils.java:74) at org.sejda.impl.sambox.component.PDDocumentHandler.close(PDDocumentHandler.java:231) at org.sejda.common.ComponentsUtility.nullSafeClose(ComponentsUtility.java:63) at org.sejda.common.ComponentsUtility.nullSafeCloseQuietly(ComponentsUtility.java:49) at org.sejda.impl.sambox.MergeTask.closeResources(MergeTask.java:232) at org.sejda.impl.sambox.MergeTask.after(MergeTask.java:237) at org.sejda.core.service.DefaultTaskExecutionService.actualExecution(DefaultTaskExecutionService.java:151) at org.sejda.core.service.DefaultTaskExecutionService.execute(DefaultTaskExecutionService.java:71) at org.sejda.core.service.DefaultTaskExecutionService.execute(DefaultTaskExecutionService.java:58) at org.pdfsam.task.TaskExecutionController.lambda$request$0(TaskExecutionController.java:87) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748)
120449
I am getting this error with the code below. I've looked into the other cases on here. In my case I am referring to a relationship name (__r) which I am assuming is pulling correctly. It's a field which is a lookup to User :   Agreement_CSH_to_be_completed_by__r  Here is the code which is giving me problems :   public void doManagedClients() {         addMsg('Starting processing of Managed Clients.');         Integer startSize = CSH_Data.size();          String SOQL = 'Select Id, OwnerId, Owner.UserName, Account__c, RecordTypeId, Name, Agreement_Client_Status_History__c ' +             'From Contract_Terms__c Where ' +             '   ( recordtypeid = \''+ ((String)A_N_Rectype).substring(0,15) + '\' ) and ' +                '   Agreement_Client_Status_History__c = \'Monthly\' ' +             'order by createddate desc nulls first' ; system.debug('#####333#### ');               addMsg(DEBUG,'Managed Query is: ' + SOQL + '\n');         for (Contract_Terms__c a: Database.Query(SOQL)) {             if (!a.Agreement_CSH_to_be_completed_by__r.isActive) {                 totalInactiveOwners++;                  addMsg('Account: ' + a.Name +  ', has an inactive owner.  Username: ' + a.Agreement_CSH_to_be_completed_by__r.isActive + '.');             } else {                             totalManagedCSHs++;                 addMsg(DEBUG,'Creating a Managed CSH for Account: ' + a);                 CSH_Data.add(new CSH_and_Share_Pair(a, createClientStatusHistory(a)));                 needflush(false);                 if (error) break;             }         }         needflush(true);         addMsg('End of Managed Clients.');           }   Is it just because I don't have a.Agreement_CSH_to_be_completed_by__r included in the SOQL ? I thought I got different errors for that, so I'm a little confused.  Thank you for your help.
101821
while making a call from php i am getting the error      Attempt to de-reference a null object Class.Demo.Insert:   What is problem in my webservice?  global class Ctest{     global class RequestClass{         webservice String accName;     }      webservice static void   cInsert(RequestClass req){         Account a1 = new Account();         a1.Name = req.accName;         insert a1;     } }   And Our Php Code Is  require_once('salesforceAPI/soapclient/SforceEnterpriseClient.php'); require_once('salesforceAPI/soapclient/SforceHeaderOptions.php');  $sfdc = new SforceEnterpriseClient(); $SoapClient = $sfdc-&gt;createConnection('enterprise.wsdl.xml');  $loginResult = false;  $loginResult = $sfdc-&gt;login(USER, PASSWORD . SECURITY_KEY);  $parsedURL = parse_url($sfdc-&gt;getLocation()); define("_SFDC_SERVER_", substr($parsedURL['host'], 0, strpos($parsedURL['host'], '.'))); define("_WS_NAME_", 'salesforceAPI/Ctest'); define("_WS_WSDL_", _WS_NAME_ . '.xml'); define("_WS_ENDPOINT_", 'https://' . _SFDC_SERVER_ . '.salesforce.com/services/wsdl/class/' . _WS_NAME_); define("_WS_NAMESPACE_", 'http://soap.sforce.com/schemas/class/' . _WS_NAME_);  $client = new SoapClient(_WS_WSDL_); $sforce_header = new SoapHeader(_WS_NAMESPACE_, "SessionHeader", array("sessionId" =&gt; $sfdc-&gt;getSessionId())); $client-&gt;__setSoapHeaders(array($sforce_header));  $method = $client-&gt;__getFunctions();  $wsParams = array('accName' =&gt; 'XXXXXXX');  $client-&gt;cInsert($wsParams)
82617
I have been getting below error when trying to deploy new changes from sandbox to production.  chatter_answers_question_escalation_to_case_trigger: trigger body is invalid and failed recompilation: Entity is not org-accessible  Stack Trace: null  This is a trigger on Question (chatter Question) object which I can't find it after summer 16 release. Last successful deployment was on 06/09 and only change we did since yesterday was recompiled all classes and ran All tests.   Any help is greatly appreciated.