HI @Ondro and thanks for response!
After a lot of pain...I found a work-arround,
for anyone who encounters the same problem.
What kept me believing it is a Payara bug/problem, is a fact that the same code works without problem in standard Java standalone app.
It was obvious that something wrong was happening on Payara, which is not happening in the desktop application.
But the question was WHAT, and how to eliminate it.
To cut a long story short, I finally found this thread:
https://github.com/eclipse-ee4j/glassfish/issues/19940
I quote:
"
Part of the startup time for GlassFish is to read in the
META-INF/services/* files from the OSGi bundles (76 out of the 289 have
these) and then to consult the content of these files during certain
class loader operations.
"
This lead me
to try to throw out content of the webservices-osgi.jar\META-INF\services\ folder
After restartng Payara,
everything started working like a charm!
So, the contents of this folder have caused various ClassCast/ClassNotFound exceptions.
It seems that he can be kicked out without any consequences!