You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by Nacho <na...@siapi.es> on 2000/07/05 22:11:23 UTC

RE: Servlet config is null; log() fails

This gives me a stacktrace everytime i hit the page, but with a
interesting thing, it gives a different stack trace in each case, i'm
using Oracle's JDeveloper 3.1 ( which uses jdk 1.2.2_Jdeveloper ) and
jdk l.3.0 here are the "Root Cause" Section for jdk 1.3.0 sun in win2k
box

8<-------------------------------- jdk_1.3.0
Causa Raiz: 
java.lang.NullPointerException
	at
javax.servlet.GenericServlet.getServletName(GenericServlet.java:368)
	at javax.servlet.GenericServlet.log(GenericServlet.java:300)
	at
_0002ftest_0002ejsptest_jsp_0._jspService(_0002ftest_0002ejsptest_jsp_0.
java:56)
	at
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:124)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
	at
org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServle
t.java:177)
	at
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:296)
	at
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:369)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
	at
org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:368)
	at org.apache.tomcat.core.Handler.service(Handler.java:261)
	at
org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:356)
	at
org.apache.tomcat.core.ContextManager.internalService(ContextManager.jav
a:720)
	at
org.apache.tomcat.core.ContextManager.service(ContextManager.java:666)
	at
org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(H
ttpConnectionHandler.java:194)
	at
org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:403
)
	at
org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:48
4)
	at java.lang.Thread.run(Thread.java:484)
8<-------------------------------- jdk_1.3.0

> -----Mensaje original-----
> De: Alex Chaffee [mailto:guru@edamame.stinky.com]
> Enviado el: miércoles 5 de julio de 2000 14:06
> Para: tomcat-dev@jakarta.apache.org
> Asunto: BUG: Servlet config is null; log() fails
> 
> 
> From a servlet or jsp, sometimes, I get a NullPointerException when
> attempting log("foo").  Tracking it down, the null pointer is the
> instance variable "config", which is set inside GenericServlet.init.
> I expect this means that sometimes the servlet engine forgets to call
> init() on a newly-created servlet.  
> 
> Compiling a log() into GenericServlet.init() confirms this, in that it
> always works, meaning that it's not the case that init() is being sent
> a null config object.
> 
> Haven't tracked it down further.  Easy to reproduce -- just make the
> following JSP:
> 
>  <% log("foo"); %>
> 
> Please someone try that tell me if that works for you.
> 
> 
> -- 
> Alex Chaffee                       mailto:alex@jguru.com
> jGuru - Java News and FAQs         http://www.jguru.com/alex/
> Creator of Gamelan                 http://www.gamelan.com/
> Founder of Purple Technology       http://www.purpletech.com/
> Curator of Stinky Art Collective   http://www.stinky.com/
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org
> 

Re: Servlet config is null; log() fails

Posted by Alex Chaffee <gu...@edamame.stinky.com>.
OK! That did it. I'll check it in right away.

Wow. Open Source is cool :-)

 - A


