-
1. Re: javax.naming.CommunicationException: Receive timed out
mayerw01 Dec 15, 2016 6:54 AM (in response to fhighlander)The remote access to the ejbs changed in WildFly.
The propties section should now look like this:
Properties jndiProperties = new Properties();
jndiProperties.put(Context.INITIAL_CONTEXT_FACTORY, "org.jboss.naming.remote.client.InitialContextFactory");
jndiProperties.put(Context.PROVIDER_URL, "http-remoting://" + ${host} + ":" + ${port});
jndiProperties.put(Context.URL_PKG_PREFIXES, "org.jboss.ejb.client.naming");
jndiProperties.put(Context.SECURITY_PRINCIPAL, ${userName});
jndiProperties.put(Context.SECURITY_CREDENTIALS, ${password});
// This is an important property to set if you want to do EJB invocations via the remote-naming project
jndiProperties.put("jboss.naming.client.ejb.context", "true");
// create a context passing these properties
remotingContext = new InitialContext(jndiProperties);
The standard port number is 8080 and the standard host is localhost.
Syntax for ejbs is: ${appName}/${moduleName}/${beanName}!${remoteView}
// appName = name of EAR deployment (or empty for single EJB/WAR deployments)
// moduleName = name of EJB/WAR deployment
// beanName = name of the EJB (Simple name of EJB class)
// remoteView = fully qualified remote interface class
for example: lookup(TestRemoteJNDI/TestRemoteJNDI-ejb/CalculateBean!ejb.CalculateBeanRemote)
I' suggest to check the GitHub - wildfly/quickstart: Holds all versioned docs & samples for more details.
-
2. Re: javax.naming.CommunicationException: Receive timed out
fhighlander Dec 15, 2016 12:42 PM (in response to mayerw01)Wolfgang, thanks for your reply.
I already tried using quickstart example and I got this message:
javax.naming.NoInitialContextException: Cannot instantiate class: org.jboss.naming.remote.client.InitialContextFactory [Root exception is java.lang.ClassNotFoundException: org.jboss.naming.remote.client.InitialContextFactory]
I googled about this issue, but this solution didn't work out.
Any other idea?
-
3. Re: javax.naming.CommunicationException: Receive timed out
mayerw01 Dec 16, 2016 4:41 AM (in response to fhighlander)You should add the jboss-remote-naming-2.0.4.Final.jar