Kann keine Verbindung zum jboss-server - Vorgang ist fehlgeschlagen mit dem status " WARTEN
Habe diese Ausnahme beim Versuch, eine Verbindung zum lokalen jboss-server (wildfly-8.2.0.Final)
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.<init>(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
JNDI-Eigenschaften sind folgende:
@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);
}
Telnet sagt auch, dass es keine Verbindung zum server mit der port 4447. Ich öffnete diesen port in der firewall, aber es hat nicht geholfen.
Du musst angemeldet sein, um einen Kommentar abzugeben.
Standardmäßig WildFly verwendet
8080
als remoting-port. Der EJB-client-API verwendet den http-port, mit dem http-upgrade-Funktionalität für die Kommunikation mit dem server für den remote-Aufruf.ZB:
Finden Sie unter: Remote-EJB-Aufrufe über JNDI - EJB-client-API oder remote-naming-Projekt
Wenn Sie mit maven, vergessen Sie nicht, fügen Sie diese Abhängigkeit:
JMS, müssen Sie diese als gut:
Sollte dies die einzige Abhängigkeit, die Sie brauchen.
anstelle der Verwendung von "remote://localhost:4447" "http-remoting://localhost:8080"
Wenn Sie konfigurieren Sie die jndi-Eigenschaften im code-lookup name sollte nicht enthalten
ejb:
ändern Sie Ihre Eigenschaft
Eigenschaften.put(Context.PROVIDER_URL, "remote://localhost:4447");
in
Eigenschaften.put(Context.PROVIDER_URL, "http-remoting://localhost:4447");