Clueless about error

View: New views
9 Messages — Rating Filter:   Alert me  

Clueless about error

by luke_saluti :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello friends,

I've been logging the thrown javascript ajax errors into a table. Every day i check that a method keeps throwing a error which the only descriptive message says "Error". The count goes daily to 40. What could this message probably mean?

Re: Clueless about error

by davidmarginian :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Luke,
   I would check the server logs, if there is nothing in the logs than I would make sure logging is enabled: http://directwebremoting.org/dwr/server/servlet/logging.html.  DWR does not provide details on Java exceptions unless you have chosen to add a converter for the exception.  So it is possible that a server exception is being thrown - http://directwebremoting.org/dwr/other/errors.html
 
 
 


 
On Mon, Jun 15, 2009 at 8:51 AM, luke_saluti <luke_saluti@...> wrote:

Hello friends,

I've been logging the thrown javascript ajax errors into a table. Every day
i check that a method keeps throwing a error which the only descriptive
message says "Error". The count goes daily to 40. What could this message
probably mean?
--
View this message in context: http://www.nabble.com/Clueless-about-error-tp24035958p24035958.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@...



Re: Clueless about error

by luke_saluti :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

you mean the server logs writen by java methods?
I've already added a converter which works for some other methods.

David Marginian-3 wrote:
Luke,
   I would check the server logs, if there is nothing in the logs than I
would make sure logging is enabled:
http://directwebremoting.org/dwr/server/servlet/logging.html.  DWR does not
provide details on Java exceptions unless you have chosen to add a converter
for the exception.  So it is possible that a server exception is being
thrown - http://directwebremoting.org/dwr/other/errors.html.






On Mon, Jun 15, 2009 at 8:51 AM, luke_saluti <luke_saluti@hotmail.com>wrote:

>
> Hello friends,
>
> I've been logging the thrown javascript ajax errors into a table. Every day
> i check that a method keeps throwing a error which the only descriptive
> message says "Error". The count goes daily to 40. What could this message
> probably mean?
> --
> View this message in context:
> http://www.nabble.com/Clueless-about-error-tp24035958p24035958.html
> Sent from the DWR - Users mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@dwr.dev.java.net
> For additional commands, e-mail: users-help@dwr.dev.java.net
>
>

Re: Clueless about error

by davidmarginian :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Yes, you need to look at the server logs. 
 
"I've already added a converter which works for some other methods."

This doesn't make sense.  Converters are not specific to methods, they are used to marshal return types and parameters into and out of JavaScript.  If the server is throwing an Exception, DWR will not marshal that exception unless you give DWR permission to (by specifying a converter for exception).  Please take the time to read the documentation links I provided.

On Mon, Jun 15, 2009 at 9:35 AM, luke_saluti <luke_saluti@...> wrote:

you mean the server logs writen by java methods?
I've already added a converter which works for some other methods.


David Marginian-3 wrote:
>
> Luke,
>    I would check the server logs, if there is nothing in the logs than I
> would make sure logging is enabled:
> http://directwebremoting.org/dwr/server/servlet/logging.html.  DWR does
> not
> provide details on Java exceptions unless you have chosen to add a
> converter
> for the exception.  So it is possible that a server exception is being
> thrown - http://directwebremoting.org/dwr/other/errors.html.
>

>
>
>
>
>
> On Mon, Jun 15, 2009 at 8:51 AM, luke_saluti
> <luke_saluti@...>wrote:
>
>>
>> Hello friends,
>>
>> I've been logging the thrown javascript ajax errors into a table. Every
>> day
>> i check that a method keeps throwing a error which the only descriptive
>> message says "Error". The count goes daily to 40. What could this message
>> probably mean?
>> --
>> View this message in context:
>> http://www.nabble.com/Clueless-about-error-tp24035958p24035958.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@...
>>
>>
>
>

--
View this message in context: http://www.nabble.com/Clueless-about-error-tp24035958p24037019.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@...



Re: Clueless about error

by luke_saluti :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Thanks for the info, patience and kindness.

David Marginian-3 wrote:
Yes, you need to look at the server logs.

"I've already added a converter which works for some other methods."

This doesn't make sense.  Converters are not specific to methods, they are
used to marshal return types and parameters into and out of JavaScript.  If
the server is throwing an Exception, DWR will not marshal that exception
unless you give DWR permission to (by specifying a converter for
exception).  Please take the time to read the documentation links I
provided.

Re: Clueless about error

by luke_saluti :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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
}

Re: Clueless about error

by davidmarginian :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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).
 
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@...



Re: Clueless about error

by luke_saluti :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I read the content, by the way.
I didn't specify the attribute names that will be marshalled. Because when omitted, all of them become avaiable. But, nonethenless, I will enable only those that I really need, that will improve security and performance. The stackTraceElement is figured out by now. Thank you.

David Marginian-3 wrote:
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">
 
</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@hotmail.com>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@dwr.dev.java.net
> For additional commands, e-mail: users-help@dwr.dev.java.net
>
>

Re: Clueless about error

by davidmarginian :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

That is correct, but that wasn't my point in sending the docs.  Just because all of the fields are available (when includes is omitted) does NOT mean that DWR can convert them.  A converter for the stackTrace element still needs to be specified as it is a complex field that is not converted by default - e.g - <convert match="java.lang.StackTraceElement" converter="bean"/>.  Since you did not include your configuration that was my best guess as to what you were doing wrong.  I am glad you got it working. 

On Mon, Jun 15, 2009 at 3:09 PM, luke_saluti <luke_saluti@...> wrote:

I read the content, by the way.
I didn't specify the attribute names that will be marshalled. Because when
omitted, all of them become avaiable. But, nonethenless, I will enable only
those that I really need, that will improve security and performance. The
stackTraceElement is figured out by now. Thank you.


David Marginian-3 wrote:
>
> 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">
>
> </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@...
>>
>>
>
>

--
View this message in context: http://www.nabble.com/Clueless-about-error-tp24035958p24042089.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@...