5 Replies Latest reply on Jan 13, 2012 11:48 AM by rareddy

    Admin API of Teiid 8.0 Alpha1

    kriaz

      Hi -

       

      I have downloaded Teiid 8.0 Alpha1 and configure it with JBoss 7.1 CR1.

       

       

      JDBC works fine but my admin code is not working. It seems that Admin API has been changed.

       

      int port = 9999;                     // new admin port instead of old 31443

      String host = "localhost";       // tried both localhost and mms://localhost as host

       

      AdminFactory admFactory = AdminFactory.getInstance();

      Admin _admin = admFactory.createAdmin(host, port, "admin", "admin".toCharArray());

       

      When the createAdmin method of AdminFactory is called in the above mentioned code. It gives the following output:

       

      Jan 06, 2012 7:10:30 PM org.xnio.Xnio <clinit>

      INFO: XNIO Version 3.0.0.CR7 

      The controller is not available at localhost:9999

       

      As a result _admin initializes as null and after this my program gives NullPointerException.

       

      Can anyone help me on this?

       

      Khurram

        • 1. Re: Admin API of Teiid 8.0 Alpha1
          rareddy

          Khurram,

           

          The code is correct. Teiid no longer owns the Admin connection as before, so no more port 31443 for admin connection. The AS defines the default Admin port as 9999. I did quick test myself and I did not see any errors. So, I believe you may not have bound to the "localhost". Did you supply any "-b" information at startup?

           

          Ramesh..

          • 2. Re: Admin API of Teiid 8.0 Alpha1
            kriaz

            Ramesh,

             

            Thanks for your reply. I am not using any "-b" information at the startup. Teiid JBDC  API works fine for me with localhost. Also i have tried Teiid AdminShell and that works fine as well. Below is the out put of AdminShell Groovy Console:

             

             

             

             

            groovy> connectAsAdmin("localhost", 9999, "admin", "admin", "adminConn");
            Connected to standalone controller at localhost:9999

            groovy> getVDBs();
            Result: [DemoVDB.1[ProdSupViewModel[], SQL_Server[SQL_Server/sqlserver/SQL_Server]]]

             

            After above mentioned AdminShell test, i downloaded the teiid source and debug it. I found that in createAdmin method of AdminFactory class the following piece of code fails to return nodeTypes. Actually Util.getNodeTypes returns empty collection and due to this admin returns as null :

             

             

            List<String> nodeTypes = Util.getNodeTypes(newClient, new DefaultOperationRequestAddress());

             

            Why AdminShell works fine? and what could be the possible cause of empty collection of nodeTypes?

             

            Khurram

             

             

             

             

             

             

            • 3. Re: Admin API of Teiid 8.0 Alpha1
              rareddy

              Khurram,

               

              For your standalone Admin connection program, do you have all the dependency jars correctly set? take a look at the AdminShell "lib" directory what this requires. "Util.getNodeTypes" is static method, you are unable to make connection for some reason I can not think of with the provided details.

               

               

              Ramesh..

              • 4. Re: Admin API of Teiid 8.0 Alpha1
                kriaz

                Ramesh,

                 

                Your suggestion works for me. I was already referring 8 jars but could not find that 3 more jars were required as there was no error. I could only see "The controller is not available at localhost:9999" message instead of some error about missing jars. The missing jars were "xnio-nio-3.0.0.CR7.jar, jboss-sasl-1.0.0.Beta9.jar, jboss-marshalling-1.3.4.GA.jar".

                 

                I suggest that proper error message or type of exception should be thrown about missing jars instead of doing nothing.

                 

                Khurram

                 

                • 5. Re: Admin API of Teiid 8.0 Alpha1
                  rareddy

                  Khurram,

                   

                  Great. As I explained before Admin connection is not just for Teiid anymore, so those libraries exist out side the Teiid code. I have no control over what they through as an error. We will make documentation correct on our side as to what libraries to include for Admin connection.

                   

                  Thanks

                   

                  Ramesh..