« Return to Thread: Clueless about error

Re: Clueless about error

by davidmarginian :: Rate this Message:

Reply to Author | View in Thread

Did you read the docs I sent?  My guess is that you have added a converter for Exception but not one for the fields on Exception (in your case stackTrace).
http://directwebremoting.org/dwr/other/errors.html
 
At the very bottom of the "Exceptions" section this is covered. 
 
"Clearly, permission will be needed to convert nested properties, which includes the stack trace. By default, there is no permission to convert StackTrace elements. It is a good idea to either expose only the information that you wish to expose (better for a live environment):
<convert match="java.lang.Exception" converter="exception">
  <param name='include' value='message,lineNumber'/>
</convert>

Or allow stack traces too, (which can be useful in development):

<convert match="java.lang.StackTraceElement" converter="bean"/>

Aside from the fact that this is obviously insecure, it can also be quite verbose, so it might be best to use this technique only when the browser and web-server are close together in network terms."

- David
 

 
On Mon, Jun 15, 2009 at 2:03 PM, luke_saluti <luke_saluti@...> wrote:

Just to add:

picture the following stack trace:

NumberFormatException java.util.ArrayList
SQLException               lsf.com.teste.Class, line 50

I found impossible to get the messages e lineNumbers that relate
specifically to our company packages. Since the project deals with lots of
developers, this approach has been proven useful to us.
To get it we perform an iteration. Do you see any problems with that? Below
goes the example

function errorHandler(msg, ex)
{
if(ex.stackTrace)
 {
   var stack = ex.stackTrace;
   //looking for the specific lsf root package.
   for(var i = 0 ; i < stack.length && found = false ; i++)
   {
     if(stack[i].className.search(/lsf/) >= 0)
     {
       msgDWR.metodo = stack[i].methodName + "|" + stack[i].lineNumber;
       msgDWR.classe = stack[i].className;
       found = true;
     }
   }
 }

//do something with msgDWR
}
--
View this message in context: http://www.nabble.com/Clueless-about-error-tp24035958p24041880.html
Sent from the DWR - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...


 « Return to Thread: Clueless about error