Giter Site home page Giter Site logo

Comments (11)

night avatar night commented on May 19, 2024

Since the error occurs outside of your code, it might just be because of differing runtime version versus compiled Java version. I'd guess this to be a Java bug, not really one of your own.

Obviously the "fix" to this problem would be to fix whatever array index is out of bounds, but without a stack trace I guess that's less than helpful.

from chatty.

MeFisto94 avatar MeFisto94 commented on May 19, 2024

To me this sounds like "printStackTrace" would be an AbstractMethod (i.e. not implemented by the runtime). Maybe some openSource implementation on some linux distributions don't support it accidentally? Or did this also happen on Windows?

You can, however implement your own method for that by iterating. Throwable has some kind of stacktrace you have to iterate over. That would workaround that issue to at least track the error down.

from chatty.

Azzurite avatar Azzurite commented on May 19, 2024

How do you build the application when creating releases? It's probably a mismatch between linked classes.

from chatty.

tduva avatar tduva commented on May 19, 2024

I build it in Netbeans by clicking on "Clean and Build".

from chatty.

Azzurite avatar Azzurite commented on May 19, 2024

Could you please provide the ANT script you created?

from chatty.

Azzurite avatar Azzurite commented on May 19, 2024

Also, it's probably a bad idea to catch Throwable in ErrorHandler.java.
If the AbstractMethodError would not be catched it would probably help debug the problem. Right now, when this error happens, the UI just hangs when it should actually properly crash.

from chatty.

tduva avatar tduva commented on May 19, 2024

I'm not sure how that would give me any more information about the error. The UncaughtExceptionHandler is already the last resort. It informs the user about an error that might require the program to close and logs it to the debug file. So it's not like an error goes unnoticed because of that.

Because e.printStackTrace() on the Exception failed with an AbstractMethodError (and I think NullPointerExceptions), I added the catch Throwable in an attempt to log any useful information about the original error, which is the same as in the first post:

10:50:44 Unhandled Exception:
Exception java.lang.AbstractMethodError: java.lang.Throwable.printStackTrace(Ljava/io/PrintWriter;)V
    occured during logging of uncaught exception: java.lang.ArrayIndexOutOfBoundsException [Thread[AWT-EventQueue-0,6,main]]

Before it was something like this over an over again, which also could freeze the GUI, because of course an Exception in the ErrorHandler is also caught again by the ErrorHandler:

15:48:39 Unhandled Exception:
java.lang.AbstractMethodError: java.lang.Throwable.getStackTrace()[Ljava/lang/StackTraceElement;
    at chatty.ErrorHandler.uncaughtException(ErrorHandler.java:30)
    at java.lang.ThreadGroup.uncaughtException(Unknown Source)
    at java.lang.ThreadGroup.uncaughtException(Unknown Source)
    at java.awt.EventDispatchThread.processException(Unknown Source)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
    at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
    at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    at java.awt.EventDispatchThread.run(Unknown Source)

15:48:39 Unhandled Exception:
java.lang.NullPointerException
    at chatty.ErrorHandler.uncaughtException(ErrorHandler.java:33)
    at java.lang.ThreadGroup.uncaughtException(Unknown Source)
    at java.lang.ThreadGroup.uncaughtException(Unknown Source)
    at java.awt.EventDispatchThread.processException(Unknown Source)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
    at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
    at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    at java.awt.EventDispatchThread.run(Unknown Source)

I tried all sorts of things to get some information out of the original Exception, but even toString() was abstract as far as I can remember.

I also tried to compile the latest beta with Java 8 instead of Java 7 as before (because it seemed to occur mainly on Java 8), but I still had the error occur for people. Of course I'm not getting the error, so it's even harder to test stuff.

from chatty.

Azzurite avatar Azzurite commented on May 19, 2024

Again, it probably has something to do with the build you're doing, linking with a class that is fine on your machine but having a different versions on other machines. It could also be a problem in one of the libraries.
Could you please post your build script somewhere for me to look at?

from chatty.

Azzurite avatar Azzurite commented on May 19, 2024

Another idea would be, when an error occurs during the custom exception logging (like it happens here) to throw the original exception (the e in void uncaughtException(Thread t, Throwable e)) and let the JVM itself log it to stderr. If the JVM itself crashes on logging this exception, this would probably mean that there's a bug in the JVM. If the JVM does not crash, there's probably a bug somewhere in your build process or used libraries.
The second case is more likely, so it would be nice if I could take a look at your build script.

from chatty.

tduva avatar tduva commented on May 19, 2024

Good iea, but it's not possible to throw an exception in the uncaughtException method. I would have to add a throws to the method, but that means it doesn't override the method of the UncaughtExceptionHandler anymore.

I didn't make a build script, the IDE does all the building for me.

from chatty.

tduva avatar tduva commented on May 19, 2024

I haven't encountered this for a while, it may have been resolved by newer Java versions.

from chatty.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.