Re: Finding Error in Applet.



Sanny wrote:
You are talking on other matters instead of the problem

1. Why I do not put "?" Mark. That has nothing to do with what I
asked.

Why are you unwilling to use question marks to mark your questions?

2. How to Trim Again nothing to do with my problem

But everything to do with people's willingness and ability to volunteer their precious time to help you with it.

3. Write nullException as NoClassDefFoundError

If you report the situation inaccurately, advice given will be inaccurate and likely useless.

Accurate and rigorous information is needed to be of any assistance. Are you sure you don't want to provide that?

My Question is Simple and I restate again

I use double buffering in my applet. I hope you understand what is
double buffering. So my applet cannot be launch by Java Viewer as it
gives nullException.

There is no such exception in the standard Java API. Did you mean NullPointerException?

If so, you should say so. Inaccurate information leads to inaccurate and useless diagnoses.

But my Applet runs without any problem on Web Browsers like Explorer/
Netscape etc.

Sometimes 1 in 10 times it hangs. I just want to get details of
function/ Variable which hang the Program. And also what type of error
is called.

There may not be an error. If an Exception or Error or any other Throwable were thrown, you'd have gotten a message to that effect already.

Did you?

1. Arrayoutof Bounds
2. Division by Zero
3. Memore Full

These are very different categories of problems, reported by different types of Throwable in Java.

Division by zero doesn't even necessarily throw an exception. It could just yield a valid value.

And also I would like to get the Variables [sic] values when it hangs.

You need a reliable way to detect a hang and break out of it for that to happen. Infinite loops and thread deadlock are examples of situations that will not spin out any throwables.

A good logging package, like the inbuilt java.util.logging package or the open-source log4j library, can report the type of information you seek.

If you log at FINE (java.util.logging) or DEBUG (log4j) level, or more detailed, you can spin off log information at various points in your algorithm that can help diagnose even such problems as infinite loops and thread deadlock.

For that I want to use try{ } Catch Statement. But I am not aware how
to do it on all functions?

Do I need to put try{}catch seperately on each function or I can put a
try{ } catch to all function by some way. I just want to know why the
Program hangs 1 in 10 times.

try-catch probably will not reveal the source of your problem.

Use try-catch whenever the code explicitly has a path that might throw an exception. In the catch block be sure to use your logging library to report the exception.

In other situations where try-catch will not help, logging still will.

<http://java.sun.com/javase/6/docs/api/java/util/logging/package-summary.html>
<http://logging.apache.org/log4j/1.2/index.html>

--
Lew
.



Relevant Pages

  • Re: Problem with "handles" - possible garbage collection issue?
    ... | The symptom that users report is that after they have been using the ... You may want to include one or more Global Exception handlers in your ... Use AddHandler in your Sub Main. ...
    (microsoft.public.dotnet.languages.vb)
  • Re: cannot access IE
    ... We have created an error report that you can ... >> vendor code, bla bla. ... Module 1 Image base, Image ...
    (microsoft.public.windows.inetexplorer.ie6.browser)
  • XLANGPart.LoadFrom(stream) failing - UnauthorizedAccessException
    ... My component then generates a PDF stream using Crystal Reports, ... attempts to load the XLANGMessage's 1st data part with the stream generated ... ReportDocument report = new ReportDocument; ... Exception thrown from: segment 1, ...
    (microsoft.public.biztalk.general)
  • Re: cannot access IE
    ... We have created an error report that you can ... >> vendor code, bla bla. ... Module 1 Image base, Image ...
    (microsoft.public.windows.inetexplorer.ie6.browser)
  • Re: Cant receive incoming calls after outgoing.
    ... now I get a TapiException shortly after I hangup the call. ... The exception is ... is called from Call.OnLineCallInfo(LINEMESSAGE msg) which is called ... >>> (the other part hangs up) this function is called. ...
    (microsoft.public.dotnet.framework.compactframework)

Loading