Gen EJB calling EJB using EJBRMI fails across Application Server instances
search cancel

Gen EJB calling EJB using EJBRMI fails across Application Server instances

book

Article ID: 97300

calendar_today

Updated On:

Products

Gen Gen - Run Time Distributed

Issue/Introduction

A Gen EJB deployed under JBoss fails to call a Gen EJB deployed under WebSphere using EJBRMI. With CMIDEBUG trace enabled the JBoss sever.log file shows:
===
2018-05-10 10:21:28,827 WARN  [org.jboss.ejb3.interceptors.aop.InterceptorsFactory] (http-0.0.0.0-8080-5) EJBTHREE-1246: Do not use InterceptorsFactory with a ManagedObjectAdvisor, InterceptorRegistry should be used via the bean container
2018-05-10 10:21:28,827 WARN  [org.jboss.ejb3.interceptors.aop.InterceptorsFactory] (http-0.0.0.0-8080-5) EJBTHREE-1246: Do not use InterceptorsFactory with a ManagedObjectAdvisor, InterceptorRegistry should be used via the bean container
2018-05-10 10:21:28,837 INFO  [STDOUT] (http-0.0.0.0-8080-5) 05/10/18-10:21:28:837[http-0.0.0.0-8080-5]: EJBProcedureStepContext.usePStepSync(): Synchronous Procedure Step Use of: WAS_SVR_LIST_IFACES_FOR_MODEL.WLI4M( com.xxx.wsg.WLI4M_IA, com.xxx.wsg.WLI4M_OA) failed: com.ca.gen.csu.exception.CSUException:  [Function: EJBProcedureStepContext.usePStepSync]Could not locate EJB as "WAS_SVR_LIST_IFACES_FOR_MODEL"
2018-05-10 10:21:28,839 INFO  [STDOUT] (http-0.0.0.0-8080-5) 05/10/18-10:21:28:839[http-0.0.0.0-8080-5]: com.ca.gen.csu.exception.CSUException:  [Function: EJBProcedureStepContext.usePStepSync]Could not locate EJB as "WAS_SVR_LIST_IFACES_FOR_MODEL"
    at com.ca.gen.ejb.EJBProcedureStepContext.usePStepSync(Unknown Source)
    at com.xxx.wsg.JBOSSLIS.f_22020286(Unknown Source)
    at com.xxx.wsg.JBOSSLIS._JBOSSLIS(Unknown Source)
    at com.xxx.wsg.JBOSSLIS.JBOSSLIS(Unknown Source)
...
2018-05-10 10:21:28,874 ERROR [STDERR] (http-0.0.0.0-8080-5) java.lang.RuntimeException: TIRM030E: Application failed - Updates have been backed out
===

The EJBRMI entry for the WAS_SVR_LIST_IFACES_FOR_MODEL transaction in the commcfg.properties file appears to getting ignored.

Environment

Gen 8.x

Cause

A server to server call for EJB calling EJB (via EJBRMI) across different Application Server instances does not use the commcfg.properties file nor the Server Manager EJB/RMI properties from the model. It relies on having a common JNDI directory across the Application Server instances or using the ContextLookupExit user exit to control the remote EJB lookup. Neither of those processes has been found to work effectively and the current optimum solution is to use an EJB Web Service for the EJB to EJB call.

Resolution

The steps required for a JBoss EJB1 SERVER1 (trancode SVR1) calling WebSphere EJB2 SERVER2 (trancode SVR2) via EJB Web Services are: 
a. Use a commcfg.properties file to add the required WS mapping for trancode SVR2: 
SVR2=WS http://websphere_hostname:9080 L 
b. The SERVER2 Server Manager needs to have EJB/RMI properties set in the model to force creation of env-entry values in the SERVER1 ejb-jar.xml file at generation time. Those property values can actually be anything because they are then overridden at runtime by the above commcfg.properties SERVER2 WS mapping. 
c. An additional workaround is currently needed:
EITHER: After the code generation step and before executing the Assemble step the SERVER1 ejb-jar.xml file needs a manual change to force the server name to be all uppercase i.e.
CHANGE: <env-entry-value>SVR2:Server2:SVR2:Svr2:SVR2:SVRTOSVR:svrtosvr:::svrtosvr:svrtosvr:::svrtosvr:EJBRMI .....</env-entry-value>
TO:           <env-entry-value>SVR2:SERVER2:SVR2:Svr2:SVR2:SVRTOSVR:svrtosvr:::svrtosvr:svrtosvr:::svrtosvr:EJBRMI .....</env-entry-value>
OR: A one time change to the Gen runtimes before any Assemble step ("Package runtime in EAR"):
Edit user exit WSDynamicCoopFlowExit.java ("%GEN86%\Gen\classes\com\ca\gen\exits\coopflow\ws") and change the function modifyURL to return an uppercase version of the "url" variable i.e.
public String modifyURL(String url) throws CSUException {
    System.out.println ("Incoming url value: " + url);    /** optional for logging */
    url=url.toUpperCase( );    /** new code */
    System.out.println ("Outgoing url value: " + url);    /** optional for logging */
    return url;
}

Compile the modified code to create a new WSDynamicCoopFlowExit.class.  NOTE: Gen runtime csu.jar needs to be referenced in the CLASSPATH for the compile e.g. JDK_HOME\bin\javac WSDynamicCoopFlowExit.java -cp "%GEN86%\Gen\classes\csu.jar"
Engineering are investigating the reason for this final workaround in more detail and will provide a fix.

Additional Information

1. Using an action diagram CALL EXTERNAL statement from EJB SERVER1 to access the SERVER2 EJB Web Service is an alternative approach that has also been successfully tested.
2. Engineering will also investigate the feasibility of an improved mechanism to allow the use of EJBRMI for EJB calls across different Application Server instances