On Thu, Jul 06, 2000 at 12:02:13AM -0700, Alex Chaffee wrote:
> Cool! I'll test that; if it works, I'll check it in.
> 
> Thanks -
> 
>  - Alex
> 
> On Thu, Jul 06, 2000 at 10:07:53AM +0800, Arion Yu wrote:
> > Hi!
> > 
> > I have looked into the code and hope there is something to help you fix the
> > bug.
> > 
> > The method init(ServletConfig) of HttpJspBase store his own config object
> > which is unrelated to the config object in GenericServlet, thus made null
> > pointer exception.
> > 
> > I think a line super.init(config) should be added before the calling of
> > jspInit() in line 95
> > 
> > Arion
> > 
> > Nacho wrote:
> > 
> > > This gives me a stacktrace everytime i hit the page, but with a
> > > interesting thing, it gives a different stack trace in each case, i'm
> > > using Oracle's JDeveloper 3.1 ( which uses jdk 1.2.2_Jdeveloper ) and
> > > jdk l.3.0 here are the "Root Cause" Section for jdk 1.3.0 sun in win2k
> > > box
> > >
> > > 8<-------------------------------- jdk_1.3.0
> > > Causa Raiz:
> > > java.lang.NullPointerException
> > >         at
> > > javax.servlet.GenericServlet.getServletName(GenericServlet.java:368)
> > >         at javax.servlet.GenericServlet.log(GenericServlet.java:300)
> > >         at
> > > _0002ftest_0002ejsptest_jsp_0._jspService(_0002ftest_0002ejsptest_jsp_0.
> > > java:56)
> > >         at
> > > org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:124)
> > >         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
> > >         at
> > > org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServle
> > > t.java:177)
> > >         at
> > > org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:296)
> > >         at
> > > org.apache.jasper.servlet.JspServlet.service(JspServlet.java:369)
> > >         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
> > >         at
> > > org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:368)
> > >         at org.apache.tomcat.core.Handler.service(Handler.java:261)
> > >         at
> > > org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:356)
> > >         at
> > > org.apache.tomcat.core.ContextManager.internalService(ContextManager.jav
> > > a:720)
> > >         at
> > > org.apache.tomcat.core.ContextManager.service(ContextManager.java:666)
> > >         at
> > > org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(H
> > > ttpConnectionHandler.java:194)
> > >         at
> > > org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:403
> > > )
> > >         at
> > > org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:48
> > > 4)
> > >         at java.lang.Thread.run(Thread.java:484)
> > > 8<-------------------------------- jdk_1.3.0
> > >
> > > > -----Mensaje original-----
> > > > De: Alex Chaffee [mailto:guru@edamame.stinky.com]
> > > > Enviado el: miércoles 5 de julio de 2000 14:06
> > > > Para: tomcat-dev@jakarta.apache.org
> > > > Asunto: BUG: Servlet config is null; log() fails
> > > >
> > > >
> > > > From a servlet or jsp, sometimes, I get a NullPointerException when
> > > > attempting log("foo").  Tracking it down, the null pointer is the
> > > > instance variable "config", which is set inside GenericServlet.init.
> > > > I expect this means that sometimes the servlet engine forgets to call
> > > > init() on a newly-created servlet.
> > > >
> > > > Compiling a log() into GenericServlet.init() confirms this, in that it
> > > > always works, meaning that it's not the case that init() is being sent
> > > > a null config object.
> > > >
> > > > Haven't tracked it down further.  Easy to reproduce -- just make the
> > > > following JSP:
> > > >
> > > >  <% log("foo"); %>
> > > >
> > > > Please someone try that tell me if that works for you.
> > > >
> > > >
> > > > --
> > > > Alex Chaffee                       mailto:alex@jguru.com
> > > > jGuru - Java News and FAQs         http://www.jguru.com/alex/
> > > > Creator of Gamelan                 http://www.gamelan.com/
> > > > Founder of Purple Technology       http://www.purpletech.com/
> > > > Curator of Stinky Art Collective   http://www.stinky.com/
> > > >
> > > > ---------------------------------------------------------------------
> > > > To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
> > > > For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org
> > > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
> > > For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org
> > 
> > --
> > [This email and any files transmitted with it are confidential and may
> > contain information that is legally privileged. They are intended solely for
> > the addressee(s). Access to this email by anyone else is unauthorized. If
> > you are not the intended recipient, please delete it and notify the sender
> > by email immediately; you should not copy or use it for any purpose, nor
> > disclose its contents to any other person. Thank you.]
> > 
> > 
> > 
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org
> 
> -- 
> Alex Chaffee                       mailto:alex@jguru.com
> jGuru - Java News and FAQs         http://www.jguru.com/alex/
> Creator of Gamelan                 http://www.gamelan.com/
> Founder of Purple Technology       http://www.purpletech.com/
> Curator of Stinky Art Collective   http://www.stinky.com/
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org

-- 
Alex Chaffee                       mailto:alex@jguru.com
jGuru - Java News and FAQs         http://www.jguru.com/alex/
Creator of Gamelan                 http://www.gamelan.com/
Founder of Purple Technology       http://www.purpletech.com/
Curator of Stinky Art Collective   http://www.stinky.com/

