3 Replies Latest reply on Sep 3, 2012 7:43 AM by wdfink

    EJB invocations from a remote client using JNDI: Invalid User

    alanoc

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

       

      [main] DEBUG org.jboss.logging  - Logging Provider: org.jboss.logging.Log4jLoggerProvider

      [main] INFO  org.jboss.ejb.client  - JBoss EJB Client version 1.0.5.Final

      [main] DEBUG org.jboss.ejb.client.EJBClientPropertiesLoader  - Looking for jboss-ejb-client.properties using classloader sun.misc.Launcher$AppClassLoader@601bb1

      [main] DEBUG org.jboss.ejb.client.EJBClientPropertiesLoader  - Found jboss-ejb-client.properties using classloader sun.misc.Launcher$AppClassLoader@601bb1

      [main] DEBUG org.jboss.ejb.client.PropertiesBasedEJBClientConfiguration  - endpoint.create.options. has the following options {}

      [main] DEBUG org.jboss.ejb.client.PropertiesBasedEJBClientConfiguration  - remote.connectionprovider.create.options. has the following options {org.xnio.Options.SSL_ENABLED=>false}

      [main] DEBUG org.jboss.ejb.client.PropertiesBasedEJBClientConfiguration  - remote.connection.default.connect.options. has the following options {org.xnio.Options.SASL_DISALLOWED_MECHANISMS=>[JBOSS-LOCAL-USER]}

      [main] DEBUG org.jboss.ejb.client.PropertiesBasedEJBClientConfiguration  - remote.connection.default.channel.options. has the following options {}

      [main] DEBUG org.jboss.ejb.client.PropertiesBasedEJBClientConfiguration  - Connection org.jboss.ejb.client.PropertiesBasedEJBClientConfiguration$RemotingConnectionConfigurationImpl@13bd574 successfully created for connection named default

      [main] DEBUG org.jboss.ejb.client.PropertiesBasedEJBClientConfiguration  - No clusters configured in properties

      [main] INFO  org.xnio  - XNIO Version 3.0.3.GA

      [main] INFO  org.xnio.nio  - XNIO NIO Implementation Version 3.0.3.GA

      [main] INFO  org.jboss.remoting  - JBoss Remoting version 3.2.3.GA

      [Remoting "config-based-ejb-client-endpoint" write-1] DEBUG org.xnio.nio  - Started channel thread 'Remoting "config-based-ejb-client-endpoint" write-1', selector sun.nio.ch.WindowsSelectorImpl@181ed9e

      [Remoting "config-based-ejb-client-endpoint" read-1] DEBUG org.xnio.nio  - Started channel thread 'Remoting "config-based-ejb-client-endpoint" read-1', selector sun.nio.ch.WindowsSelectorImpl@18f5824

      [Remoting "config-based-ejb-client-endpoint" task-4] DEBUG org.jboss.ejb.client.remoting.RemotingConnectionEJBReceiver  - Channel Channel ID f7fd41c3 (outbound) of Remoting connection 01cef4f7 to localhost/127.0.0.1:4447 opened for context EJBReceiverContext{clientContext=org.jboss.ejb.client.EJBClientContext@da18ac, receiver=Remoting connection EJB receiver [connection=Remoting connection <1bde4>,channel=jboss.ejb,nodename=alano]} Waiting for version handshake message from server

      [Remoting "config-based-ejb-client-endpoint" task-4] INFO  org.jboss.ejb.client.remoting.VersionReceiver  - Received server version 1 and marshalling strategies [river]

      [main] INFO  org.jboss.ejb.client.remoting.RemotingConnectionEJBReceiver  - Successful version handshake completed for receiver context EJBReceiverContext{clientContext=org.jboss.ejb.client.EJBClientContext@da18ac, receiver=Remoting connection EJB receiver [connection=Remoting connection <1bde4>,channel=jboss.ejb,nodename=alano]} on channel Channel ID f7fd41c3 (outbound) of Remoting connection 01cef4f7 to localhost/127.0.0.1:4447

      [Remoting "config-based-ejb-client-endpoint" task-2] DEBUG org.jboss.ejb.client.remoting.RemotingConnectionEJBReceiver  - Received module availability report for 5 modules

      [Remoting "config-based-ejb-client-endpoint" task-2] DEBUG org.jboss.ejb.client.remoting.RemotingConnectionEJBReceiver  - Registering module EJBModuleIdentifier{appName='cissupdateserver-ear', moduleName='cissupdateserver', distinctName=''} availability for receiver context EJBReceiverContext{clientContext=org.jboss.ejb.client.EJBClientContext@da18ac, receiver=Remoting connection EJB receiver [connection=Remoting connection <1bde4>,channel=jboss.ejb,nodename=alano]}

      [Remoting "config-based-ejb-client-endpoint" task-2] DEBUG org.jboss.ejb.client.remoting.RemotingConnectionEJBReceiver  - Registering module EJBModuleIdentifier{appName='jsr-77', moduleName='jsr-77', distinctName=''} availability for receiver context EJBReceiverContext{clientContext=org.jboss.ejb.client.EJBClientContext@da18ac, receiver=Remoting connection EJB receiver [connection=Remoting connection <1bde4>,channel=jboss.ejb,nodename=alano]}

      [Remoting "config-based-ejb-client-endpoint" task-2] DEBUG org.jboss.ejb.client.remoting.RemotingConnectionEJBReceiver  - Registering module EJBModuleIdentifier{appName='cissupdateserver-ear', moduleName='cissupdateserver-ear', distinctName=''} availability for receiver context EJBReceiverContext{clientContext=org.jboss.ejb.client.EJBClientContext@da18ac, receiver=Remoting connection EJB receiver [connection=Remoting connection <1bde4>,channel=jboss.ejb,nodename=alano]}

      [Remoting "config-based-ejb-client-endpoint" task-2] DEBUG org.jboss.ejb.client.remoting.RemotingConnectionEJBReceiver  - Registering module EJBModuleIdentifier{appName='cissupdateserver-ear', moduleName='cisscore', distinctName=''} availability for receiver context EJBReceiverContext{clientContext=org.jboss.ejb.client.EJBClientContext@da18ac, receiver=Remoting connection EJB receiver [connection=Remoting connection <1bde4>,channel=jboss.ejb,nodename=alano]}

      [Remoting "config-based-ejb-client-endpoint" task-2] DEBUG org.jboss.ejb.client.remoting.RemotingConnectionEJBReceiver  - Registering module EJBModuleIdentifier{appName='cissupdateserver-ear', moduleName='cissupdateserver-ejb', distinctName=''} availability for receiver context EJBReceiverContext{clientContext=org.jboss.ejb.client.EJBClientContext@da18ac, receiver=Remoting connection EJB receiver [connection=Remoting connection <1bde4>,channel=jboss.ejb,nodename=alano]}

      [Remoting "config-based-ejb-client-endpoint" task-2] WARN  org.jboss.ejb.client.remoting.ChannelAssociation  - Unsupported message received with header 0xffffffff

      [main] DEBUG org.jboss.ejb.client.remoting.ConfigBasedEJBClientContextSelector  - Registered 1 remoting EJB receivers for EJB client context org.jboss.ejb.client.EJBClientContext@da18ac

      [main] DEBUG org.jboss.ejb.client.EJBClientContext  - org.jboss.ejb.client.RandomDeploymentNodeSelector@15f7107 deployment node selector selected alano node for appname=cissupdateserver-ear,modulename=cissupdateserver-ejb,distinctname=

      [Remoting "config-based-ejb-client-endpoint" task-1] INFO  org.jboss.ejb.client.remoting.ChannelAssociation  - Discarding result for invocation id 0 since no waiting context found

      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)

      [Thread-1] DEBUG org.jboss.ejb.client.remoting.AutoConnectionCloser  - Closing Remoting connection <1bde4>

      [Remoting "config-based-ejb-client-endpoint" read-1] DEBUG org.jboss.ejb.client.remoting.RemotingConnectionEJBReceiver  - Closing channelChannel ID f7fd41c3 (outbound) of Remoting connection 01cef4f7 to null

      [Remoting "config-based-ejb-client-endpoint" read-1] DEBUG org.jboss.ejb.client.remoting.ChannelAssociation  - Closing channel Channel ID f7fd41c3 (outbound) of Remoting connection 01cef4f7 to null

      [Remoting "config-based-ejb-client-endpoint" read-1] DEBUG org.jboss.ejb.client.remoting.ChannelAssociation  - Registering a re-connect handler org.jboss.ejb.client.remoting.EJBClientContextConnectionReconnectHandler@9a9b65 for broken channel Channel ID f7fd41c3 (outbound) of Remoting connection 01cef4f7 to null in EJB client context org.jboss.ejb.client.EJBClientContext@da18ac

      [Remoting "config-based-ejb-client-endpoint" task-4] INFO  org.jboss.ejb.client.remoting.ChannelAssociation  - Channel Channel ID f7fd41c3 (outbound) of Remoting connection 01cef4f7 to null can no longer process messages

      [Thread-1] DEBUG org.jboss.ejb.client.remoting.AutoConnectionCloser  - Closing endpoint "config-based-ejb-client-endpoint" <18aab40>

       

      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?

       


        • 1. Re: EJB invocations from a remote client using JNDI: Invalid User
          wdfink

          Could you provide a bit more information, do you add the user to the 'ApplicationRealm' ?

          • 2. Re: EJB invocations from a remote client using JNDI: Invalid User
            alanoc

            ok, this is my scenario: I have two server applications (A and B), that communicate via JMS, both using JAAS for user authentication. EJBs for each system uses security JBOSS via @ RolesAllowed ("ROLE_ADMIN"), works just fine so far, I have seen the JASS set up right, and added the 'ApplicationRealm'.

             

            The problem is in a third application, a client jar (swing application) that must communicate with the application B. In this third application, when I attempt to lookup remote EJB application B, the lookup to work but when I call a method that must use the EJB, the specified error occurs.

            • 3. Re: EJB invocations from a remote client using JNDI: Invalid User
              wdfink

              In AS7 the lookup from a client is only to create the interfaces at client side, there is no longer a server action as in former AS versions.

               

              Could you post the relevant part of your client, jboss-ejb-client.properties, EJB source, standalone.xml and user-*.properties?