Need help to do lookups via windows->ubuntu/wsl->docker->payara

Hi there,

Im running the docker-image payara/server-full:5.2022.5 on docker on ubuntu/wsl on windows 11. Im unable to connect to the ejb-port 3700 from windows. Connection from ubuntu/wsl works well.


Start the payara-container:

docker run -p 3700:3700 -p 8080:8080 -p 4848:4848 payara/server-full:5.2022.5

Dont deploy anything.

After that I can reach localhost:8080 and localhost:4848 from the windows-browser (4848 with certificat-issues).

I wrote a minimal java-ejb-client that lookups the default jdbc-datasource (“jdbc/__default”). Lookup works fine from ubuntu/wsl, but dosnt work from windows.

Result of minimal-example-client started from Ubuntu/WSL:

Start minimal example client
Apr 21, 2023 8:22:41 AM com.sun.enterprise.v3.server.CommonClassLoaderServiceImpl findH2Client
INFO: Cannot find h2db client jar file, h2 jdbc driver will not be available by default.
Apr 21, 2023 8:22:42 AM org.glassfish.enterprise.iiop.api.GlassFishORBHelper postConstruct
INFO: GlassFishORBFactory service initialized.
Apr 21, 2023 8:22:47 AM org.hibernate.validator.internal.util.Version
INFO: HV000001: Hibernate Validator null
Got instance: com.sun.gjc.spi.jdbc40.DataSource40@1da4b3f9

minimal-example-client started from windows:

Start minimal example client

Apr 21, 2023 8:23:54 AM com.sun.enterprise.v3.server.CommonClassLoaderServiceImpl findH2Client
INFORMATION: Cannot find h2db client jar file, h2 jdbc driver will not be available by default.
Apr 21, 2023 8:23:54 AM org.glassfish.enterprise.iiop.api.GlassFishORBHelper postConstruct
INFORMATION: GlassFishORBFactory service initialized.

Than the connection hangs for at least 30 minutes. The application will not terminate, no exception, nothing happens.

Further investigations:
If I remove the IIOP-Listener at port 3700 and change the admin-server to listen at 3700, I can reach the admin-webpage from windows-browser at localhost:3700. That means, there are no networking/firewall/portmapping-issues.

If I do a tcpdump on the payara-docker-container, I see different communications from the ubuntu/wsl and windows. Both tcpdumps attached here. I see, that the communication from windows contains the external-windows-ip in cleartext. The communication from ubuntu/wsl dont transmit any IP at this location.


For some special reasons, Im pinned to Java8. So I cant update to Payara6 at this moment.

I cant switch to the ejb via http invoker-servlet, because I need to lookup JMS-Resources. This is not (yet) supportet by the http-interface.


Is there an general restriction for using EJB-Lookups in this setup? Why is port 3700 not exposed by default in the docker-file?

What can I do to get this simple case working?

Thanks in advance for every kind of help!

Igor :slight_smile:

My Test-Client:

import javax.naming.InitialContext;
import javax.naming.NamingException;
import javax.naming.Context;
public class Test {
	public static void main(String[] args) throws NamingException {
		System.out.println("Start minimal example client");
		Hashtable<String, Object> env = new Hashtable<String, Object>();		
		env.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.enterprise.naming.SerialInitContextFactory");
		InitialContext context = new InitialContext(env);		
		Object o = context.lookup("jdbc/__default");
		System.out.println("Got instance: " + o);