You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Derek Hohls <DH...@csir.co.za> on 2003/02/03 12:31:49 UTC

Battling with null pointer exception

I am looking for help tryhing to track down the cause of  
null pointer exception (my worst type of error to solve).
 
I have an XSP page, containing ESQL; it works fine on my
test machine which has a relatively small subset of data,
but gives errors on the production machine with the full
database.
 
Any general or specific ideas on how to solve this would
be welcome!
 
The error is:
 
<pre>Original exception : java.lang.NullPointerException
 at
org.apache.cocoon.components.language.markup.xsp.EsqlQuery.hasGroupingVarChanged(EsqlQuery.java:266)
 at
org.apache.cocoon.www.stell.reports.reportA_xsp.generate(/usr/local/jakarta-tomcat-4.0.4/work/Standalone/localhost/cocoon/cocoon-files/org/apache/cocoon/www/stell/reports/reportA_xsp.java:2733)
 
and the section of code is:
 
     if (_esql_query.getMaxRows() != -1 && _esql_query.getCurrentRow()
- _esql_query.getSkipRows() == _esql_query.getMaxRows()) \{
       _esql_query.setKeepGoing( false );
     \} else \{\tab //if not, advance normally
       _esql_query.setKeepGoing( _esql_query.nextRow() );  <-- this is
line 2733
     \}
 
 

-- 
This message has been scanned for viruses and dangerous content by 
MailScanner, and is believed to be clean.

"The CSIR exercises no editorial control over E-mail messages and/or
attachments thereto/links referred to therein originating in the
organisation and the views in this message/attachments thereto are
therefore not necessarily those of the CSIR and/or its employees.  
The sender of this e-mail is, moreover, in terms of the CSIR's Conditions
of Service, subject to compliance with the CSIR's internal E-mail and 
Internet Policy."


Re: Battling with null pointer exception

Posted by Antonio Gallardo <ag...@agsoftware.dnsalias.com>.
Derek Hohls dijo:
> I have an XSP page, containing ESQL; it works fine on my
> test machine which has a relatively small subset of data,
> but gives errors on the production machine with the full
> database.

OK. I suppose:
  1-You have 5,000+ rows in your current DB.
  2-The code in the XSP page works fine in your develpment machine.

Solution:
  1-Give more memory to Tomcat and Cocoon.

Detail:

  Suppose you can give 256 MB to Cocoon. then:

    1-For Tomcat, in TOMCAT_ROOT/bin/catalina.sh:

         CATALINA_OPTS='-Xmx256m'

       Also you need to tell Cocoon about that. In cocoon.xconf, search
for store-janitor:

<store-janitor logger="core.store.janitor">
     <parameter name="freememory" value="10000000"/>
     <parameter name="heapsize" value="256000000"/>
     <!-- How often shall the cleanup thread check memory -->
     <parameter name="cleanupthreadinterval" value="15"/>
     <!-- Indicates the thread priority of the cleanup thread -->
     <parameter name="threadpriority" value="5"/>
     <!-- How much percent of the elements of each registered Store shall
     be removed when low on memory. Default 10% -->
     <parameter name="percent_to_free" value="10"/>
  </store-janitor>

More recommendations:
  1- Upgrade to Tomcat 4.1.18

Finally Restart Tomcat! I hope it will help.

Best Regards,

Antonio Gallardo.



---------------------------------------------------------------------
Please check that your question  has not already been answered in the
FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>

To unsubscribe, e-mail:     <co...@xml.apache.org>
For additional commands, e-mail:   <co...@xml.apache.org>