Thanks for the response Darran. I tried your suggestion and connected via the CLI. That pointed out an issue with my LDAP authentication setting (username-filter) where it was not authenticating. I changed the line from the username-filter to "<advanced-filter filter="(&(sAMAccountName={0}))" />, and the connection is now authenticating the user. Going back to my client test, I still don't see the connection to the LDAP server. I turned on TRACE logging and included the output below. I've also included part of the client test app (code for setting up InitialContext). I could be doing something wrong with this setup. The trace output occurs when I make the ctx.lookup() method call.
public void initContext() {
BasicConfigurator.configure();
Logger.getRootLogger().setLevel(Level.ALL);
Logger logger = Logger.getLogger(EJBConnectionTest.class);
logger.setLevel(Level.ALL);
MyJAASCallbackHandler.setCredential("admin", "##########");
Properties jndiProps = new Properties();
jndiProps.put("java.naming.factory.initial","org.jboss.naming.remote.client.InitialContextFactory");
jndiProps.put(InitialContext.PROVIDER_URL, "http-remoting://" + hostname + ":8080");
jndiProps.put("jboss.naming.client.ejb.context", true);
jndiProps.put(Context.SECURITY_PRINCIPAL, "admin");
jndiProps.put(Context.SECURITY_CREDENTIALS, "##########");
jndiProps.put(Context.URL_PKG_PREFIXES, "org.jboss.ejb.client.naming");
jndiProps.put(Options.SASL_DISALLOWED_MECHANISMS, "JBOSS-LOCAL-USER");
jndiProps.put(Options.SASL_MECHANISMS, "PLAIN");
try {
ctx = new InitialContext(jndiProps);
} catch (NamingException e) {
e.printStackTrace();
}
}
0 [main] DEBUG org.jboss.logging - Logging Provider: org.jboss.logging.Log4jLoggerProvider
17 [main] DEBUG org.jboss.ejb.client.EJBClientPropertiesLoader - Looking for jboss-ejb-client.properties using classloader sun.misc.Launcher$AppClassLoader@69af0fcf
63 [main] DEBUG org.jboss.as.ejb3 - Registered org.jboss.as.ejb3.remote.EJBTransactionRecoveryService@5601cb79 as a listener to EJB client context org.jboss.ejb.client.EJBClientContext@331efc39
65 [main] DEBUG org.jboss.as.ejb3 - Registered org.jboss.as.ejb3.remote.EJBTransactionRecoveryService@5601cb79 as a listener to EJB client context org.jboss.ejb.client.EJBClientContext@3490b317
69 [main] DEBUG org.jboss.naming.remote.client.InitialContextFactory - Looking for jboss-naming-client.properties using classloader sun.misc.Launcher$AppClassLoader@69af0fcf
70 [main] DEBUG org.jboss.naming.remote.client.InitialContextFactory - jboss.naming.client.endpoint.create.options. has the following options {}
72 [main] TRACE org.jboss.naming.remote.client.InitialContextFactory - Options {} have been merged with defaults {org.xnio.Options.THREAD_DAEMON=>true} to form {org.xnio.Options.THREAD_DAEMON=>true}
72 [main] DEBUG org.jboss.naming.remote.client.InitialContextFactory - jboss.naming.client.remote.connectionprovider.create.options. has the following options {}
72 [main] TRACE org.jboss.naming.remote.client.InitialContextFactory - Options {} have been merged with defaults {org.xnio.Options.SSL_ENABLED=>false} to form {org.xnio.Options.SSL_ENABLED=>false}
87 [main] INFO org.xnio - XNIO version 3.1.0.CR7
109 [main] INFO org.xnio.nio - XNIO NIO Implementation Version 3.1.0.CR7
115 [main] TRACE org.xnio.nio - Starting up with selector provider class sun.nio.ch.KQueueSelectorProvider
125 [main] TRACE org.xnio.safe-close - Closing resource sun.nio.ch.PollSelectorImpl@28a39a11
125 [main] TRACE org.xnio.nio - Using Default system selector creator for provider class sun.nio.ch.KQueueSelectorProvider for main selectors and Selector creator class sun.nio.ch.PollSelectorImpl for provider class sun.nio.ch.KQueueSelectorProvider for temp selectors
214 [main] INFO org.jboss.remoting - JBoss Remoting version (unknown)
234 [main] TRACE org.xnio.nio - CAS org.xnio.nio.NioXnioWorker@39346e64 00000001 -> 00000002
234 [Remoting "config-based-naming-client-endpoint" I/O-1] TRACE org.xnio.nio - Starting worker thread Thread[Remoting "config-based-naming-client-endpoint" I/O-1,5,main]
235 [Remoting "config-based-naming-client-endpoint" I/O-1] DEBUG org.xnio.nio - Started channel thread 'Remoting "config-based-naming-client-endpoint" I/O-1', selector sun.nio.ch.KQueueSelectorImpl@3adbe109
236 [Remoting "config-based-naming-client-endpoint" I/O-1] TRACE org.xnio.nio.selector - Beginning select on sun.nio.ch.KQueueSelectorImpl@3adbe109
243 [main] TRACE org.jboss.remoting.endpoint - Completed open of endpoint "config-based-naming-client-endpoint" <5b2df081>
244 [main] TRACE org.jboss.remoting.endpoint - Allocated tick to 1 of endpoint "config-based-naming-client-endpoint" <5b2df081> (opened Connection provider for remote)
298 [main] TRACE org.jboss.remoting.endpoint - Adding connection provider registration named 'remote': Remoting remote connection provider 112a39aa for endpoint "config-based-naming-client-endpoint" <5b2df081>
300 [main] TRACE org.jboss.remoting.endpoint - Allocated tick to 2 of endpoint "config-based-naming-client-endpoint" <5b2df081> (opened Connection provider for http-remoting)
302 [main] TRACE org.jboss.remoting.endpoint - Adding connection provider registration named 'http-remoting': Remoting remote connection provider d741426 for endpoint "config-based-naming-client-endpoint" <5b2df081>
302 [main] TRACE org.jboss.remoting.endpoint - Allocated tick to 3 of endpoint "config-based-naming-client-endpoint" <5b2df081> (opened Connection provider for https-remoting)
303 [main] TRACE org.jboss.remoting.endpoint - Adding connection provider registration named 'https-remoting': Remoting remote connection provider 61cfa835 for endpoint "config-based-naming-client-endpoint" <5b2df081>
304 [main] DEBUG org.jboss.naming.remote.client.InitialContextFactory - jboss.naming.client.connect.options. has the following options {}
304 [main] TRACE org.jboss.naming.remote.client.InitialContextFactory - Options {} have been merged with defaults {org.xnio.Options.SASL_POLICY_NOANONYMOUS=>false} to form {org.xnio.Options.SASL_POLICY_NOANONYMOUS=>false}
9734 [main] TRACE org.jboss.remoting.endpoint - Allocated tick to 4 of endpoint "config-based-naming-client-endpoint" <5b2df081> (opened Connection to lamarspc/172.16.201.30:8080)
9781 [main] TRACE org.jboss.remoting.remote - Attempting to connect to "lamarspc/172.16.201.30:8080" with options {org.xnio.Options.SASL_POLICY_NOANONYMOUS=>false}
9824 [Remoting "config-based-naming-client-endpoint" I/O-1] TRACE org.xnio.nio.selector - Selected on sun.nio.ch.KQueueSelectorImpl@3adbe109
9824 [Remoting "config-based-naming-client-endpoint" I/O-1] TRACE org.xnio.nio - Running task org.xnio.nio.WorkerThread$SynchTask@67e1ab17
9824 [Remoting "config-based-naming-client-endpoint" I/O-1] TRACE org.xnio.nio.selector - Beginning select on sun.nio.ch.KQueueSelectorImpl@3adbe109
9884 [Remoting "config-based-naming-client-endpoint" I/O-1] TRACE org.xnio.nio.selector - Selected on sun.nio.ch.KQueueSelectorImpl@3adbe109
9885 [Remoting "config-based-naming-client-endpoint" I/O-1] TRACE org.xnio.nio.selector - Selected key sun.nio.ch.SelectionKeyImpl@5081876b for java.nio.channels.SocketChannel[connection-pending local=/0.0.0.0:49856 remote=lamarspc/172.16.201.30:8080]
9885 [Remoting "config-based-naming-client-endpoint" I/O-1] TRACE org.xnio.listener - Invoking listener org.xnio.http.HttpUpgrade$HttpUpgradeState$ConnectionOpenListener@6c809f30 on channel org.xnio.nio.NioSocketStreamConnection@70533ff6
9888 [Remoting "config-based-naming-client-endpoint" I/O-1] TRACE org.xnio.nio.selector - Beginning select on sun.nio.ch.KQueueSelectorImpl@3adbe109
9888 [Remoting "config-based-naming-client-endpoint" I/O-1] TRACE org.xnio.nio.selector - Selected on sun.nio.ch.KQueueSelectorImpl@3adbe109
9888 [Remoting "config-based-naming-client-endpoint" I/O-1] TRACE org.xnio.nio.selector - Selected key sun.nio.ch.SelectionKeyImpl@5081876b for java.nio.channels.SocketChannel[connected local=/172.16.201.11:49856 remote=lamarspc/172.16.201.30:8080]
9889 [Remoting "config-based-naming-client-endpoint" I/O-1] TRACE org.xnio.listener - Invoking listener org.xnio.http.HttpUpgrade$HttpUpgradeState$UpgradeResultListener@67da11d8 on channel org.xnio.conduits.ConduitStreamSourceChannel@1dc9b12c
9889 [Remoting "config-based-naming-client-endpoint" I/O-1] TRACE org.xnio.listener - Invoking listener org.jboss.remoting3.remote.HttpUpgradeConnectionProvider$2@2227ca20 on channel org.xnio.nio.NioSocketStreamConnection@70533ff6
9893 [Remoting "config-based-naming-client-endpoint" I/O-1] TRACE org.xnio.listener - Invoking listener org.jboss.remoting3.remote.RemoteConnectionProvider$3@75dd05d6 on channel org.xnio.channels.AssembledConnectedStreamChannel@1aa610e
9900 [Remoting "config-based-naming-client-endpoint" I/O-1] TRACE org.xnio.channels.framed - Created new framed message channel around org.xnio.channels.AssembledConnectedStreamChannel@1aa610e, receive buffer Pooled wrapper around java.nio.HeapByteBuffer[pos=0 lim=8196 cap=8196], transmit buffer Pooled wrapper around java.nio.HeapByteBuffer[pos=0 lim=8196 cap=8196]
9903 [Remoting "config-based-naming-client-endpoint" I/O-1] TRACE org.jboss.remoting.remote - Setting read listener to org.jboss.remoting3.remote.ClientConnectionOpenListener$Greeting@1b2d6c22
9904 [Remoting "config-based-naming-client-endpoint" I/O-1] TRACE org.xnio.nio.selector - Beginning select on sun.nio.ch.KQueueSelectorImpl@3adbe109
9904 [Remoting "config-based-naming-client-endpoint" I/O-1] TRACE org.xnio.nio.selector - Selected on sun.nio.ch.KQueueSelectorImpl@3adbe109
9904 [Remoting "config-based-naming-client-endpoint" I/O-1] TRACE org.xnio.nio.selector - Selected key sun.nio.ch.SelectionKeyImpl@5081876b for java.nio.channels.SocketChannel[connected local=/172.16.201.11:49856 remote=lamarspc/172.16.201.30:8080]
9904 [Remoting "config-based-naming-client-endpoint" I/O-1] TRACE org.xnio.listener - Invoking listener Delegating channel listener -> Read listener for org.xnio.channels.FramedMessageChannel around org.xnio.channels.AssembledConnectedStreamChannel@1aa610e on channel org.xnio.conduits.ConduitStreamSourceChannel@1dc9b12c
9904 [Remoting "config-based-naming-client-endpoint" I/O-1] TRACE org.xnio.listener - Invoking listener Read listener for org.xnio.channels.FramedMessageChannel around org.xnio.channels.AssembledConnectedStreamChannel@1aa610e on channel org.xnio.channels.AssembledConnectedStreamChannel@1aa610e
9904 [Remoting "config-based-naming-client-endpoint" I/O-1] TRACE org.xnio.listener - Invoking listener org.jboss.remoting3.remote.ClientConnectionOpenListener$Greeting@1b2d6c22 on channel org.xnio.channels.FramedMessageChannel around org.xnio.channels.AssembledConnectedStreamChannel@1aa610e
9905 [Remoting "config-based-naming-client-endpoint" I/O-1] TRACE org.xnio.channels.framed - Copying message from java.nio.HeapByteBuffer[pos=4 lim=31 cap=8196] into java.nio.HeapByteBuffer[pos=0 lim=8192 cap=8192]
9905 [Remoting "config-based-naming-client-endpoint" I/O-1] TRACE org.jboss.remoting.remote.client - Received java.nio.HeapByteBuffer[pos=27 lim=8192 cap=8192]
9905 [Remoting "config-based-naming-client-endpoint" I/O-1] TRACE org.jboss.remoting.remote.client - Client received greeting
9905 [Remoting "config-based-naming-client-endpoint" I/O-1] TRACE org.jboss.remoting.remote.client - Client received server name: lamarspc.ambientcorp.com
9905 [Remoting "config-based-naming-client-endpoint" I/O-1] TRACE org.jboss.remoting.remote.client - Client sending capabilities request
9908 [Remoting "config-based-naming-client-endpoint" I/O-1] TRACE org.jboss.remoting.remote - Setting read listener to org.jboss.remoting3.remote.ClientConnectionOpenListener$Capabilities@2513e259
9908 [Remoting "config-based-naming-client-endpoint" I/O-1] TRACE org.xnio.channels.framed - Accepting java.nio.HeapByteBuffer[pos=0 lim=54 cap=8192] into java.nio.HeapByteBuffer[pos=0 lim=8196 cap=8196]
9908 [Remoting "config-based-naming-client-endpoint" I/O-1] TRACE org.xnio.channels.framed - Accepted a message into java.nio.HeapByteBuffer[pos=58 lim=8196 cap=8196]
9908 [Remoting "config-based-naming-client-endpoint" I/O-1] TRACE org.xnio.channels.framed - Fully flushed org.xnio.channels.FramedMessageChannel around org.xnio.channels.AssembledConnectedStreamChannel@1aa610e
9908 [Remoting "config-based-naming-client-endpoint" I/O-1] TRACE org.jboss.remoting.remote.connection - Sent message java.nio.HeapByteBuffer[pos=54 lim=54 cap=8192] (direct)
9909 [Remoting "config-based-naming-client-endpoint" I/O-1] TRACE org.xnio.channels.framed - Fully flushed org.xnio.channels.FramedMessageChannel around org.xnio.channels.AssembledConnectedStreamChannel@1aa610e
9909 [Remoting "config-based-naming-client-endpoint" I/O-1] TRACE org.jboss.remoting.remote.connection - Flushed channel (direct)
9909 [Remoting "config-based-naming-client-endpoint" I/O-1] TRACE org.xnio.nio.selector - Beginning select on sun.nio.ch.KQueueSelectorImpl@3adbe109 (with timeout)
9909 [Remoting "config-based-naming-client-endpoint" I/O-1] TRACE org.xnio.nio.selector - Selected on sun.nio.ch.KQueueSelectorImpl@3adbe109
9909 [Remoting "config-based-naming-client-endpoint" I/O-1] TRACE org.xnio.nio.selector - Beginning select on sun.nio.ch.KQueueSelectorImpl@3adbe109 (with timeout)
9912 [Remoting "config-based-naming-client-endpoint" I/O-1] TRACE org.xnio.nio.selector - Selected on sun.nio.ch.KQueueSelectorImpl@3adbe109
9912 [Remoting "config-based-naming-client-endpoint" I/O-1] TRACE org.xnio.nio.selector - Selected key sun.nio.ch.SelectionKeyImpl@5081876b for java.nio.channels.SocketChannel[connected local=/172.16.201.11:49856 remote=lamarspc/172.16.201.30:8080]
9913 [Remoting "config-based-naming-client-endpoint" I/O-1] TRACE org.xnio.listener - Invoking listener Delegating channel listener -> Read listener for org.xnio.channels.FramedMessageChannel around org.xnio.channels.AssembledConnectedStreamChannel@1aa610e on channel org.xnio.conduits.ConduitStreamSourceChannel@1dc9b12c
9913 [Remoting "config-based-naming-client-endpoint" I/O-1] TRACE org.xnio.listener - Invoking listener Read listener for org.xnio.channels.FramedMessageChannel around org.xnio.channels.AssembledConnectedStreamChannel@1aa610e on channel org.xnio.channels.AssembledConnectedStreamChannel@1aa610e
9913 [Remoting "config-based-naming-client-endpoint" I/O-1] TRACE org.xnio.listener - Invoking listener org.jboss.remoting3.remote.ClientConnectionOpenListener$Capabilities@2513e259 on channel org.xnio.channels.FramedMessageChannel around org.xnio.channels.AssembledConnectedStreamChannel@1aa610e
9913 [Remoting "config-based-naming-client-endpoint" I/O-1] TRACE org.xnio.channels.framed - Copying message from java.nio.HeapByteBuffer[pos=4 lim=40 cap=8196] into java.nio.HeapByteBuffer[pos=0 lim=8192 cap=8192]
9913 [Remoting "config-based-naming-client-endpoint" I/O-1] TRACE org.jboss.remoting.remote.client - Client received capabilities response
9913 [Remoting "config-based-naming-client-endpoint" I/O-1] TRACE org.jboss.remoting.remote.client - Client received capability: version 1
9913 [Remoting "config-based-naming-client-endpoint" I/O-1] TRACE org.jboss.remoting.remote.client - Client received capability: remote endpoint name "lamarspc"
9913 [Remoting "config-based-naming-client-endpoint" I/O-1] TRACE org.jboss.remoting.remote.client - Client received capability: SASL mechanism PLAIN
9913 [Remoting "config-based-naming-client-endpoint" I/O-1] TRACE org.jboss.remoting.remote.client - SASL mechanism PLAIN added to allowed set
9914 [Remoting "config-based-naming-client-endpoint" I/O-1] TRACE org.jboss.remoting.remote.client - Client received capability: message close protocol supported
9914 [Remoting "config-based-naming-client-endpoint" I/O-1] TRACE org.jboss.remoting.remote.client - Client received capability: remote version is "4.0.0.Beta1"
9946 [Remoting "config-based-naming-client-endpoint" I/O-1] TRACE org.jboss.remoting.remote.connection - Connection error detail
javax.security.sasl.SaslException: Authentication failed: all available authentication mechanisms failed
at org.jboss.remoting3.remote.ClientConnectionOpenListener$Capabilities.handleEvent(ClientConnectionOpenListener.java:397)
at org.jboss.remoting3.remote.ClientConnectionOpenListener$Capabilities.handleEvent(ClientConnectionOpenListener.java:227)
at org.xnio.ChannelListeners.invokeChannelListener(ChannelListeners.java:92)
at org.xnio.channels.TranslatingSuspendableChannel.handleReadable(TranslatingSuspendableChannel.java:196)
at org.xnio.channels.TranslatingSuspendableChannel$1.handleEvent(TranslatingSuspendableChannel.java:110)
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:87)
at org.xnio.nio.WorkerThread.run(WorkerThread.java:528)
9949 [Remoting "config-based-naming-client-endpoint" I/O-1] ERROR org.jboss.remoting.remote.connection - JBREM000200: Remote connection failed: javax.security.sasl.SaslException: Authentication failed: all available authentication mechanisms failed
9949 [Remoting "config-based-naming-client-endpoint" I/O-1] TRACE org.xnio.safe-close - Closing resource org.xnio.channels.FramedMessageChannel around org.xnio.channels.AssembledConnectedStreamChannel@1aa610e
9949 [Remoting "config-based-naming-client-endpoint" I/O-1] TRACE org.xnio.channels.framed - Fully flushed org.xnio.channels.FramedMessageChannel around org.xnio.channels.AssembledConnectedStreamChannel@1aa610e
9950 [Remoting "config-based-naming-client-endpoint" I/O-1] TRACE org.xnio.nio - Cancelling key sun.nio.ch.SelectionKeyImpl@5081876b of java.nio.channels.SocketChannel[connected local=/172.16.201.11:49856 remote=lamarspc/172.16.201.30:8080] (same thread)
9