[BZ-1054823] fix NPE when creating a kjar containing a type declaration referring to an existing java class
[BZ-1054907] add missing implementation for error toString and AgendaListener in API5 adapter layer
(cherry picked from commit b271589162f056d3782096c4b385336e1c673410)