Bug Report: Client EJB context lookup fails: SerialContextProvider.lookup(): prvdr is null #6414
Labels
Status: Accepted
Confirmed defect or accepted improvement to implement, issue has been escalated to Platform Dev
Type: Bug
Label issue as a bug defect
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
The text was updated successfully, but these errors were encountered: