endpoint is not open for standalone ejb client with Wildfly 10
mariushoble Jun 8, 2016 2:03 PMI have the following test scenario:
1. Wildfly 10 configured with SSL. Please see below some of the configuration in standard-full.xml
<security-realms>
<security-realm name="HttpsRealm">
<server-identities>
<ssl>
<keystore path="myapp-server.keystore" relative-to="jboss.server.config.dir" keystore-password="myapp-server-cms66" alias="myapp-server" key-password="myapp-server-cms66"/>
</ssl>
</server-identities>
<authentication>
<properties path="httpsrealm-users.properties" relative-to="jboss.server.config.dir" plain-text="false"/>
</authentication>
</security-realm>
</security-realms>
<subsystem xmlns="urn:jboss:domain:ejb3:4.0">
<remote connector-ref="https-remoting-connector" thread-pool-name="default"/>
..................
</subsystem>
<subsystem xmlns="urn:jboss:domain:remoting:3.0">
<endpoint/>
<http-connector name="http-remoting-connector" connector-ref="default" security-realm="ApplicationRealm"/>
<http-connector name="https-remoting-connector" connector-ref="default-https" security-realm="HttpsRealm" sasl-protocol="remote"/>
</subsystem>
<subsystem xmlns="urn:jboss:domain:undertow:3.0">
<buffer-cache name="default"/>
<server name="default-server">
<http-listener name="default" socket-binding="http" redirect-socket="https"/>
<https-listener name="default-https" enabled-protocols="TLSv1.2" security-realm="HttpsRealm" socket-binding="https"/>
..................
</subsystem>
<socket-binding name="http" port="${jboss.http.port:8089}"/>
<socket-binding name="https" port="${jboss.https.port:8443}"/>
2. EJB client code :
public static void main(String[] args) {
String serviceName = "ejb:...";
Properties prop = new Properties();
prop.put(Context.URL_PKG_PREFIXES, "org.jboss.ejb.client.naming");
try {
Context context = new InitialContext(prop);
SomeSessionFacade service = (SomeFacade)context.lookup(serviceName);
SomeDTO dto = service.findByPrimaryKey(45226);
if(dto!=null)
System.out.println(dto.getFilename());
else
System.out.println("dto is null");
context.close();
} catch (NamingException e) {
e.printStackTrace();
} catch (RemoteException e) {
e.printStackTrace();
}
}
3. jboss-ejb-client.properties
remote.connections=default
remote.connection.default.host=localhost
remote.connection.default.port=8443
remote.connection.default.protocol=https-remoting
remote.connection.default.username=ejbUserOne
remote.connection.default.password=ejbPasswordOne@123
remote.connection.default.connect.options.org.xnio.Options.SASL_POLICY_NOPLAINTEXT=false
remote.connection.default.connect.options.org.xnio.Options.SASL_POLICY_NOANONYMOUS=false
remote.connection.default.connect.options.org.xnio.Options.SSL_STARTTLS=true
remote.connection.default.connect.options.org.xnio.Options.SSL_PROTOCOL=TLSv1.2
remote.connectionprovider.create.options.org.xnio.Options.SSL_ENABLED=true
4. Run client from console
java -Djavax.net.ssl.trustStorePassword=myapp-client-cms66 -Djavax.net.ssl.trustStore=C:\\Users\\someuser\\Documents\\myapp-client.keystore -jar myapp-testremote.jar
5. The result :
java.lang.RuntimeException: Operation failed with status WAITING
at org.jboss.ejb.client.remoting.IoFutureHelper.get(IoFutureHelper.java:94)
at org.jboss.ejb.client.remoting.ConnectionPool.getConnection(ConnectionPool.java:80)
at org.jboss.ejb.client.remoting.RemotingConnectionManager.getConnection(RemotingConnectionManager.java:51)
at org.jboss.ejb.client.remoting.ConfigBasedEJBClientContextSelector.setupEJBReceivers(ConfigBasedEJBClientContextSelector.java:161)
at org.jboss.ejb.client.remoting.ConfigBasedEJBClientContextSelector.getCurrent(ConfigBasedEJBClientContextSelector.java:118)
at org.jboss.ejb.client.remoting.ConfigBasedEJBClientContextSelector.getCurrent(ConfigBasedEJBClientContextSelector.java:47)
at org.jboss.ejb.client.EJBClientContext.getCurrent(EJBClientContext.java:281)
at org.jboss.ejb.client.EJBClientContext.requireCurrent(EJBClientContext.java:291)
at org.jboss.ejb.client.EJBInvocationHandler.doInvoke(EJBInvocationHandler.java:178)
at org.jboss.ejb.client.EJBInvocationHandler.invoke(EJBInvocationHandler.java:146)
at com.sun.proxy.$Proxy0.dmsRevpreviewFindByPrimaryKey(Unknown Source)
at com.emh.myapp.TestRemoteEJB.main(TestRemoteEJB.java:30)
- XNIO001007: A channel event listener threw an exception
java.util.concurrent.RejectedExecutionException: Endpoint is not open
at org.jboss.remoting3.EndpointImpl.executorUntick(EndpointImpl.java:202)
at org.jboss.remoting3.EndpointImpl$TrackingExecutor.execute(EndpointImpl.java:712)
at org.jboss.remoting3.remote.ClientConnectionOpenListener$Capabilities.handleEvent(ClientConnectionOpenListener.java:460)
at org.jboss.remoting3.remote.ClientConnectionOpenListener$Capabilities.handleEvent(ClientConnectionOpenListener.java:241)
at org.xnio.ChannelListeners.invokeChannelListener(ChannelListeners.java:92)
at org.xnio.channels.TranslatingSuspendableChannel.handleReadable(TranslatingSuspendableChannel.java:199)
at org.xnio.channels.TranslatingSuspendableChannel$1.handleEvent(TranslatingSuspendableChannel.java:113)
at org.xnio.ChannelListeners.invokeChannelListener(ChannelListeners.java:92)
at org.xnio.ChannelListeners$DelegatingChannelListener.handleEvent(ChannelListeners.java:1092)
at org.xnio.ChannelListeners.invokeChannelListener(ChannelListeners.java:92)
at org.xnio.conduits.ReadReadyHandler$ChannelListenerHandler.readReady(ReadReadyHandler.java:66)
at org.xnio.nio.NioSocketConduit.handleReady(NioSocketConduit.java:88)
at org.xnio.nio.WorkerThread.run(WorkerThread.java:559)
Exception in thread "Remoting "config-based-ejb-client-endpoint" I/O-1" java.util.concurrent.RejectedExecutionException: XNIO007007: Thread is terminating
at org.xnio.nio.WorkerThread.execute(WorkerThread.java:588)
at org.xnio.AbstractIoFuture.runNotifier(AbstractIoFuture.java:354)
at org.xnio.AbstractIoFuture.runAllNotifiers(AbstractIoFuture.java:233)
at org.xnio.AbstractIoFuture.setCancelled(AbstractIoFuture.java:291)
at org.xnio.FutureResult.setCancelled(FutureResult.java:98)
at org.xnio.nio.WorkerThread$ConnectHandle.forceTermination(WorkerThread.java:339)
at org.xnio.nio.WorkerThread.run(WorkerThread.java:492)
6. Does anyone know what this error means ? Endpoint not open ?
And perhaps what should I do to open that endpoint ?