How to make remote calls from Weblogic to JBoss EAP?
A Hands-On Guide to Configuring a Java Application for EJB Remote Calls from WebLogic to JBoss EAP
While modern AI models like DeepSeek grab headlines, many enterprise applications still rely on older architectures that can be difficult to integrate. One of these legacy technologies is EJB remote calls, which are still widely used in Java applications. This tutorial will guide you through setting up an EJB client (Bob) to communicate with an EJB remote interface (Alice), covering three common scenarios: same server, external client, and cross-server communication.
This post is a quick tutorial on how to implement a EJB client (aka Bob) to communicate with a EJB remote interface (aka Alice). The scenarios will be making remote calls within the same application server (jboss-eap), from outside the application server (using a java program) and from another application server (weblogic).
Remote Interface aka Alice
Remote calls require a remote interface that will be called against. This interface should be annotated with the @Remote annotation from javax.ejb library.
After defining the interface, the developer must implement it. In this example, the bean type is stateless but it is not mandatory, it could be changed to stateful.
Scenario 1: Remote calls within the same application server
As both java programs share the same application server, there is no need to use authentication. Therefore, Bob only needs to set the right initial context factory, connection protocol and the EJB path.
No authentication required!
Initial Context Factory must be org.wildfly.naming.client.WildFlyInitialContextFactory
Connection protocol must be remote+http
EJB Path: use the JNDI bindings reported by JBoss EAP.
Scenario 2: Remote calls from outside the application server
This scenario is very similar to the previous scenario if and only if the remote-client is in the same network and device as the application server. For instance, if the developer runs the application server locally by running the standalone binary (check scenario 3 for containerised solutions) and the remote client is running directly from the developers IDE, the developer do not need to perform any code changes from the previous scenario.
Scenario 3: Remote calls from a different application server (containerised or different network)
As the remote call comes from a different network, it has to go through the authentication layer of JBoss EAP. Therefore, apart from the code that was used in the previous scenarios, it is required to create a user on JBoss EAP and add in the properties of the remote call.
Create user by using the add-user binary
Add user to the client properties
The code can be found at my Github: https://github.com/alizard0/java-rpc-eap/tree/main/ejb