Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Payara 5.2021.9 + Remote EJB + JDK 17 does not work/FISH-6027 #5510

Closed
AleksNo opened this issue Nov 30, 2021 · 6 comments
Closed

Payara 5.2021.9 + Remote EJB + JDK 17 does not work/FISH-6027 #5510

AleksNo opened this issue Nov 30, 2021 · 6 comments
Assignees
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

Comments

@AleksNo
Copy link

AleksNo commented Nov 30, 2021

Description

If you start a remote EJB client with JDK 17 then no connection is established and the client throws an exception.

Expected Outcome

The remote EJB client should connect to the server.

Current Outcome

The client thows this exception:

javax.naming.CommunicationException: Communication exception for SerialContext[myEnv={java.naming.factory.initial=com.sun.enterprise.naming.impl.SerialInitContextFactory, java.naming.factory.url.pkgs=com.sun.enterprise.naming, java.naming.factory.state=com.sun.corba.ee.impl.presentation.rmi.JNDIStateFactoryImpl} [Root exception is java.lang.NullPointerException: Cannot invoke "com.sun.enterprise.naming.impl.SerialContextProvider.lookup(String)" because "prvdr" is null]
at com.sun.enterprise.naming.impl.SerialContext.lookup(SerialContext.java:518)
at com.sun.enterprise.naming.impl.SerialContext.lookup(SerialContext.java:442)
at java.naming/javax.naming.InitialContext.lookup(InitialContext.java:409)
at remoteejbclient.RemoteEjbClient.getInitialContext(RemoteEjbClient.java:78)
at remoteejbclient.RemoteEjbClient$EjbConnect.mouseClicked(RemoteEjbClient.java:29)
at java.desktop/java.awt.AWTEventMulticaster.mouseClicked(AWTEventMulticaster.java:278)
at java.desktop/java.awt.Component.processMouseEvent(Component.java:6629)
at java.desktop/javax.swing.JComponent.processMouseEvent(JComponent.java:3389)
at java.desktop/java.awt.Component.processEvent(Component.java:6391)
at java.desktop/java.awt.Container.processEvent(Container.java:2266)
at java.desktop/java.awt.Component.dispatchEventImpl(Component.java:5001)
at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2324)
at java.desktop/java.awt.Component.dispatchEvent(Component.java:4833)
at java.desktop/java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4948)
at java.desktop/java.awt.LightweightDispatcher.processMouseEvent(Container.java:4584)
at java.desktop/java.awt.LightweightDispatcher.dispatchEvent(Container.java:4516)
at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2310)
at java.desktop/java.awt.Window.dispatchEventImpl(Window.java:2780)
at java.desktop/java.awt.Component.dispatchEvent(Component.java:4833)
at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:773)
at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:722)
at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:716)
at java.base/java.security.AccessController.doPrivileged(AccessController.java:399)
at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86)
at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:97)
at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:746)
at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:744)
at java.base/java.security.AccessController.doPrivileged(AccessController.java:399)
at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86)
at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:743)
at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113)
at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109)
at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)
Caused by: java.lang.NullPointerException: Cannot invoke "com.sun.enterprise.naming.impl.SerialContextProvider.lookup(String)" because "prvdr" is null
at com.sun.enterprise.naming.impl.SerialContext.lookup(SerialContext.java:483)

If the client applicazion is started with JDK 11 then it works fine.

Steps to reproduce

I am not familiar with maven. So i cannot provide a maven project. I have attached the sourcecode of a test application.

And i am sure that every remote EJB client application is affected.

It is also important that the client application must be started with this parameter:
-Dorg.glassfish.gmbal.no.multipleUpperBoundsException=true

because of this issue:
eclipse-ee4j/orb-gmbal#22

Environment

  • Distribution: Server full profile
  • JDK Version: Eclipse Adoptium Temurin-17.0.1+12
  • Operating System: Windows 10 Professional 64 Bit
    reproducer.zip
@AleksNo AleksNo added Status: Open Issue has been triaged by the front-line engineers and is being worked on verification Type: Bug Label issue as a bug defect labels Nov 30, 2021
@AleksNo AleksNo changed the title Payara 2021.9 + Remote EJB + JDK 17 does not work Payara 5.2021.9 + Remote EJB + JDK 17 does not work Nov 30, 2021
@shub8968 shub8968 self-assigned this Dec 10, 2021
@shub8968
Copy link
Contributor

Hi @AleksNo,

Would you be able to provide us with a proper reproducer app. Also, please describe the steps to build and deploy the app on the Payara server and instructions to produce the issue along with it. If you are looking for support on your application I would recommend you to consider Payara Enterprise.

