Sorry if this is the wrong place to post this question. I talked to the Payara support (since this exact same problem occurs in gf and payara) and they recommended this forum.
PROBLEM:
I have been trying to migrate my Java EE application to run in a Java 8 (from Java 7) and Glassfish 5.0/Payara 5.201 (from GF 3.1.1) environment. I am able to deploy the application to both GF and Payara 5 seemingly successfully, I can access the applications ui and navigate through it. The problem arises when I try to run one of the many appclients, this is when I get the error message below.
SYMPTOMS:
MultiException stack 1 of 2
java.lang.RuntimeException: java.util.concurrent.ExecutionException: java.lang.NoClassDefFoundError: javax/validation/Payload
at org.glassfish.hk2.utilities.cache.LRUHybridCache.compute(LRUHybridCache.java:315)
at org.glassfish.hk2.utilities.reflection.internal.ClassReflectionHelperImpl.getAllFields(ClassReflectionHelperImpl.java:113)
MultiException stack 2 of 2
java.lang.IllegalArgumentException: Errors were discovered while reifying SystemDescriptor(
implementation=com.sun.enterprise.config.modularity.ConfigModularityJustInTimeInjectionResolver
contracts={com.sun.enterprise.config.modularity.ConfigModularityJustInTimeInjectionResolver,org.glassfish.hk2.api.JustInTimeInjectionResolver}
There is another symptom I spotted on deployment, the number of components loaded in glassfish/payara (application->my application) is much lower than a working environment (155 components in broken env vs 450 in working env). There are no deployment errors that I can see.
JAVA:
java version "1.8.0_152"
Java(TM) SE Runtime Environment (build 1.8.0_152-b16)
Java HotSpot(TM) 64-Bit Server VM (build 25.152-b16, mixed mode)
(Tried a number of java version including jdk1.8.0_202 but gf/payara would not start, had to replace a grizzly-npn-bootstrap.jar with a different version)
APPLICATION SERVER:
Payara Server 5.201
Glassfish 5.0
APPCLIENT EXECUTION:
VMARGS="-Xmx2048m -Xms2048m -Dcom.sun.corba.ee.transport.ORBTCPTimeouts=100:90000:20:500 -Dcom.sun.corba.ee.transport.ORBWaitForResponseTimeout=3600000 $ZAMBER_DEBUG_ARGS $ZAMBER_JVM_ARGS $JMX_ARGS"
export VMARGS
/root/profiler/appclient/glassfish/bin/appclient -client $productclient -mainclass ca.avant.zamber.my_app.scheduler.Main $*
Which, in appclient, executes:
eval `"${ACCJava}" -Dorg.glassfish.appclient.shell $cygwinProp -classpath "${_AS_INSTALL}/lib/gf-client.jar" org.glassfish.appclient.client.CLIBootstrap "$@"`
PROJECT POM:
See attached xml file. Note, while debugging I have attempted to migrate java ee dependencies to java ee 8 (eg. javaee-api).
SOLUTIONS ATTEMPTED:
1. I tried a number of different ways to force the jar containing the Payload class to be loaded (/modules, domain-dir/lib, classpath, etc)
2. I tried updating the applications dependencies to follow the java ee 8 specification.
3. I tried a number of different java versions.
4. I tired to force glassfish/app to use a specific version (2.0.1.FINAL) of the validation-api jar.
5. I tried using payara server instead, behaved exactly the same.
I have spent a ton of time on this problem and have run out of things to try. Nothing I've done so far have had any effect. Any ideas?
Thanks.