Unable to get remote connection to connect via ejb:/
lancetx Jun 5, 2013 3:47 PMI had an application that was working fine under JBoss AS 7.1 and 7.2, but since they were nearing time to go to production I wanted to move them to a non-beta platform and have been trying to get them to work under EAP 6.1 with no luck. I've tried all the examples and quickstarts I could find. This is only one of several projects I have to keep working on so it's been very frustrating.
Here is what I have so far in my test.
The test connection:
SecurityEntityManager securityManager = (SecurityEntityManager) getInitialContext().lookup(getLookupName());
...
public static String getLookupName() {
StringBuffer sb = new StringBuffer();
final String appName = "";
final String moduleName = "psa-server-jboss-ejb3";
final String distinctName = "";
final String beanName = "SecurityEntityManagerEJB";
final String viewClassName = SecurityEntityManager.class.getName();
sb.append("ejb:");
sb.append(appName);
sb.append("/");
sb.append(moduleName);
sb.append("/");
sb.append(distinctName);
sb.append("/");
sb.append(beanName);
sb.append("!");
sb.append(viewClassName);
log.debug(" jndi lookup: >" + sb.toString());
log.debug(" ");
return sb.toString();
}
public Context getInitialContext() throws NamingException {
InitialContext initialContext = null;
Properties jndiProperties = new Properties();
jndiProperties.put("jboss.naming.client.ejb.context", Boolean.TRUE);
jndiProperties.put(Context.URL_PKG_PREFIXES, "org.jboss.ejb.client.naming");
jndiProperties.put(javax.naming.Context.INITIAL_CONTEXT_FACTORY, "org.jboss.naming.remote.client.InitialContextFactory");
jndiProperties.put(javax.naming.Context.PROVIDER_URL, "remote://10.110.40.25:4447");
jndiProperties.put(javax.naming.Context.SECURITY_PRINCIPAL, "psaadmin");
jndiProperties.put(javax.naming.Context.SECURITY_CREDENTIALS, "....");
initialContext = new InitialContext(jndiProperties);
return initialContext;
}
The jboss-ejb-client.properties file:
endpoint.name=PSA-Client-V2
remote.connectionprovider.create.options.org.xnio.Options.SSL_ENABLED=false
remote.connections=default
remote.connection.default.username=psaadmin
remote.connection.default.password=...
remote.connection.default.connect.options.org.xnio.Options.SASL_POLICY_NOANONYMOUS=false
I enabled tracing based on another discussion I found here. So here is the results of that when I try to run the test program:
0 [main] DEBUG org.jboss.logging - Logging Provider: org.jboss.logging.Log4jLoggerProvider
19 [main] DEBUG org.jboss.ejb.client.EJBClientPropertiesLoader - Looking for jboss-ejb-client.properties using classloader sun.misc.Launcher$AppClassLoader@1d9f953d
37 [main] DEBUG org.jboss.ejb.client.remoting.ConfigBasedEJBClientContextSelector - EJB client context org.jboss.ejb.client.EJBClientContext@a761fe will have no EJB receivers associated with it since there was no EJB client configuration available to create the receivers
40 [main] DEBUG org.jboss.naming.remote.client.InitialContextFactory - Looking for jboss-naming-client.properties using classloader sun.misc.Launcher$AppClassLoader@1d9f953d
41 [main] DEBUG org.jboss.naming.remote.client.InitialContextFactory - jboss.naming.client.endpoint.create.options. has the following options {}
42 [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}
42 [main] DEBUG org.jboss.naming.remote.client.InitialContextFactory - jboss.naming.client.remote.connectionprovider.create.options. has the following options {}
42 [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}
49 [main] INFO org.xnio - XNIO Version 3.0.7.GA-redhat-1
53 [main] INFO org.xnio.nio - XNIO NIO Implementation Version 3.0.7.GA-redhat-1
54 [main] TRACE org.xnio.nio - Starting up with selector provider sun.nio.ch.KQueueSelectorProvider
57 [main] TRACE org.xnio.nio - Using polling selector type for temporary selectors.
64 [main] INFO org.jboss.remoting - JBoss Remoting version 3.2.16.GA-redhat-1
78 [main] TRACE org.xnio.nio - CAS org.xnio.nio.NioXnioWorker@77fddc31 00000001 -> 00000002
79 [main] TRACE org.xnio.nio - CAS org.xnio.nio.NioXnioWorker@77fddc31 00000002 -> 00000003
79 [Remoting "config-based-naming-client-endpoint" read-1] TRACE org.xnio.nio - Starting worker thread Thread[Remoting "config-based-naming-client-endpoint" read-1,5,main]
79 [Remoting "config-based-naming-client-endpoint" read-1] DEBUG org.xnio.nio - Started channel thread 'Remoting "config-based-naming-client-endpoint" read-1', selector sun.nio.ch.KQueueSelectorImpl@509f5011
79 [Remoting "config-based-naming-client-endpoint" write-1] TRACE org.xnio.nio - Starting worker thread Thread[Remoting "config-based-naming-client-endpoint" write-1,5,main]
79 [Remoting "config-based-naming-client-endpoint" write-1] DEBUG org.xnio.nio - Started channel thread 'Remoting "config-based-naming-client-endpoint" write-1', selector sun.nio.ch.KQueueSelectorImpl@5557c2bd
79 [Remoting "config-based-naming-client-endpoint" read-1] TRACE org.xnio.nio.selector - Beginning select on sun.nio.ch.KQueueSelectorImpl@509f5011
79 [Remoting "config-based-naming-client-endpoint" write-1] TRACE org.xnio.nio.selector - Beginning select on sun.nio.ch.KQueueSelectorImpl@5557c2bd
83 [main] TRACE org.jboss.remoting.endpoint - Completed open of endpoint "config-based-naming-client-endpoint" <47315d34>
84 [main] TRACE org.jboss.remoting.endpoint - Allocated tick to 1 of endpoint "config-based-naming-client-endpoint" <47315d34> (opened Connection provider for remote)
130 [main] TRACE org.jboss.remoting.endpoint - Adding connection provider registration named 'remote': Remoting remote connection provider 5d6d2633 for endpoint "config-based-naming-client-endpoint" <47315d34>
133 [main] DEBUG org.jboss.naming.remote.client.InitialContextFactory - jboss.naming.client.connect.options. has the following options {}
133 [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}
139 [main] DEBUG com.psasoft.tools - jndi lookup: >ejb:/psa-server-jboss-ejb3//SecurityEntityManagerEJB!com.psasoft.security.interfaces.SecurityEntityManager
139 [main] DEBUG com.psasoft.tools -
164 [main] INFO org.jboss.ejb.client - JBoss EJB Client version 1.0.21.Final-redhat-1
Exception in thread "main" java.lang.IllegalStateException: EJBCLIENT000025: No EJB receiver available for handling [appName:, moduleName:psa-server-jboss-ejb3, distinctName:] combination for invocation context org.jboss.ejb.client.EJBClientInvocationContext@4026e9f9
at org.jboss.ejb.client.EJBClientContext.requireEJBReceiver(EJBClientContext.java:727)
at org.jboss.ejb.client.ReceiverInterceptor.handleInvocation(ReceiverInterceptor.java:116)
at org.jboss.ejb.client.EJBClientInvocationContext.sendRequest(EJBClientInvocationContext.java:183)
at org.jboss.ejb.client.EJBInvocationHandler.sendRequestWithPossibleRetries(EJBInvocationHandler.java:253)
at org.jboss.ejb.client.EJBInvocationHandler.doInvoke(EJBInvocationHandler.java:198)
at org.jboss.ejb.client.EJBInvocationHandler.doInvoke(EJBInvocationHandler.java:181)
at org.jboss.ejb.client.EJBInvocationHandler.invoke(EJBInvocationHandler.java:144)
at com.sun.proxy.$Proxy0.validateUsername(Unknown Source)
at com.psasoft.tools.TestRemoteConnection.<init>(TestRemoteConnection.java:33)
at com.psasoft.tools.TestRemoteConnection.main(TestRemoteConnection.java:18)
181 [Thread-2] TRACE org.jboss.remoting.resource - Closing endpoint "config-based-naming-client-endpoint" <47315d34> synchronously
182 [Thread-2] TRACE org.jboss.remoting.resource - Closing Remoting remote connection provider 5d6d2633 for endpoint "config-based-naming-client-endpoint" <47315d34> asynchronously
182 [Thread-2] TRACE org.jboss.remoting.resource - Completed close of Remoting remote connection provider 5d6d2633 for endpoint "config-based-naming-client-endpoint" <47315d34>
183 [Thread-2] TRACE org.jboss.remoting.resource - Closing Registration of 'remote': Remoting remote connection provider 5d6d2633 for endpoint "config-based-naming-client-endpoint" <47315d34> asynchronously
183 [Thread-2] TRACE org.jboss.remoting.resource - Closing Remoting remote connection provider 5d6d2633 for endpoint "config-based-naming-client-endpoint" <47315d34> asynchronously
183 [Thread-2] TRACE org.jboss.remoting.resource - Completed close of Registration of 'remote': Remoting remote connection provider 5d6d2633 for endpoint "config-based-naming-client-endpoint" <47315d34>
183 [Thread-2] TRACE org.jboss.remoting.endpoint - Finished phase 1 shutdown of endpoint "config-based-naming-client-endpoint" <47315d34>
184 [Thread-2] TRACE org.xnio.nio - Initiating shutdown of org.xnio.nio.NioXnioWorker@77fddc31
184 [Thread-2] TRACE org.xnio.nio - CAS org.xnio.nio.NioXnioWorker@77fddc31 80000003 -> 80000002
185 [Thread-2] TRACE org.jboss.remoting.resource - Closing Remoting local connection provider 6855a338 for endpoint "config-based-naming-client-endpoint" <47315d34> asynchronously
185 [Thread-2] TRACE org.jboss.remoting.resource - Completed close of Remoting local connection provider 6855a338 for endpoint "config-based-naming-client-endpoint" <47315d34>
185 [Remoting "config-based-naming-client-endpoint" write-1] TRACE org.xnio.nio.selector - Selected on sun.nio.ch.KQueueSelectorImpl@5557c2bd
185 [Remoting "config-based-naming-client-endpoint" write-1] TRACE org.xnio.nio - Shutting down channel thread "Thread[Remoting "config-based-naming-client-endpoint" write-1,5,main]"
185 [Remoting "config-based-naming-client-endpoint" read-1] TRACE org.xnio.nio.selector - Selected on sun.nio.ch.KQueueSelectorImpl@509f5011
185 [Remoting "config-based-naming-client-endpoint" read-1] TRACE org.xnio.nio - Shutting down channel thread "Thread[Remoting "config-based-naming-client-endpoint" read-1,5,main]"
190 [Remoting "config-based-naming-client-endpoint" write-1] TRACE org.xnio.safe-close - Closing resource sun.nio.ch.KQueueSelectorImpl@5557c2bd
190 [Remoting "config-based-naming-client-endpoint" read-1] TRACE org.xnio.safe-close - Closing resource sun.nio.ch.KQueueSelectorImpl@509f5011
191 [Remoting "config-based-naming-client-endpoint" read-1] TRACE org.xnio.nio - CAS org.xnio.nio.NioXnioWorker@77fddc31 80000002 -> 80000001
191 [Remoting "config-based-naming-client-endpoint" write-1] TRACE org.xnio.nio - CAS org.xnio.nio.NioXnioWorker@77fddc31 80000001 -> 80000000
192 [Remoting "config-based-naming-client-endpoint" write-1] TRACE org.xnio.nio - CAS org.xnio.nio.NioXnioWorker@77fddc31 80000000 -> c0000000 (close complete)
192 [Remoting "config-based-naming-client-endpoint" write-1] TRACE org.jboss.remoting.resource - Completed close of endpoint "config-based-naming-client-endpoint" <47315d34>
I've had various errors but always seem to come back to this one. I had never used a user in the application realm, but added one to test that, and got past the connection errors. So now it seems to be a simple lookup error, but I can't figure out what it is and seem to be going in circles.
Any help would be appreciated.
Lance