File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JSP and the fly likes log and application.log difference Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » JSP
Reply Bookmark "log and application.log difference" Watch "log and application.log difference" New topic
Author

log and application.log difference

Maulin Vasavada
Ranch Hand

Joined: Nov 04, 2001
Posts: 1863
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.


1. Have fun @ http://faq.javaranch.com/java/JavaRaq
2. Looking for simple infix2postfix conversion and postfix evaluation package? Click here
Maulin Vasavada
Ranch Hand

Joined: Nov 04, 2001
Posts: 1863
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

Joined: Feb 14, 2001
Posts: 285
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.
 
 
subject: log and application.log difference
 
Threads others viewed
jsp:include not working on iP6
exception thrown from the servlet service function
Apache Tomcat Errors???
an error I cannot figure out
How to display Japanese characters in excel sheet?
IntelliJ Java IDE

cast iron skillet 49er

more from paul wheaton's glorious empire of web junk: cast iron skillet diatomaceous earth rocket mass heater sepp holzer raised garden beds raising chickens lawn care CFL flea control missoula heat permaculture