Re: Servlet config is null; log() fails

Posted by Alex Chaffee <gu...@edamame.stinky.com>.
Cool! I'll test that; if it works, I'll check it in.

Thanks -

 - Alex

On Thu, Jul 06, 2000 at 10:07:53AM +0800, Arion Yu wrote:
> Hi!
> 
> I have looked into the code and hope there is something to help you fix the
> bug.
> 
> The method init(ServletConfig) of HttpJspBase store his own config object
> which is unrelated to the config object in GenericServlet, thus made null
> pointer exception.
> 
> I think a line super.init(config) should be added before the calling of
> jspInit() in line 95
> 
> Arion
> 
> Nacho wrote:
> 
> > This gives me a stacktrace everytime i hit the page, but with a
> > interesting thing, it gives a different stack trace in each case, i'm
> > using Oracle's JDeveloper 3.1 ( which uses jdk 1.2.2_Jdeveloper ) and
> > jdk l.3.0 here are the "Root Cause" Section for jdk 1.3.0 sun in win2k
> > box
> >
> > 8<-------------------------------- jdk_1.3.0
> > Causa Raiz:
> > java.lang.NullPointerException
> >         at
> > javax.servlet.GenericServlet.getServletName(GenericServlet.java:368)
> >         at javax.servlet.GenericServlet.log(GenericServlet.java:300)
> >         at
> > _0002ftest_0002ejsptest_jsp_0._jspService(_0002ftest_0002ejsptest_jsp_0.
> > java:56)
> >         at
> > org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:124)
> >         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
> >         at
> > org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServle
> > t.java:177)
> >         at
> > org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:296)
> >         at
> > org.apache.jasper.servlet.JspServlet.service(JspServlet.java:369)
> >         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
> >         at
> > org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:368)
> >         at org.apache.tomcat.core.Handler.service(Handler.java:261)
> >         at
> > org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:356)
> >         at
> > org.apache.tomcat.core.ContextManager.internalService(ContextManager.jav
> > a:720)
> >         at
> > org.apache.tomcat.core.ContextManager.service(ContextManager.java:666)
> >         at
> > org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(H
> > ttpConnectionHandler.java:194)
> >         at
> > org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:403
> > )
> >         at
> > org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:48
> > 4)
> >         at java.lang.Thread.run(Thread.java:484)
> > 8<-------------------------------- jdk_1.3.0
> >
> > > -----Mensaje original-----
> > > De: Alex Chaffee [mailto:guru@edamame.stinky.com]
> > > Enviado el: miércoles 5 de julio de 2000 14:06
> > > Para: tomcat-dev@jakarta.apache.org
> > > Asunto: BUG: Servlet config is null; log() fails
> > >
> > >
> > > From a servlet or jsp, sometimes, I get a NullPointerException when
> > > attempting log("foo").  Tracking it down, the null pointer is the
> > > instance variable "config", which is set inside GenericServlet.init.
> > > I expect this means that sometimes the servlet engine forgets to call
> > > init() on a newly-created servlet.
> > >
> > > Compiling a log() into GenericServlet.init() confirms this, in that it
> > > always works, meaning that it's not the case that init() is being sent
> > > a null config object.
> > >
> > > Haven't tracked it down further.  Easy to reproduce -- just make the
> > > following JSP:
> > >
> > >  <% log("foo"); %>
> > >
> > > Please someone try that tell me if that works for you.
> > >
> > >
> > > --
> > > Alex Chaffee                       mailto:alex@jguru.com
> > > jGuru - Java News and FAQs         http://www.jguru.com/alex/
> > > Creator of Gamelan                 http://www.gamelan.com/
> > > Founder of Purple Technology       http://www.purpletech.com/
> > > Curator of Stinky Art Collective   http://www.stinky.com/
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
> > > For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org
> > >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org
> 
> --
> [This email and any files transmitted with it are confidential and may
> contain information that is legally privileged. They are intended solely for
> the addressee(s). Access to this email by anyone else is unauthorized. If
> you are not the intended recipient, please delete it and notify the sender
> by email immediately; you should not copy or use it for any purpose, nor
> disclose its contents to any other person. Thank you.]
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org

