Forum: Toolbox Forum

transient NullPointerExceptions

Hi, we're experiencing some stability problems with TOOLBOX 7.1:

- the toolbox often throws a "java.lang.NullPointerException" at seemingly random points, about one time out of 3 or 4 attempts. It may be related to using threads (using the element), as the exceptions we have observed have always been thrown after a has been executed. Sometimes they are thrown in the forked thread, sometimes in the main thread. Perhaps more often in the main thread, but then there are is more code in the main thread.
- the errors seem to be more frequent if several requests are exectued one after another within a short time period.
- using a element to catch the exceptions is ineffective: once a NullPointerException appears, it seems to become unavoidable - it will then get thrown from somewhere within the element, so recovery is usually unsuccesful.
- when a NullPointerException appears, the toolbox script does not return an error, and the workflow must wait for a timeout to eventually report an error to the user sometime later.
- attempting to mitigate with sleeps within the forks or before does not seem have any effect (this was based on the thought that there may be an internal thread synchronisation problem).

Has this been observed before?
Any hints on how to avoid the exceptions?

- milan novacek.


Re: transient NullPointerExceptions

Hi Milan,

we have never experienced such problem. I'll let you know about this..
Kind regards,

Toolbox Support Team


> Hi, we're experiencing some stability problems with TOOLBOX 7.1:
>
> - the toolbox often throws a "java.lang.NullPointerException" at seemingly random points, about one time out of 3 or 4 attempts. It may be related to using threads (using the element), as the exceptions we have observed have always been thrown after a has been executed. Sometimes they are thrown in the forked thread, sometimes in the main thread. Perhaps more often in the main thread, but then there are is more code in the main thread.
> - the errors seem to be more frequent if several requests are exectued one after another within a short time period.
> - using a element to catch the exceptions is ineffective: once a NullPointerException appears, it seems to become unavoidable - it will then get thrown from somewhere within the element, so recovery is usually unsuccesful.
> - when a NullPointerException appears, the toolbox script does not return an error, and the workflow must wait for a timeout to eventually report an error to the user sometime later.
> - attempting to mitigate with sleeps within the forks or before does not seem have any effect (this was based on the thought that there may be an internal thread synchronisation problem).
>
> Has this been observed before?
> Any hints on how to avoid the exceptions?
>
> - milan novacek.



Re: transient NullPointerExceptions

Corrected text below (my xml tags such as "<fork>" were filtered out in the original post sad )

> Hi, we're experiencing some stability problems with TOOLBOX 7.1:
>
> - the toolbox often throws a "java.lang.NullPointerException" at seemingly random points, about one time out of 3 or 4 attempts. It may be related to using threads (using the <fork> element), as the exceptions we have observed have always been thrown after a <fork> has been executed. Sometimes they are thrown in the forked thread, sometimes in the main thread. Perhaps more often in the main thread, but then there are is more code in the main thread.
> - the errors seem to be more frequent if several requests are exectued one after another within a short time period.
> - using a <try> element to catch the exceptions is ineffective: once a NullPointerException appears, it seems to become unavoidable - it will then get thrown from somewhere within the <ifError> element, so recovery is usually unsuccesful.
> - when a NullPointerException appears, the toolbox script does not return an error, and the workflow must wait for a timeout to eventually report an error to the user sometime later.
> - attempting to mitigate with sleeps within the forks or before does not seem have any effect (this was based on the thought that there may be an internal thread synchronisation problem).
>
> Has this been observed before?
> Any hints on how to avoid the exceptions?
>
> - milan novacek.




The original document is available at https://wiki.services.eoportal.org/tiki-view_forum_thread.php?comments_parentId=444&topics_offset=13&display=&fullscreen=&PHPSESSID=