File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JBoss/WildFly and the fly likes Unable to print stack trace on own log file Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » JBoss/WildFly
Bookmark "Unable to print stack trace on own log file" Watch "Unable to print stack trace on own log file" New topic

Unable to print stack trace on own log file

Dushyant Agarwal
Ranch Hand

Joined: Oct 14, 2007
Posts: 75
In my application using JBoss 4.2.1-GA, I have used JSF+trinidad tag library for view and JPA+EJB 3.0 for the business logic. On persisting an entity into the DB using entity manager I got an exception - java.sql.BatchUpdateException. The stack trace is available in <JBOSS_HOME>/server/default/log/server.log.
I want to set up my own log file in<JBOSS_HOME>/bin. For this I set an error.jsp file with isError attribute true in the page.

This provided me with the implicit exception object. But when I used it to log the stack trace, it provided me with only the stack trace of the FacesException.The rest of the exceptions were not logged into my file.

How can I provide all the exception stack traces that were available in jboss server's log file to my own log file??

[ November 27, 2008: Message edited by: Dushyant Agarwal ]
Peter Johnson

Joined: May 14, 2008
Posts: 5852

Are you saying that when error.jsp display the stack trace that it is not showing the full trace? It is possible that the code providing the stack trace for error.jsp is catching the exception at a different location, hence the differences between it and what is in server.log.

If this does not help, please post the full stack trace as shown in server.log, and the stack trace that you are seeing and also state where that stack trace is appearing (in the browser or in a log file within the bin directory, or ???).

JBoss In Action
I agree. Here's the link:
subject: Unable to print stack trace on own log file
jQuery in Action, 3rd edition