Open kitlei-robert opened 1 year ago
Hi kitlei-robert. I am sorry for not coming back to you earlier.
Please note that JAVA 21 is not supported on the Payara Community Server yet. Java 20 will never be supported, because this release is not LTS.
I couldn't reproduce the prvdr is null
error on JAVA 17, however, I failed to execute JNDI Lookup in my remote client.
Remote EJB JNDI Lookup doesn't work as it should.
I have escalated this to the platform development team with internal JIRA FISH-7946
I will let you know once we are able to proceed with the development of the fix.
Regards, Artur
Addendum: the most recent version of Payara (6.2023.10) also exhibits the prvdr is null
behaviour on my system. The most recent version of GlassFish (7.0.9) does not, it gets to NameNotFoundException: fake
and if an EJB is actually deployed, it can look it up as expected. I used Java 21, so the JDK's version number probably does not matter all that much for this purpose.
The issue remains with the newest releases, Payara 6.2023.11 still fails with prvdr is null
, GlassFish 7.0.10 is doing OK.
It seems to me that there's some difference inside appserv-rt.jar
(referenced by gf-client.jar
) in Payara vs GlassFish that causes the different behaviour: using the latter's appserv-rt.jar
, the client can connect remotely to an EJB deployed in the former server but not vice versa.
Just wanted to add, we are still seeing with issue with Payara 6.2024.6 and using either JDK 17 or 21. However, if we manually added the gf-client.jar from the Maven Central Repository and its related dependencies to our standalone client classpath, the remote EJB JNDI lookup works.
Brief Summary
Client side attempt for EJB lookup fails with
Cannot invoke "com.sun.enterprise.naming.impl.SerialContextProvider.lookup(String)" because "prvdr" is null
.Expected Outcome
Here is a very simple client code that tries to access an EJB.
Baseline: this works using Payara Server 6.2022.2 (Full).
My setup: Eclipse IDE for Enterprise Java and Web Developers, Latest (2023-09) edition installed by way of the Eclipse Oomph installer. No special options. In it, I configure a Payara Server using Payara Tools installed from the Eclipse Marketplace. No special options. The server starts up as expected and in a sense, it's working well; for example, I can publish servlets onto it and they run just fine.
My even simpler setup: I just run
asadmin start-domain domain1
. The following is the same either way.When I run my client program (see details below) for the first time, the server logs show several
InvocationTargetException
s. To avoid running into them, I ignore module usage with the following fakery:Then I restart the server because the log now claims,
Addition of: '--add-opens=java.management/javax.management=ALL-UNNAMED' cannot take effect without server restart
.Once the server is up again, I run the program like this, using either Java 20 or the recent Java 21 (specifically, the Azul Zulu distribution) on Windows 11. I show the command line version here; the equivalent execution in Eclipse behaves similarly.
java -cp .;payara6.2022.2\glassfish\lib\gf-client.jar --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.io=ALL-UNNAMED --add-opens=java.management/javax.management=ALL-UNNAMED --add-opens=java.management/javax.management.openmbean=ALL-UNNAMED -Dorg.glassfish.gmbal.no.multipleUpperBoundsException=true Main
If the gf-client.jar I use is the one in Payara Server 6.2022.2 (Full), it throws an exception like it should with this message:
That is, it manages to contact the server, it apparently is able to get a provider from it, then concludes that
fake
is indeed fake. So far so good...Current Outcome
However, using Payara Server 6.2023.8 (Full) or the recent 6.2023.9 (Full) in a similar fashion (with the
asadmin
steps, and the client havinggf-client.jar
of the corresponding server'spayara6/lib
folder on its classpath now), the error message is quite different:The same happens even if I include all the jar files under both
payara6/lib/
andpayara6/modules/
on the classpath.This issue is clearly related to #5510 and #6214, as both ultimately failed with the
prvdr is null
bit. I couldn't find a fix either in them or in #6338 referenced by the latter.Reproducer
See the code and the commands above.
Further details and investigations.
gf-client.jar
from Payara 6.2023.9) appropriately indicates that it cannot connect to the server, there's no message aboutprvdr is null
.fake
, the outcome is the same (prvdr is null
).--add-opens
fakery, it throws anInvocationTargetException
. This is not the main question, but this is quite inelegant, and I'd be happy to run the program without them; can you suggest how? Also, I suspect thatprvdr is null
might be caused by some more illegal access down the line; probably the corresponding error message gets lost.INFO
messages, in case they may be related to the problem, I include them here. The first two show up during Payara start, the second two when I deploy an EAR with an EJB.Cannot find the resource bundle for the name com.sun.logging.enterprise.system for class org.glassfish.enterprise.iiop.api.ORBLazyServiceInitializer using fish.payara.server.core.orb.connector
Cannot find the resource bundle for the name com.sun.logging.enterprise.system.container.ejb for class com.sun.ejb.containers.EjbContainerUtilImpl using fish.payara.server.internal.ejb.ejb-container
Cannot find the resource bundle for the name com.sun.logging.enterprise.system.container.ejb for class org.glassfish.ejb.security.application.EjbSecurityComponentInvocationHandler using fish.payara.server.internal.ejb.ejb-container
Cannot find the resource bundle for the name com.sun.logging.enterprise.system.container.ejb for class com.sun.ejb.EJBUtils using fish.payara.server.internal.ejb.ejb-container
Conclusion:
Obviously, something in the context lookup mechanism got broken between Payara versions 6.2022.2 and 6.2023.8. How do I force my command line client to properly connect to the EJB deployed on the Payara 6.2023.9 server?
Operating System
Windows 11
JDK Version
Zulu 20 and/or 21
Payara Distribution
Payara Server Full Profile