@shub8968 shub8968 added Status: Pending Waiting on the issue requester to give more details or share a reproducer and removed Status: Open Issue has been triaged by the front-line engineers and is being worked on verification labels Dec 13, 2021
@shub8968 shub8968 added Status: Abandoned User has not supplied reproducers for bug report, soon to be closed if user doesn’t come back and removed Status: Pending Waiting on the issue requester to give more details or share a reproducer labels Jan 4, 2022
@shub8968 shub8968 removed the Status: Abandoned User has not supplied reproducers for bug report, soon to be closed if user doesn’t come back label Jan 18, 2022
@shub8968
Copy link
Contributor

Closing due to no response.

@pattycakelol
Copy link

Hello,

I am having this same Remote EJB issue using Payara 5.2021.9 and JDK 17 running on Centos 7.

I am using a separate java application to call a remote EJB on the server and am getting this error:

javax.naming.CommunicationException: Communication exception for SerialContext[myEnv={java.naming.factory.initial=com.sun.enterprise.naming.impl.SerialInitContextFactory, java.naming.factory.url.pkgs=com.sun.enterprise.naming, java.naming.factory.state=com.sun.corba.ee.impl.presentation.rmi.JNDIStateFactoryImpl} [Root exception is java.lang.NullPointerException: Cannot invoke "com.sun.enterprise.naming.impl.SerialContextProvider.lookup(String)" because "prvdr" is null]
	at com.sun.enterprise.naming.impl.SerialContext.lookup(SerialContext.java:518)
	at com.sun.enterprise.naming.impl.SerialContext.lookup(SerialContext.java:442)
	at java.naming/javax.naming.InitialContext.lookup(InitialContext.java:409)
	at com.test.remote.testremoteja.testremote.callRemote(testremote.java:15)
	at com.test.remote.testremoteja.Main.main(Main.java:9)
Caused by: java.lang.NullPointerException: Cannot invoke "com.sun.enterprise.naming.impl.SerialContextProvider.lookup(String)" because "prvdr" is null
	at com.sun.enterprise.naming.impl.SerialContext.lookup(SerialContext.java:483)
	... 4 more

I have made a sample that demonstrates this error.

As mentioned above, the client must be started with the -Dorg.glassfish.gmbal.no.multipleUpperBoundsException=true property.

Here is the command I used to run the client java application:

java -Dorg.glassfish.gmbal.no.multipleUpperBoundsException=true -cp payara5/glassfish/lib/gf-client.jar:payara5/glassfish/lib/javaee.jar:payara5/glassfish/lib/appserv-rt.jar:testremoteja.jar com.test.remote.testremoteja.Main

@AleksNo
Copy link
Author

AleksNo commented Feb 2, 2022

Hello and sorry for the late answer. I have made a document, which describes how to get running my reproducer project.

payara_ejb.pdf

I hope it helps.

Cheers

@shub8968 shub8968 reopened this Feb 3, 2022
@fturizo fturizo added the Status: Open Issue has been triaged by the front-line engineers and is being worked on verification label Feb 4, 2022
@shub8968 shub8968 added Status: Pending Waiting on the issue requester to give more details or share a reproducer Status: Open Issue has been triaged by the front-line engineers and is being worked on verification and removed Status: Open Issue has been triaged by the front-line engineers and is being worked on verification Status: Pending Waiting on the issue requester to give more details or share a reproducer labels Feb 10, 2022
@shub8968 shub8968 changed the title Payara 5.2021.9 + Remote EJB + JDK 17 does not work Payara 5.2021.9 + Remote EJB + JDK 17 does not work/FISH-6027 Feb 11, 2022
@shub8968
Copy link
Contributor

shub8968 commented Feb 11, 2022

Hi @AleksNo, @pattycakelol

I am able to reproduce this issue. I have raised an internal issue with JIRA FISH-6021. Thanks. It may take a while to fix the issue. You are free to submit a PR to fix this issue if you feel confident to do so.

@shub8968 shub8968 added Status: Accepted Confirmed defect or accepted improvement to implement, issue has been escalated to Platform Dev and removed Status: Open Issue has been triaged by the front-line engineers and is being worked on verification labels Feb 11, 2022
@JamesHillyard
Copy link
Member

Hi @AleksNo and @pattycakelol,

The issue you are getting here is actually caused by orb-gmbal-pfl which is used in Payara. The code causing this can be found here: eclipse-ee4j/orb-gmbal-pfl - JDK 17 banned illegal reflective access, hence you only get this issue on JDK 17 and not JDK 11.

You should specify --add-opens=java.base/java.lang=ALL-UNNAMED to either the command or IDE run configuration used to run the client application.

As you used the Eclipse IDE to run the client application in the provided reproducer, I have attached a screenshot of my run configuration which allowed me to use your reproducer successfully:
dec95f6e-d57c-4340-83b2-303d083950ef


You also stated

It is also important that the client application must be started with this parameter:
-Dorg.glassfish.gmbal.no.multipleUpperBoundsException=true

As of Payara 5.2022.2 this has been addressed and you no longer need to start the client application with this parameter

Thank you,
James Hillyard

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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
Projects
None yet
Development

No branches or pull requests

5 participants