onAction = EventHandler { _ -> val jndiProperties = Properties() jndiProperties.put(Context.URL_PKG_PREFIXES, "org.jboss.ejb.client.naming") jndiProperties.put("jboss.naming.client.ejb.context", true) jndiProperties.put("remote.connections", "default") jndiProperties.put("remote.connection.default.host", "localhost") jndiProperties.put("remote.connection.default.port", "8080") val ejbClientConfiguration = PropertiesBasedEJBClientConfiguration(jndiProperties) val contextSelector = ConfigBasedEJBClientContextSelector(ejbClientConfiguration) EJBClientContext.setSelector(contextSelector) val name = "ejb:/wf_kotlin_ejb_ejb_exploded/HelloWorldBean!wfkejb.HelloWorld" val context = InitialContext(jndiProperties) val ejb = context.lookup(name) as HelloWorld println("msg=${ejb.getMessage()}") }