We are working on a project where we need to connect to JBoss(JBoss EAP 7.3.0) via the Filenet code module. However while establishing a connection, the EJB connection fails giving the below error :
Unable to find the InitialContextFactory org.wildfly.naming.client.WildFlyInitialContextFactory.
To us it looks like it fails to load the class - WildFlyInitialContextFactory.
We tried below different options/approaches to load the Jboss-client.jar(version 7.3) in order to avoid this issue :
1.Loading the specific jars from the Websphere lib folder /opt/IBM/WebSphere/AppServer/lib – approach failed and we were also not able to access Websphere console because of the jboss-client.jar
2. Creating shared lib and configuring it to FileNet ear. Approach failed and ACCE was also not accessible. The below error was thrown :
FNRCA0032 The JNDI cannot be accessed. Message was: Some object reference in the name "FileNet/Engine" relative to the context "ECMDEVCell/nodes/CPENode01/servers/CPEServer01" is invalid. Some possible causes include a context binding in the name which refers to a destroyed context, or an object binding which contains an invalid EJBHome reference.
3. Adding JVM argument -Djava.naming.factory.initial=org.wildfly.naming.client.WildFlyInitialContextFactory
Approach failed and restarting the CPE server also failed post updating JVM argument
4. Setting JBoss initial context factory using system property inside the code module – approach failed
Note - the same connectivity code works well if the code is deployed as a web application in the WebSphere and the connection to Jboss ejb also works. However, same code does not work well when deployed as a code module in Filenet. Error thrown is : Unable to find the InitialContextFactory org.wildfly.naming.client.WildFlyInitialContextFactory.
Could you please help us understand on how to make it work via the Filenet code module like how it works with Standalone application.
Code snippet :
Properties props = new Properties();
props.put(Context.INITIAL_CONTEXT_FACTORY, org.wildfly.naming.client.WildFlyInitialContextFactory.class.getName());
props.put(Context.PROVIDER_URL, "xxxxx");
props.put(Context.SECURITY_PRINCIPAL, "xxxxx");
props.put(Context.SECURITY_CREDENTIALS, "xxxxx");
InitialContext ctx = new InitialContext(props);
FileNetCommonServiceHome fnComServiceHome = null;
String lookupName = "xxxxx";
System.out.println("lookupName::"+ctx.lookup(lookupName));
System.out.println("call to remote EJB worked");
#FileNet#Support#SupportMigration