You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@turbine.apache.org by Saravanan kavitha <sa...@yahoo.com> on 2006/09/23 00:12:55 UTC

Turbine Null Pointer Exception

Hello, 
  I am new to this forum. We use Turbine framework in our web application. Sometimes our application throws a null pointer exception in production. We couldnt reproduce the problem in Staging environment. It is happening in the search page. We are storing the search results in a collection vector and storing them in a User temporary storage object for later use. 
   
   
  The sample code is as follows: 
  Search.java 
   
  TableViewMgr tvm = (TableViewMgr) data.getUser().getTemp("CasesReportsTVM"); 
  ----- 
  ----- 
  if (searchString != null) { if (searchString.equalsIgnoreCase("yes")) 
  {
   // query the database and populate the TableViewMgr 
  // with the search results tvm.setManagedData(getDocuments(context)); 
  // sort by the job number 
  if (formBean.getTypeSearch().equals("oneday")) 
  { 
  tvm.sortBy("reportnum", prefs.getSortOrder()); 
  } 
  else 
  { 
  tvm.sortBy("rundate", "descending"); 
  }
   
  } 
  } 
   
  The exception throws in this line : tvm.setManagedData(getDocuments(context)); Its not happening always. once in a while(monthly once) it throws this error for random user. I tried to reproduce the problem by using the back button or double clicking the 'submit' button or come from the bookmark. But i couldnt reproduce the problem. Any suggestion would be really appreciated. Thanks a lot.
   
  regards,
  Kavitha.

Re: Turbine Null Pointer Exception

Posted by Thomas Vandahl <tv...@apache.org>.
Saravanan kavitha wrote:
>   The sample code is as follows: 
>   Search.java 
>    
>   TableViewMgr tvm = (TableViewMgr) data.getUser().getTemp("CasesReportsTVM"); 
>   ----- 
>   ----- 
>   if (searchString != null) { if (searchString.equalsIgnoreCase("yes")) 
>   {
>    // query the database and populate the TableViewMgr 
>   // with the search results tvm.setManagedData(getDocuments(context)); 
>   // sort by the job number 
>   if (formBean.getTypeSearch().equals("oneday")) 
>   { 
>   tvm.sortBy("reportnum", prefs.getSortOrder()); 
>   } 
>   else 
>   { 
>   tvm.sortBy("rundate", "descending"); 
>   }
>    
>   } 
>   } 
>    
>   The exception throws in this line : tvm.setManagedData(getDocuments(context)); Its not happening always. once in a while(monthly once) it throws this error for random user. I tried to reproduce the problem by using the back button or double clicking the 'submit' button or come from the bookmark. But i couldnt reproduce the problem. Any suggestion would be really appreciated. Thanks a lot.

I would start with a null-check for tvm. The whole thing may depend on 
your session being valid and things like this.


Bye, Thomas

---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-user-help@jakarta.apache.org