Search code examples
javajbossdockerejb

Connecting to a Remote EJB Module running in Docker


To deploy and run an application client that connects to an EJB module on a Enterprise Server instance that is running in a Docker container, one must expose the ports that are used to establish the remote call.

  • Which are those ports?
  • Are they fixed or vary between calls?
  • Do I need to configure anything else in Docker?

I'm using Jboss 5.1.0 as Enterprise Server and I've tried exposing ports 1099 and 1100, getting in both cases exceptions. Same test using a Jboss running in my host works fine.


Solution

    • The following are the required ports to connect to an EJB module running in a JBoss 5 Server:

      1099 : Naming service port.

      1098 : RMI service port.

      3873 : EJB3 Remote Invoker Port.

    • Those ports are fixed. Do not vary between calls
    • In Docker, you just need to redirect those ports.

    docker run -p 8080:8080 -p 1099:1099 -p 1098:1098 -p 3873:3873 -d jboss-image