Connecting to Java JBoss Objects in EAP7 from CF Server 2016
e're trying to run the CF 2016 server alongside a Java Middle Tier running in a JBoss EAP 7 Standalone server. I'm copying over the .ear file and the appropriate client .jar files, but when we actually go to lookup the jndiName on the InitialContext, the server fails. Neither the ColdFusion log nor the Middle Tier server.log show any errors. We have already shown that we can hit the Middle Tier from a test connection tool running in Eclipse.
Has anyone else encountered this problem, and/or is there some CF Server setting that might be wrong?
Below are the settings for the InitialContext and the method to get the InitialContext. The bolded line is what fails.
Joshua Sharf
@SuppressWarnings("unchecked")
public <T> T getRemote(Class<T> remote, String jndiName) {
InitialContext initialContext = null;
T remoteReturned = null;
try {
initialContext = getInitialContext();
remoteReturned = (T)initialContext.lookup(jndiName);
} catch (Exception e) {
_logger.error("name:" + e.getClass().getSigners() + "\t message:" + e.getMessage() + "\t cause:" + e.getCause());
_logger.error(" Could not look up jndiName " + jndiName, e);
}
return remoteReturned;
}
public static InitialContext getInitialContext() throws SystemException {
try {
final Hashtable env = new Hashtable();
env.put(InitialContext.URL_PKG_PREFIXES, "org.wildfly.naming.client");
env.put(InitialContext.INITIAL_CONTEXT_FACTORY, "org.wildfly.naming.client.WildFlyInitialContextFactory");
env.put(InitialContext.PROVIDER_URL, "http-remoting://127.0.0.1:8080");
env.put("org.wildfly.naming.client", true);
return new InitialContext(env);
} catch (Exception e) {
_logger.error("Error in getInitialContext:",e);
throw new SystemException(RemoteServiceLocator.buildClientExceptionContent("RemoteServiceLocator.getIntitialContext()",
"System Exception attempting to get Initial Context.\n"));
}
}
