title: Can't connect to jboss server - Operation failed with status WAITING
body: <p>Got this exception while trying to connect to local jboss server (wildfly-8.2.0.Final)</p>
  
  <pre><code>    javax.naming.NamingException: Failed to create remoting connection [Root exception is java.lang.RuntimeException: Operation failed with status WAITING]
      at org.jboss.naming.remote.client.ClientUtil.namingException(ClientUtil.java:36)
      at org.jboss.naming.remote.client.InitialContextFactory.getInitialContext(InitialContextFactory.java:121)
      at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:684)
      at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:313)
      at javax.naming.InitialContext.init(InitialContext.java:244)
      at javax.naming.InitialContext.&lt;init&gt;(InitialContext.java:216)
      at com.sample.CalculatorIntegrationTestCase.obtainProxyReferences(CalculatorIntegrationTestCase.java:34)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
      at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
      at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
      at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:24)
      at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
      at org.junit.runner.JUnitCore.run(JUnitCore.java:160)
      at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:67)
  Caused by: java.lang.RuntimeException: Operation failed with status WAITING
      at org.jboss.naming.remote.protocol.IoFutureHelper.get(IoFutureHelper.java:89)
      at org.jboss.naming.remote.client.NamingStoreCache.getRemoteNamingStore(NamingStoreCache.java:56)
      at org.jboss.naming.remote.client.InitialContextFactory.getOrCreateCachedNamingStore(InitialContextFactory.java:166)
      at org.jboss.naming.remote.client.InitialContextFactory.getOrCreateNamingStore(InitialContextFactory.java:139)
      at org.jboss.naming.remote.client.InitialContextFactory.getInitialContext(InitialContextFactory.java:104)
      ... 18 more
  </code></pre>
  
  <p>JNDI properties are following:</p>
  
  <pre><code>@BeforeClass
      public static void obtainProxyReferences() throws Throwable {
  
          Properties properties = new Properties();
          properties.put(Context.INITIAL_CONTEXT_FACTORY, "org.jboss.naming.remote.client.InitialContextFactory");
          properties.put(Context.PROVIDER_URL, "remote://localhost:4447");
          properties.put("jboss.naming.client.ejb.context", true);
          properties.put(Context.URL_PKG_PREFIXES, "org.jboss.ejb.client.naming");
          properties.put(Context.SECURITY_PRINCIPAL, "testuser");
          properties.put(Context.SECURITY_CREDENTIALS, "!Test1");
          namingContext = new InitialContext(properties);
  
          bean = (MeBeanImpl) namingContext.lookup(JNDI_NAME);
      }
  </code></pre>
  
  <p>Telnet also says that it can't connect to server with the port 4447. I opened this port in the firewall but it didn't help.</p>