This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal



Mar 21, 2012, 11:33 AM
56 Posts

Re: Understanding Java errors

  • Category: Server Side JavaScript
  • Platform: Windows
  • Release: 8.5.3
  • Role: Developer
  • Tags: null pointer error java
  • Replies: 6
Hmm, not sure...
 
But look at the line bwlow line B. You write: if(typeof d.getDocument(true)==null)
 
I think, maybe you forgot a bracket behind typeof. Also I am quite sure that typeof  never returns null, you should try typeof(d.getDocument).equals("undefined") or .equals("")
 
Maybe the error is raised because of the missing bracket, but I will look into your functions a bit deeper.
 
Also, your second method, the getDocument function, why are you using the facesContext and not a dataSource itself? The reason for this method may be helpful for the solution.
Mar 21, 2012, 2:28 PM
9 Posts
Re: Understanding Java errors
 Thanks!
 
I'm not sure where the missing bracket behind typeof is on the following line though: 
 
if (typeof d.getDocument(true)==null) {
sessionScope.informationMessage = "Problem saving the case: myUser.getCurrentDocument()" + " returned null. Please try saving again.";
}
 
 
 I will make the change you mentioned  however to check it's not undefined or "". 
 
As for why it was written this way, it's another example of me trying to code around the problem. We were getting the null document errors when trying to Save a datasource so I thought if I added some code to try and re-establish the connection to the data source it might help. I previously just had currentDocument.save() instead of a call to this function to try and return the document and then save it. Maybe now we have the new server (that seems more stable) I should be reverting the code back to the simple way of doing things and hope that it helps ?  
 
 
  

This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal