我是javaee的新手。在Wildfly 13上创建具有远程接口的EJB状态Bean,并在同一组件上创建独立的简单JavaFX + Maven应用程序。尝试从JavaFX连接到EJB。
final Hashtable jndiProperties = new Hashtable();
jndiProperties.put(Context.INITIAL_CONTEXT_FACTORY, "org.wildfly.naming.client.WildFlyInitialContextFactory");
jndiProperties.put(Context.PROVIDER_URL,"http-remoting://127.0.0.1:8080");
Context ctx = new InitialContext(jndiProperties);
accEJB = (AccEJBRemote) ctx.lookup("java:jboss/exported/home-acc-1.0-SNAPSHOT/AccEJB!home.acc.AccEJBRemote");
查找异常:
июл. 18, 2018 12:04:13 ПП org.wildfly.naming.client.Version <clinit>
INFO: WildFly Naming version 1.0.9.Final
июл. 18, 2018 12:04:13 ПП org.wildfly.security.Version <clinit>
INFO: ELY00001: WildFly Elytron version 1.2.4.Final
июл. 18, 2018 12:04:13 ПП org.xnio.Xnio <clinit>
INFO: XNIO version 3.6.2.Final
июл. 18, 2018 12:04:13 ПП org.xnio.nio.NioXnio <clinit>
INFO: XNIO NIO Implementation Version 3.6.2.Final
июл. 18, 2018 12:04:13 ПП org.jboss.threads.Version <clinit>
INFO: JBoss Threads version 2.3.2.Final
июл. 18, 2018 12:04:13 ПП org.jboss.remoting3.EndpointImpl <clinit>
INFO: JBoss Remoting version 5.0.5.Final
javax.naming.CommunicationException: WFNAM00018: Failed to connect to remote host [Root exception is org.jboss.remoting3.ServiceOpenException: Unknown service name]
不知道如何解决它。请帮忙。 服务器和EJB在线。 JNDI从服务器用户界面获取。