EJB invocations from a remote client using JNDI: Invalid User-Collection of common programming errors

I’m trying to invocations from a remote client using JNDI in JBOSS 7.1.1, but I get the exception:

Exception in thread “main” javax.ejb.EJBAccessException: JBAS013323: Invalid User at org.jboss.as.ejb3.security.SecurityContextInterceptor$1.run(SecurityContextInterceptor.java:54) at org.jboss.as.ejb3.security.SecurityContextInterceptor$1.run(SecurityContextInterceptor.java:45) at java.security.AccessController.doPrivileged(Native Method) at org.jboss.as.ejb3.security.SecurityContextInterceptor.processInvocation(SecurityContextInterceptor.java:74) at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) at org.jboss.as.ejb3.component.interceptors.LoggingInterceptor.processInvocation(LoggingInterceptor.java:59) at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) at org.jboss.as.ee.component.NamespaceContextInterceptor.processInvocation(NamespaceContextInterceptor.java:50) at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) at org.jboss.as.ejb3.component.interceptors.AdditionalSetupInterceptor.processInvocation(AdditionalSetupInterceptor.java:43) at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) at org.jboss.as.ee.component.TCCLInterceptor.processInvocation(TCCLInterceptor.java:45) at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61) at org.jboss.as.ee.component.ViewService$View.invoke(ViewService.java:165) at org.jboss.as.ejb3.remote.protocol.versionone.MethodInvocationMessageHandler.invokeMethod(MethodInvocationMessageHandler.java:302) at org.jboss.as.ejb3.remote.protocol.versionone.MethodInvocationMessageHandler.access$200(MethodInvocationMessageHandler.java:64) at org.jboss.as.ejb3.remote.protocol.versionone.MethodInvocationMessageHandler$1.run(MethodInvocationMessageHandler.java:196) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303) at java.util.concurrent.FutureTask.run(FutureTask.java:138) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at java.lang.Thread.run(Thread.java:662) at org.jboss.threads.JBossThread.run(JBossThread.java:122) at …asynchronous invocation…(Unknown Source) at org.jboss.ejb.client.remoting.InvocationExceptionResponseHandler$MethodInvocationExceptionResultProducer.getResult(InvocationExceptionResponseHandler.java:99) at org.jboss.ejb.client.EJBClientInvocationContext.getResult(EJBClientInvocationContext.java:270) at org.jboss.ejb.client.TransactionInterceptor.handleInvocationResult(TransactionInterceptor.java:47) at org.jboss.ejb.client.EJBClientInvocationContext.getResult(EJBClientInvocationContext.java:272) at org.jboss.ejb.client.ReceiverInterceptor.handleInvocationResult(ReceiverInterceptor.java:132) at org.jboss.ejb.client.EJBClientInvocationContext.getResult(EJBClientInvocationContext.java:260) at org.jboss.ejb.client.EJBClientInvocationContext.awaitResponse(EJBClientInvocationContext.java:399) at org.jboss.ejb.client.EJBInvocationHandler.doInvoke(EJBInvocationHandler.java:140) at org.jboss.ejb.client.EJBInvocationHandler.doInvoke(EJBInvocationHandler.java:121) at org.jboss.ejb.client.EJBInvocationHandler.invoke(EJBInvocationHandler.java:104) at $Proxy0.informarDados(Unknown Source) at br.com.ciss.client.service.informacao.InformacaoServiceImpl.informarDados(InformacaoServiceImpl.java:224) at br.com.ciss.client.agente.EnviaInformacaoMaquina.enviarInformacao(EnviaInformacaoMaquina.java:29) at br.com.ciss.client.agente.EnviaInformacaoMaquina.main(EnviaInformacaoMaquina.java:49) 1325 [Thread-1] DEBUG org.jboss.ejb.client.remoting.AutoConnectionCloser – Closing Remoting connection 1329 [Remoting “config-based-ejb-client-endpoint” task-2] INFO org.jboss.ejb.client.remoting.ChannelAssociation – Channel Channel ID ec18d75d (outbound) of Remoting connection 007bc899 to localhost/127.0.0.1:4447 can no longer process messages 1426 [Thread-1] DEBUG org.jboss.ejb.client.remoting.RemotingConnectionEJBReceiver – Closing channelChannel ID ec18d75d (outbound) of Remoting connection 007bc899 to localhost/127.0.0.1:4447 1427 [Thread-1] DEBUG org.jboss.ejb.client.remoting.ChannelAssociation – Closing channel Channel ID ec18d75d (outbound) of Remoting connection 007bc899 to localhost/127.0.0.1:4447 1428 [Thread-1] DEBUG org.jboss.ejb.client.remoting.ChannelAssociation – Registering a re-connect handler org.jboss.ejb.client.remoting.EJBClientContextConnectionReconnectHandler@a2220f for broken channel Channel ID ec18d75d (outbound) of Remoting connection 007bc899 to localhost/127.0.0.1:4447 in EJB client context org.jboss.ejb.client.EJBClientContext@c8376b 1433 [Thread-1] DEBUG org.jboss.ejb.client.remoting.AutoConnectionCloser – Closing endpoint “config-based-ejb-client-endpoint”

I’m using the security mechanisms of jboss, and I have added the user through the add-user.bat also have the file jboss-ejb-client.properties with username and password and still get the exception. I followed the example set of the link:EJB invocations from a remote client using JNDI, the same works when I’m not using the security mechanisms, but when I use the security mechanisms the error occurs

What you’re missing?