Bug 130166 - NullPointerException thrown by Sitemesh.
NullPointerException thrown by Sitemesh.
Status: CLOSED CURRENTRELEASE
Product: Red Hat Network
Classification: Red Hat
Component: RHN/R&D (Show other bugs)
RHN Devel
All Linux
medium Severity medium
: ---
: ---
Assigned To: Jesus M. Rodriguez
Fanny Augustin
:
Depends On:
Blocks: rhnMilestone1
  Show dependency treegraph
 
Reported: 2004-08-17 13:29 EDT by Jesus M. Rodriguez
Modified: 2007-04-18 13:10 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2004-09-02 14:42:33 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
Full Tomcat webapp log (189.04 KB, text/plain)
2004-09-02 12:12 EDT, Jesus M. Rodriguez
no flags Details

  None (edit)
Description Jesus M. Rodriguez 2004-08-17 13:29:00 EDT
2004-08-17 09:59:29 StandardWrapperValve[default]: Servlet.service() for 
servlet default threw exception
java.lang.NullPointerException
         at 
com.opensymphony.module.sitemesh.filter.PageResponseWrapper.getPage(PageResponseWrapper.java:263)
         at 
com.opensymphony.module.sitemesh.filter.PageFilter.parsePage(PageFilter.java:147)
         at 
com.opensymphony.module.sitemesh.filter.PageFilter.doFilter(PageFilter.java:58)
         at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:186)
         at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
         at 
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214)
         at 
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
         at 
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
         at 
org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:198)
         at 
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:152)
         at 
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
         at 
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
Comment 1 Jesus M. Rodriguez 2004-08-19 14:48:08 EDT
Here's the getPage method from PageResponseWrapper from sitemesh:

    public Page getPage() throws IOException {
        getBufferStream().flush();
        Factory factory = Factory.getInstance(config);
        if (!parseablePage) {
            // just in case setContentType was never called, or called
before content was written to output
            getBufferStream().discardBuffer();
            return null;
        }
        if (aborted)
            return null;
                                                                     
               
        if (page == null) {
            PageParser parser = factory.getPageParser(contentType);
// jesusr: the following line is 263
            return parser.parse(getBufferStream().getBuffer(encoding));
        }
        return page;
    }


During my debugging the factory returned a null parser because the
contentType was null.  But then magically it stopped.  And Mike
couldn't get it to happen either.

I've tried everything, ant clean, stopping/starting tomcat.  I even
got a previous version of rhnjava from 2004-08-17 and did an ant
clean, followed by a full restart of tomcat.  No NullPointer.  So I'm
clueless to what happened to the problem.

I'm reluctant to close this bug since problems aren't supposed to
"disappear".  I recommened keeping it open until Monday 8/23/2004, if
it doesn't reappear first.
Comment 2 Jesus M. Rodriguez 2004-08-19 15:40:50 EDT
Closing now instead of Monday.  If it occurs again, we look at it some
more.
Comment 3 Jesus M. Rodriguez 2004-09-02 12:11:29 EDT
It's BACK!

2004-09-02 12:10:03 StandardWrapperValve[default]: Servlet.service()
for servlet default threw exception
java.lang.NullPointerException
	at
com.opensymphony.module.sitemesh.filter.PageResponseWrapper.getPage(PageResponseWrapper.java:263)
	at
com.opensymphony.module.sitemesh.filter.PageFilter.parsePage(PageFilter.java:147)
	at
com.opensymphony.module.sitemesh.filter.PageFilter.doFilter(PageFilter.java:58)
	at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:186)
	at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
	at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214)
	at
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
	at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
	at
org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:198)
	at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:152)
	at
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
	at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
	at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137)
	at
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
	at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
	at
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
	at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
	at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
	at
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
	at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
	at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:929)
	at
org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160)
	at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:799)
	at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:705)
	at
org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:577)
	at
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683)
	at java.lang.Thread.run(Thread.java:567)
Comment 4 Jesus M. Rodriguez 2004-09-02 12:12:18 EDT
Created attachment 103393 [details]
Full Tomcat webapp log
Comment 5 Jesus M. Rodriguez 2004-09-02 14:42:33 EDT
I put in the some debug into the sitemesh filters and found out that
the contenttype was null, which caused sitemesh to return a null
parser causing the above exception.  I also printed out the request
url which was coming through the null occurred:

http://transam.devel.redhat.com:8080/images/favicon.ico

So I added an exclude to Sitemesh's decorator.xml:

    <excludes>
        <pattern>/images/*</pattern>
    </excludes>

This keeps anything in the /images directory from trying to be decorated.

Note You need to log in before you can comment on or make changes to this bug.