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.
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.
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.
docker run -p 8080:8080 -p 1099:1099 -p 1098:1098 -p 3873:3873 -d jboss-image