Connectivity Testing for EJB Connector
Connectivity Testing for EJB connector with EJB 3, Weblogic: 12c, JDK1.8
Sample flow for testing
We created the following simple flow in a MuleSoft application to test the connector in Mule 4.3 to reproduce the connection scenario.
Connector Component- EJB3 Request
Clicking on this connector component you will get you the following screen:
Click on the plus icon in the connector configuration section of Basic Settings
Prerequisites to Configure the EJB Connector:
Host and Port settings
Initial Context Factory
User Name: The username for admin server
Password: The password for admin server
Required libraries
EJB service package: jar file that contains the EJB interfaces
Weblogic driver: driver to connect the app server, it should contain the Initial Context Factory that is configured in the previous step
Configuration Screen
We need to provide jar file location, group id, artifact id and version. It will be added in the project pom file.
General Section of the Connector Component:
Required Properties
Arguments: Values to be passed to the selected method. Any DataTypes can be passed.
Lookup Bean: You can directly look up a bean instance from JNDI and retrieve a bean instance. In the case of remote access, the actual location of a reference enterprise bean and EJB container are, in general, transparent to the client using the remote business interface of the bean.
Method Name : Name of the method present in the remote interface and is mentioned along with the dataTypes.
Note: If the required libraries were inserted correctly, then you should see the EJB methods list with arguments in the drop down menu (click the sync button if the list is empty)
Deployment and Testing Result
If everything went well, running this example should produce something like the following in the console:
INFO 2022-01-14 10:57:22,235 [[MuleRuntime].uber.05: [ejb3-wl12c].ejb3-wl12cFlow.BLOCKING @7cd3e31e] [processor: ; event: a8da4e50-7552-11ec-b2e9-a078178bdd50] org.mule.extension.ejb.internal.connection.DefaultEjbConnection: InitialContext has been created successfully.
INFO 2022-01-14 10:57:22,298 [[MuleRuntime].uber.05: [ejb3-wl12c].ejb3-wl12cFlow.BLOCKING @7cd3e31e] [processor: ; event: a8da4e50-7552-11ec-b2e9-a078178bdd50] org.mule.extension.ejb.internal.connection.provider.WebLogicConnectionProvider: disconnect
INFO 2022-01-14 10:57:22,300 [[MuleRuntime].uber.05: [ejb3-wl12c].ejb3-wl12cFlow.BLOCKING @7cd3e31e] [processor: ejb3-wl12cFlow/processors/1; event: a8da4e50-7552-11ec-b2e9-a078178bdd50] org.mule.runtime.core.internal.processor.LoggerMessageProcessor: stringIntBoolean
Note: The last line will be the output of the EJB. In our simple demo the method just returns it’s name.
For more references: check other pages in this confluence page.
Contact for more support: