3 Replies Latest reply on Jun 5, 2013 8:57 AM by Ramesh Reddy

    How to know when Teiid is active !

    Gaurav Chaudhary Newbie

      Hi !


      Is there any way through which I can be sure that Teiid is active before deploying the VDB on it? Some URL that I can ping or some listener that I can use?


      Thanks in advance

        • 1. Re: How to know when Teiid is active !
          Ramesh Reddy Master



          You can try to make an "admin" connection to Teiid, if this passes you can safely assume that Teiid is running. May be you issue some kind a idempotent call on the Admin connection too, to verify Teiid engine is running.


          To make admin connection use


          admin = AdminFactory.createAdmin(user, password, "mms://host:port");


          There are other ways to detect the Teiid engine using the profile service, this is how "admin-console" functions. You take look at "admin-console" code for this.



          • 2. Re: How to know when Teiid is active !
            Neeta L Newbie

            When I try to createAdmin using AdminFactory, it gives exception


            Exception in thread "main" java.lang.NoClassDefFoundError: org/xnio/Cancellable

                at java.lang.ClassLoader.defineClass1(Native Method)

                at java.lang.ClassLoader.defineClassCond(ClassLoader.java:631)

                at java.lang.ClassLoader.defineClass(ClassLoader.java:615)

                at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)

                at java.net.URLClassLoader.defineClass(URLClassLoader.java:283)

                at java.net.URLClassLoader.access$000(URLClassLoader.java:58)

                at java.net.URLClassLoader$1.run(URLClassLoader.java:197)

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

                at java.net.URLClassLoader.findClass(URLClassLoader.java:190)

                at java.lang.ClassLoader.loadClass(ClassLoader.java:306)

                at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)

                at java.lang.ClassLoader.loadClass(ClassLoader.java:247)

                at org.jboss.as.controller.client.impl.RemotingModelControllerClient.<init>(RemotingModelControllerClient.java:59)

                at org.jboss.as.controller.client.ModelControllerClient$Factory.create(ModelControllerClient.java:211)

                at org.jboss.as.controller.client.ModelControllerClient$Factory.create(ModelControllerClient.java:173)

                at org.teiid.adminapi.AdminFactory.createAdmin(AdminFactory.java:88)

                at TestAdminAPI.main(TestAdminAPI.java:44)



            My Code :

            AdminFactory adminFactory = AdminFactory.getInstance();

            int port = 31000;

            Admin testAdmin = adminFactory.createAdmin("localhost", port, "user", "user".toCharArray());



            Does anyone know solution for it?



            • 3. Re: How to know when Teiid is active !
              Ramesh Reddy Master

              I previous reply does NOT apply to the Teiid 8.x. That only works in Teiid 7.x. In 8.x the above would be


              Even if you are using Teiid 7.x, your port number is wrong is wrong, the default port I believe is 31443. 31000 is for JDBC.


              Lastly the error you are seeing is, your classpath is not correct. See the "adminshell" download's "lib" directory for all the dependent jar files you need to provide in classpath


              In Teiid 8.x



              int port = 9999; // default

              String host = localhost;

              Admin admin = AdminFactory.createAdmin(host, port, user, password);




              Also, you can make connection to Admin when Teiid is installed or not, as Admin connection is generic administrative connection for whole AS, not just Teiid.