Re: unable to run log code
can u post the exact errors and also highlight the line where error occurs
Re: unable to run log code
i am getting this error.....plz check it and reply me
type Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
javax.servlet.ServletException: Servlet.init() for servlet LoggerServlet threw exception
org.apache.catalina.valves.ErrorReportValve.invoke (ErrorReportValve.java:117)
org.apache.catalina.connector.CoyoteAdapter.servic e(CoyoteAdapter.java:151)
org.apache.coyote.http11.Http11Processor.process(H ttp11Processor.java:874)
org.apache.coyote.http11.Http11BaseProtocol$Http11 ConnectionHandler.processConnection(Http11BaseProt ocol.java:665)
org.apache.tomcat.util.net.PoolTcpEndpoint.process Socket(PoolTcpEndpoint.java:528)
org.apache.tomcat.util.net.LeaderFollowerWorkerThr ead.runIt(LeaderFollowerWorkerThread.java:81)
org.apache.tomcat.util.threads.ThreadPool$ControlR unnable.run(ThreadPool.java:689)
java.lang.Thread.run(Unknown Source)
root cause
java.lang.NoClassDefFoundError: org/apache/log4j/PropertyConfigurator
logexmaples.LoggerServlet.init(LoggerServlet.java: 22)
javax.servlet.GenericServlet.init(GenericServlet.j ava:212)
org.apache.catalina.valves.ErrorReportValve.invoke (ErrorReportValve.java:117)
org.apache.catalina.connector.CoyoteAdapter.servic e(CoyoteAdapter.java:151)
org.apache.coyote.http11.Http11Processor.process(H ttp11Processor.java:874)
org.apache.coyote.http11.Http11BaseProtocol$Http11 ConnectionHandler.processConnection(Http11BaseProt ocol.java:665)
org.apache.tomcat.util.net.PoolTcpEndpoint.process Socket(PoolTcpEndpoint.java:528)
org.apache.tomcat.util.net.LeaderFollowerWorkerThr ead.runIt(LeaderFollowerWorkerThread.java:81)
org.apache.tomcat.util.threads.ThreadPool$ControlR unnable.run(ThreadPool.java:689)
java.lang.Thread.run(Unknown Source)
root cause
java.lang.ClassNotFoundException: org.apache.log4j.PropertyConfigurator
org.apache.catalina.loader.WebappClassLoader.loadC lass(WebappClassLoader.java:1362)
org.apache.catalina.loader.WebappClassLoader.loadC lass(WebappClassLoader.java:1208)
logexmaples.LoggerServlet.init(LoggerServlet.java: 22)
javax.servlet.GenericServlet.init(GenericServlet.j ava:212)
org.apache.catalina.valves.ErrorReportValve.invoke (ErrorReportValve.java:117)
org.apache.catalina.connector.CoyoteAdapter.servic e(CoyoteAdapter.java:151)
org.apache.coyote.http11.Http11Processor.process(H ttp11Processor.java:874)
org.apache.coyote.http11.Http11BaseProtocol$Http11 ConnectionHandler.processConnection(Http11BaseProt ocol.java:665)
org.apache.tomcat.util.net.PoolTcpEndpoint.process Socket(PoolTcpEndpoint.java:528)
org.apache.tomcat.util.net.LeaderFollowerWorkerThr ead.runIt(LeaderFollowerWorkerThread.java:81)
org.apache.tomcat.util.threads.ThreadPool$ControlR unnable.run(ThreadPool.java:689)
java.lang.Thread.run(Unknown Source)
note The full stack trace of the root cause is available in the Apache Tomcat/5.5.25 logs.
Re: unable to run log code
this is because your log4j jar is not available on the class path. Please ensure its in your tomcats lib folder
Re: unable to run log code
thank u kumar...its wrkng fine....
can u help in another doubt...
Re: unable to run log code
yeah go ahead and ask the question mate
vinod
Re: unable to run log code
i am not aware of logs....but i was kept into new project which should contain logs.
i'll describe about my project which is done on jsp,servlets,core java,html....
its a web application contains 2 modules...
1) Admin ---- can login and view what are the modifications done by the user i.e login,registration,update and
logout timinings
2) User ----- can login and do registration and can do dml,ddl operations.
my query is log file should be created and it should contain whatever user do i.e login,logout,ddl and dml
operations .
i tried some examples regarding logs and log4j....but i am unable to get the answer for my project i.e where to write log file and how to call that log file in coding part i.e in servlet code...
can u help me out... reg. this i tried so much .......
1 Attachment(s)
Re: unable to run log code
hi
have attached two files which shows how to use it
logUnit.java - this class is the master class that needs to be called in all your programs
to use the logger
it has two methods info and err which is used to sysout messages/ errors respectively
admin.java - shows you how to call the logUnit class
this should hopefully help
thanks
vinod
Re: unable to run log code
thanx i'll try it...thanx a lot...bye
Re: unable to run log code
hi,
gud mrng....i tried to run the program on the server but it is showing the output of another program which is previously runned...may i knw whts the prob.
Re: unable to run log code
i m running SimpleLog2 on server it is going to other program which is lastly runned on the server....may i know why it is showing like that.