1 2 Previous Next 26 Replies Latest reply on Sep 18, 2012 9:30 AM by venkman

    connect through JNDI Jboss AS 7.1.1

    micros

      I'm trying to connect Jboss AS7.1.1 with this URL remote://hostname:9999 through JNDI

       

      I added this jar files to classpath

      c:\jboss-as-7.1.1.Final\bin\client\jboss-client.jar

      c:\jboss-as-7.1.1.Final\modules\org\jboss\remoting3\remoting-jmx\main\remoting-jmx-1.0.2.Final.jar

      c:\jboss-as-7.1.1.Final\modules\org\jboss\remoting3\main\jboss-remoting-3.2.3.GA.jar

      c:\jboss-as-7.1.1.Final\modules\org\jboss\logging\main\jboss-logging-3.1.0.GA.jar

      c:\jboss-as-7.1.1.Final\modules\org\jboss\xnio\main\xnio-api-3.0.3.GA.jar

      c:\jboss-as-7.1.1.Final\modules\org\jboss\xnio\nio\main\xnio-nio-3.0.3.GA.jar

      c:\jboss-as-7.1.1.Final\modules\org\jboss\sasl\main\jboss-sasl-1.0.0.Final.jar

      c:\jboss-as-7.1.1.Final\modules\org\jboss\marshalling\main\jboss-marshalling-1.3.11.GA.jar

      c:\jboss-as-7.1.1.Final\modules\org\jboss\marshalling\river\main\jboss-marshalling-river-1.3.11.GA.jar

      c:\jboss-as-7.1.1.Final\modules\org\jboss\remote-naming\main\jboss-remote-naming-1.0.2.Final.jar

      c:\jboss-as-7.1.1.Final\modules\org\jboss\remoting3\remoting-jmx\main\remoting-jmx-1.0.2.Final.jar

       

      I added to managementrealm  user with add-user.bat

       

      Parameters which i added are

      Registry lookup: JNDI

      Protocol: remote

      Conext factrory : org.jboss.naming.remote.client.InitialContextFactory

       

      but when trying to connect i received this exeception

       

      Caused by: java.rmi.ServerException: RemoteException occurred in server thread; nested exception is:

                java.rmi.RemoteException: Failed to create remoting connection

      javax.naming.NamingException: Failed to create remoting connection [Root exception is java.lang.RuntimeException: Operation failed with status WAITING]

                at org.jboss.naming.remote.client.ClientUtil.namingException(ClientUtil.java:36)

                at org.jboss.naming.remote.client.InitialContextFactory.getInitialContext(InitialContextFactory.java:121)

                at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:667)

                at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:288)

                at javax.naming.InitialContext.init(InitialContext.java:223)

                at javax.naming.InitialContext.<init>(InitialContext.java:197)

                at com.segue.monitoring.jmx.common.runtime.DataSourceBase.createContext(DataSourceBase.java:41)

                at com.segue.monitoring.jmx.jboss.datasource.JBossDataSource.bootstrap(Unknown Source)

                at com.segue.monitoring.jmx.common.runtime.RemoteDataSourceBase.bootstrap(RemoteDataSourceBase.java:180)

                at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

                at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

                at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

                at java.lang.reflect.Method.invoke(Method.java:597)

                at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:303)

                at sun.rmi.transport.Transport$1.run(Transport.java:159)

                at java.security.AccessController.doPrivileged(Native Method)

                at sun.rmi.transport.Transport.serviceCall(Transport.java:155)

                at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:535)

                at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:790)

                at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:649)

                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)

      Caused by: java.lang.RuntimeException: Operation failed with status WAITING

                at org.jboss.naming.remote.protocol.IoFutureHelper.get(IoFutureHelper.java:89)

                at org.jboss.naming.remote.client.NamingStoreCache.getRemoteNamingStore(NamingStoreCache.java:56)

                at org.jboss.naming.remote.client.InitialContextFactory.getOrCreateCachedNamingStore(InitialContextFactory.java:166)

                at org.jboss.naming.remote.client.InitialContextFactory.getOrCreateNamingStore(InitialContextFactory.java:139)

                at org.jboss.naming.remote.client.InitialContextFactory.getInitialContext(InitialContextFactory.java:104)

                ... 21 more

       

      i think that everythings was set all properly

        • 1. Re: connect through JNDI Jboss AS 7.1.1
          jaysensharma

          Hi,

           

             By Default the JBoss Management Interface address is "localhost"   so pleae make sure that you are starting your JBoss using the following option:

           

          ./standalone.sh   -b yourHostName  -bmanagement yourHostName

           

          OR

           

          ./standalone.sh   -Djboss.bind.address=yourHostName   -Djboss.bind.address.management=yourHostName

           

           

             Also it would be best to check that there is no firewall restriction available at n/w layer which is restricting   "yourHostName" access on port 9999

           

           

          Thanks

          Jay SenSharma

          • 2. Re: connect through JNDI Jboss AS 7.1.1
            micros

            Hi Jay,

            Thanks for help, Firewall is disabled

             

            I havd tried both option for start with my host name

             

            ./standalone.sh   -b yourHostName  -bmanagement yourHostName

             

            OR

             

            ./standalone.sh   -Djboss.bind.address=yourHostName   -Djboss.bind.address.management=yourHostName

             

            but i received same error still

            • 3. Re: connect through JNDI Jboss AS 7.1.1
              nickarls

              Can you do a "telnet remotehost 9999" and get through from another host?

              • 4. Re: connect through JNDI Jboss AS 7.1.1
                micros

                i have done i connected successfuly

                • 5. Re: connect through JNDI Jboss AS 7.1.1
                  nickarls

                  Tried adding an application user instead of a managment user?

                  • 6. Re: connect through JNDI Jboss AS 7.1.1
                    micros

                    I created application user and saved this user in my notepad

                    when i have tried to connect and use this user i received this

                    javax.naming.NamingException: Failed to create remoting connection [Root exception is java.lang.RuntimeException: javax.security.sasl.SaslException: Authentication failed: all available authentication mechanisms failed]

                     

                    i have tried several times with the same user but still failed

                    • 7. Re: connect through JNDI Jboss AS 7.1.1
                      nickarls

                      Never looked at it but in what format is the password given? MD5-hash?

                      • 8. Re: connect through JNDI Jboss AS 7.1.1
                        micros

                        i saw in application.property file this testuser=875adbb81a2ffa8f164440e58beae017

                        but I'm not sure for format

                        • 9. Re: connect through JNDI Jboss AS 7.1.1
                          nickarls

                          https://docs.jboss.org/author/display/AS71/JNDI+Reference speaks of port 4447 for remote access. Never played around with remote stuff so I can only quote scripture for you

                          • 10. Re: connect through JNDI Jboss AS 7.1.1
                            micros

                            yes this is my mistakte that i must set 4447 but on this port with this url remote://hostname:4447 with application and mangment user I recieved this exception

                             

                            com.segue.monitoring.jmx.common.exception.RtException: Unable to connect

                                      at com.segue.monitoring.jmx.common.gui.swt.JMXSWTRunner.connect(JMXSWTRunner.java:312)

                            Caused by: java.lang.RuntimeException: Unable to retrieve JMX bean list

                                      at com.segue.monitoring.jmx.common.client.RemoteDataSourceClient.getAllBeans(RemoteDataSourceClient.java:490)

                                      at com.segue.monitoring.jmx.common.gui.swt.JMXSWTRunner.connect(JMXSWTRunner.java:303)

                            Caused by: java.rmi.ServerException: RemoteException occurred in server thread; nested exception is:

                                      java.rmi.RemoteException: java.lang.NoSuchMethodException: org.jboss.naming.remote.client.RemoteContext.queryNames(javax.management.ObjectName, javax.management.QueryExp)

                            java.lang.RuntimeException: java.lang.NoSuchMethodException: org.jboss.naming.remote.client.RemoteContext.queryNames(javax.management.ObjectName, javax.management.QueryExp)

                                      at com.segue.monitoring.jmx.common.SearchBase.queryNames(SearchBase.java:45)

                                      at com.segue.monitoring.jmx.common.runtime.DataSourceBase.getAllBeans(DataSourceBase.java:78)

                                      at com.segue.monitoring.jmx.common.runtime.RemoteDataSourceBase.getAllBeans(RemoteDataSourceBase.java:211)

                                      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

                                      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

                                      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

                                      at java.lang.reflect.Method.invoke(Method.java:601)

                                      at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:322)

                                      at sun.rmi.transport.Transport$1.run(Transport.java:177)

                                      at sun.rmi.transport.Transport$1.run(Transport.java:174)

                                      at java.security.AccessController.doPrivileged(Native Method)

                                      at sun.rmi.transport.Transport.serviceCall(Transport.java:173)

                                      at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:553)

                                      at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:808)

                                      at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:667)

                                      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)

                                      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)

                                      at java.lang.Thread.run(Thread.java:722)

                            Caused by: java.lang.NoSuchMethodException: org.jboss.naming.remote.client.RemoteContext.queryNames(javax.management.ObjectName, javax.management.QueryExp)

                                      at java.lang.Class.getMethod(Class.java:1622)

                                      at com.segue.monitoring.jmx.common.SearchBase.queryNames(SearchBase.java:38)

                                      ... 17 more

                             

                             

                                      at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:353)

                                      at sun.rmi.transport.Transport$1.run(Transport.java:177)

                                      at sun.rmi.transport.Transport$1.run(Transport.java:174)

                                      at java.security.AccessController.doPrivileged(Native Method)

                                      at sun.rmi.transport.Transport.serviceCall(Transport.java:173)

                                      at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:553)

                                      at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:808)

                                      at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:667)

                                      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)

                                      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)

                                      at java.lang.Thread.run(Thread.java:722)

                                      at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(Unknown Source)

                                      at sun.rmi.transport.StreamRemoteCall.executeCall(Unknown Source)

                                      at sun.rmi.server.UnicastRef.invoke(Unknown Source)

                                      at com.segue.monitoring.jmx.jboss.datasource.RemoteDataSource_Stub.getAllBeans(Unknown Source)

                                      at com.segue.monitoring.jmx.common.client.RemoteDataSourceClient.getAllBeans(RemoteDataSourceClient.java:477)

                                      ... 1 more

                            Caused by: java.rmi.RemoteException: java.lang.NoSuchMethodException: org.jboss.naming.remote.client.RemoteContext.queryNames(javax.management.ObjectName, javax.management.QueryExp)

                            java.lang.RuntimeException: java.lang.NoSuchMethodException: org.jboss.naming.remote.client.RemoteContext.queryNames(javax.management.ObjectName, javax.management.QueryExp)

                                      at com.segue.monitoring.jmx.common.SearchBase.queryNames(SearchBase.java:45)

                                      at com.segue.monitoring.jmx.common.runtime.DataSourceBase.getAllBeans(DataSourceBase.java:78)

                                      at com.segue.monitoring.jmx.common.runtime.RemoteDataSourceBase.getAllBeans(RemoteDataSourceBase.java:211)

                                      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

                                      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

                                      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

                                      at java.lang.reflect.Method.invoke(Method.java:601)

                                      at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:322)

                                      at sun.rmi.transport.Transport$1.run(Transport.java:177)

                                      at sun.rmi.transport.Transport$1.run(Transport.java:174)

                                      at java.security.AccessController.doPrivileged(Native Method)

                                      at sun.rmi.transport.Transport.serviceCall(Transport.java:173)

                                      at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:553)

                                      at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:808)

                                      at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:667)

                                      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)

                                      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)

                                      at java.lang.Thread.run(Thread.java:722)

                            Caused by: java.lang.NoSuchMethodException: org.jboss.naming.remote.client.RemoteContext.queryNames(javax.management.ObjectName, javax.management.QueryExp)

                                      at java.lang.Class.getMethod(Class.java:1622)

                                      at com.segue.monitoring.jmx.common.SearchBase.queryNames(SearchBase.java:38)

                                      ... 17 more

                             

                             

                                      at com.segue.monitoring.jmx.common.runtime.RemoteDataSourceBase.getAllBeans(RemoteDataSourceBase.java:216)

                                      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

                                      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

                                      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

                                      at java.lang.reflect.Method.invoke(Method.java:601)

                                      at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:322)

                                      at sun.rmi.transport.Transport$1.run(Transport.java:177)

                                      at sun.rmi.transport.Transport$1.run(Transport.java:174)

                                      at java.security.AccessController.doPrivileged(Native Method)

                                      at sun.rmi.transport.Transport.serviceCall(Transport.java:173)

                                      at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:553)

                                      at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:808)

                                      at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:667)

                                      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)

                                      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)

                                      at java.lang.Thread.run(Thread.java:722)

                             

                            The interesting is that i have try to connect from same machine where is installed jboss with this url remote://hostname:9999 i recived the first exception on this post

                            • 11. Re: connect through JNDI Jboss AS 7.1.1
                              nickarls

                              Looks like a signature/version mismatch. What libraries do you reference from the client?

                              • 12. Re: connect through JNDI Jboss AS 7.1.1
                                micros

                                if i understand you right you ask me for jar files which i include in classpath. Sorry these my questions but i new in JBoss

                                this is a list of them

                                C:\jboss-as-7.1.1.Final\modules\org\jboss\remoting3\remoting-jmx\main\remoting-jmx-1.0.2.Final.jar;C:\Dev\java\jboss-as-7.1.1.Final\modules\org\jboss\remoting3\main\jboss-remoting-3.2.3.GA.jar;C:\jboss-as-7.1.1.Final\modules\org\jboss\logging\main\jboss-logging-3.1.0.GA.jar;C:\jboss-as-7.1.1.Final\modules\org\jboss\xnio\main\xnio-api-3.0.3.GA.jar;C:\jboss-as-7.1.1.Final\modules\org\jboss\xnio\nio\main\xnio-nio-3.0.3.GA.jar;C:\jboss-as-7.1.1.Final\modules\org\jboss\sasl\main\jboss-sasl-1.0.0.Final.jar;C:\jboss-as-7.1.1.Final\modules\org\jboss\marshalling\main\jboss-marshalling-1.3.11.GA.jar;C:\jboss-as-7.1.1.Final\modules\org\jboss\marshalling\river\main\jboss-marshalling-river-1.3.11.GA.jar;C:\jboss-as-7.1.1.Final\bin\client\jboss-client.jar

                                • 13. Re: connect through JNDI Jboss AS 7.1.1
                                  jaysensharma

                                  Hi,

                                   

                                       JBoss provides a single Jar which can be used by the client like "jboss-as-7.1.1.Final/bin/client/jboss-client.jar" so can u just try removing all the other jars from the classpath and just have this one.

                                  • 14. Re: connect through JNDI Jboss AS 7.1.1
                                    nickarls

                                    Actually, the jboss-client.jar doesn't contain a class with a method matching that signature. Not that I can tell which class *does*.

                                    1 2 Previous Next