Weird error nullPointerException

I have a code in which i get 1/1000 times an error i cannot understand; as the code runs fine so many times i dont understand why this error is happening. And the error is not really clear to read:

at sun.java2d.pipe.GlyphListLoopPipe.drawGlyphList(
at sun.java2d.pipe.GlyphListPipe.drawGlyphVector(
at sun.java2d.SunGraphics2D.drawGlyphVector(
at sun.font.ExtendedTextSourceLabel.handleDraw(
at sun.font.Decoration.drawTextAndDecorations(
at sun.font.ExtendedTextSourceLabel.draw(
at java.awt.font.TextLine.draw(
at java.awt.font.TextLayout.draw(
at sun.java2d.SunGraphics2D.drawChars(
at processing.awt.PGraphicsJava2D.textLineImpl(
at processing.core.PGraphics.textLineAlignImpl(
at processing.core.PGraphics.text(
at processing.core.PGraphics.text(
at processing.core.PApplet.text(
at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(
at java.lang.reflect.Method.invoke(
at processing.core.PApplet.method(
at processing.core.PApplet$

Does anybody has an idea for that???
thanks in advance

PS: this error happens at a moment when i am parsing Strings.

This error usually happens when you try to access something that does not exist (an object not initialized or a array index too big…)

Without your code, it hard to really help you thought…

Looking at the stack trace in the error, it seems to happen when it’s trying to draw some text.
From that, I guess the error happens with the text(...); function.

Does it point to the exact text(...); function that gives the error?
One thing you can do as a cheap workaround is to surround it with try-catch block:

}catch(Exception e){
  println("Oh hey, that weird error happened again! Oh well.");

This, as a result, would end up not doing the text(...); function at that one time it makes an error, but at the end of the day your sketch is most likely running at 60FPS, so not drawing text one frame shouldn’t be critical.

“GlyphListLoopPipe.drawGlyphList(”: what is precisely referred here?

Of course i know what is a null pointer e and that is not my question which is a) why the log does not refer to the code and to the class where the error was fired, as usually this kind of log does b) why this error was fired only one time, though the code was runned till now about 1000 times or more… As for putting code i cannot because it is too much long & complicated with 12 classes, a server, & 10 instances of the app running at same time; as i told i only know that the error is fired when parsing a little number (10 max) of short texts, more precisely short char sequences like “Chj12” or “CCH0” and extracting substrings for drawing them. These charseq are not randomly created but picked from an array and so are frequently parsed without any problem…
PS: i have left an instance of the app running since 12 hours: not any error!