Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

log and application.log difference  RSS feed

 
Maulin Vasavada
Ranch Hand
Posts: 1873
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi all,
i am trying to figure out the problem i am facing. here is a what i am facing.....
(problem comes as last point in this list)
- when i use application.log("test log"); in my JSP then it works
- when i use only log("test log"); that doesn't work. i get the following exception trace,
---------------------------------------
Internal error: exception thrown from the servlet service function (uri=/jsp/logTest.jsp): j
avax.servlet.ServletException, stack: javax.servlet.ServletException
at java.lang.Throwable.fillInStackTrace(Native Method)
at java.lang.Throwable.fillInStackTrace(Compiled Code)
at java.lang.Throwable.<init>(Compiled Code)
at java.lang.Exception.<init>(Compiled Code)
at javax.servlet.ServletException.<init>(ServletException.java:122)
at org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:384)
at _jsps._jsp._logTest_jsp._jspService(_logTest_jsp.java:72)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:126)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:826)
at com.netscape.server.http.servlet.NSServletRunner.Service(NSServletRunner.java:507)
, root cause: java.lang.NullPointerException
at javax.servlet.GenericServlet.getServletName(GenericServlet.java:329)
at javax.servlet.GenericServlet.log(GenericServlet.java:261)
at _jsps._jsp._logTest_jsp._jspService(_logTest_jsp.java:62)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:126)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:826)
at com.netscape.server.http.servlet.NSServletRunner.Service(NSServletRunner.java:507)
---------------------------------------
- i did Google search on this issue and i found that in some Tomcat versions we have to put super.init(ServletConfig) in the HttpJspBase's init() method. here is the post that refers to it,
post
- now, i looked at my jspengine.jar file's HttpJspBase code and it doesn't have that super.init() call but the here comes a problem i am unable to figure out-- I have access to two webservers,
1. iPlanet4.1SP3 and
2. iPlanet4.1SP7
and both of these servers have same HttpJspBase files but on 1st server log() method works and on the second server it doesn't. it gives me the exception i mentioned above.
i am not able to understand why this happens?
i tried to apply the logic having look at HttpServlet, GenericServlet, ServletConfig, ServletContext etc classes/interfaces but still i am not able to get the reason...
have anybody faced this problem ever?
thanks
maulin.
 
Maulin Vasavada
Ranch Hand
Posts: 1873
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi all,
i have found one big difference...
on server 1- iPlanet4.1SP3 i have the following Servlet Generated,
public class _nes_logTest extends HttpServlet {...
......
.....
}
this has init(ServletConfig) method that calls super.init(ServletConfig)
and on server-2 - iPlanet4.1SP7 i have the following code,
-------------

-------------
this doesn't have init() method as above and is certainly different...it has variable application that is,
application = pageContext.getServletContext();
.....
so i believe that its the JSP to Servlet Converter that is different and making a mess...
thanks
maulin
 
Mark Howard
Ranch Hand
Posts: 285
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Maulin
No, I haven't had the problem you've described, but it seems your safest bet is to use the implicit variables to reference the methods you need (application.log() in this case). They are after all provided by the JSP engine for that purpose.
Seems unnecessary to have to fiddle with the workings of the generated servlet code
Mark.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!