-- 
Alex Chaffee                       mailto:alex@jguru.com
jGuru - Java News and FAQs         http://www.jguru.com/alex/
Creator of Gamelan                 http://www.gamelan.com/
Founder of Purple Technology       http://www.purpletech.com/
Curator of Stinky Art Collective   http://www.stinky.com/

Re: Servlet config is null; log() fails

Posted by Arion Yu <ar...@stt.com.hk>.
Hi!

I have looked into the code and hope there is something to help you fix the
bug.

The method init(ServletConfig) of HttpJspBase store his own config object
which is unrelated to the config object in GenericServlet, thus made null
pointer exception.

I think a line super.init(config) should be added before the calling of
jspInit() in line 95

Arion

Nacho wrote:

> This gives me a stacktrace everytime i hit the page, but with a
> interesting thing, it gives a different stack trace in each case, i'm
> using Oracle's JDeveloper 3.1 ( which uses jdk 1.2.2_Jdeveloper ) and
> jdk l.3.0 here are the "Root Cause" Section for jdk 1.3.0 sun in win2k
> box
>
> 8<-------------------------------- jdk_1.3.0
> Causa Raiz:
> java.lang.NullPointerException
>         at
> javax.servlet.GenericServlet.getServletName(GenericServlet.java:368)
>         at javax.servlet.GenericServlet.log(GenericServlet.java:300)
>         at
> _0002ftest_0002ejsptest_jsp_0._jspService(_0002ftest_0002ejsptest_jsp_0.
> java:56)
>         at
> org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:124)
>         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
>         at
> org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServle
> t.java:177)
>         at
> org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:296)
>         at
> org.apache.jasper.servlet.JspServlet.service(JspServlet.java:369)
>         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
>         at
> org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:368)
>         at org.apache.tomcat.core.Handler.service(Handler.java:261)
>         at
> org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:356)
>         at
> org.apache.tomcat.core.ContextManager.internalService(ContextManager.jav
> a:720)
>         at
> org.apache.tomcat.core.ContextManager.service(ContextManager.java:666)
>         at
> org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(H
> ttpConnectionHandler.java:194)
>         at
> org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:403
> )
>         at
> org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:48
> 4)
>         at java.lang.Thread.run(Thread.java:484)
> 8<-------------------------------- jdk_1.3.0
>
> > -----Mensaje original-----
> > De: Alex Chaffee [mailto:guru@edamame.stinky.com]
> > Enviado el: miércoles 5 de julio de 2000 14:06
> > Para: tomcat-dev@jakarta.apache.org
> > Asunto: BUG: Servlet config is null; log() fails
> >
> >
> > From a servlet or jsp, sometimes, I get a NullPointerException when
> > attempting log("foo").  Tracking it down, the null pointer is the
> > instance variable "config", which is set inside GenericServlet.init.
> > I expect this means that sometimes the servlet engine forgets to call
> > init() on a newly-created servlet.
> >
> > Compiling a log() into GenericServlet.init() confirms this, in that it
> > always works, meaning that it's not the case that init() is being sent
> > a null config object.
> >
> > Haven't tracked it down further.  Easy to reproduce -- just make the
> > following JSP:
> >
> >  <% log("foo"); %>
> >
> > Please someone try that tell me if that works for you.
> >
> >
> > --
> > Alex Chaffee                       mailto:alex@jguru.com
> > jGuru - Java News and FAQs         http://www.jguru.com/alex/
> > Creator of Gamelan                 http://www.gamelan.com/
> > Founder of Purple Technology       http://www.purpletech.com/
> > Curator of Stinky Art Collective   http://www.stinky.com/
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org

--
[This email and any files transmitted with it are confidential and may
contain information that is legally privileged. They are intended solely for
the addressee(s). Access to this email by anyone else is unauthorized. If
you are not the intended recipient, please delete it and notify the sender
by email immediately; you should not copy or use it for any purpose, nor
disclose its contents to any other person. Thank you.]