This week's book giveaway is in the Agile and other Processes forum.
We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line!
See this thread for details.
The moose likes Java in General and the fly likes Help Regarding Exception Report Logs Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Java in General
Reply Bookmark "Help Regarding Exception Report Logs" Watch "Help Regarding Exception Report Logs" New topic
Author

Help Regarding Exception Report Logs

Sachin Negi
Greenhorn

Joined: Feb 02, 2012
Posts: 23
Hello to all the ranchers, i am fairly new in java and currently working in Struts 1.3. My question is more related with java.
Following is the scenario and i am not sure regarding the best approach to be followed.

I want to make a error reporting functionality in my project where in I'm copying stacktrace and inserting it in the database's table say "errorlog" table with type of exception,date, user etc and other fields. But now what i have to do is :
I have to identify the package name, file, method and line number in which the exception occurred with the help of server logs that i have when exception occurs.
But the problem is that the log gives you the exception, file and the line number but it also contains errors that are not in my packages as in HttpServlet.service(HttpServlet.java:710) etc given below:


java.lang.NullPointerException
com.candidate.query.CandSearchAction.execute(CandSearchAction.java:34)
org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:484)
org.apache.struts.action.RequestProcessor.proc ess(RequestProcessor.java:274)
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)
javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)

In above case, i got a null pointer exception in my CandSearchAction.java line number 34.
Now i want to know how to differentiate or extract only the line that points to my java/jsp file, so that i can filter them accordingly.

Can anyone please help regarding this situation or how to approach this problem.. is there any library that i can use or anything that could help me.
Waiting for a response that would help me.
Winston Gutkowski
Bartender

Joined: Mar 17, 2011
Posts: 4747
    
    7

Sachin,

Please don't post in all bold. It's equivalent to shouting!!! and is considered bad manners. I've removed yours this time and for more information, please check the EaseUp (←click) page.

Winston

Isn't it funny how there's always time and money enough to do it WRONG?
Sachin Negi
Greenhorn

Joined: Feb 02, 2012
Posts: 23
Winston Gutkowski wrote:Sachin,

Please don't post in all bold. It's equivalent to shouting!!! and is considered bad manners. I've removed yours this time and for more information, please check the EaseUp (←click) page.

Winston


Thanks Winston..i got it.. Cheerzz
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Help Regarding Exception Report Logs
 
Similar Threads
Hibernate @GeneratedValue problem
BeanUtils.populate error while refreshing the page from search results.
Jboss 5.0 not able to connect to databse
Problem in updating the values with Hibernate
JBoss 5.1.0 and Oracle 10g Configuration Issue with new DataSource