1 2 Previous Next 15 Replies Latest reply on Sep 8, 2012 11:56 AM by Rakesh Balguri

    TEIID70051 The controller is not available at /127.0.0.1:9,999

    Rakesh Balguri Expert

      Hi,

       

      I am trying to create the org.teiid.adminapi.Admin object.

       

      We are creating the Admin object as follows:

       

      final AdminFactory adminFactory = AdminFactory.getInstance();

      final Admin admin = adminFactory.createAdmin("127.0.0.1", 9999, "admin", "admin".toCharArray());

       

      and I always get the following error

       

      [org.teiid.adminapi.AdminFactory] (pool-11-thread-1) TEIID70051 The controller is not available at /127.0.0.1:9,999

       

      Can anyone let us know the reason for this error??

       

      Please help me in fixing this issue.

       

      Thanks

      Rakesh.

        • 1. Re: TEIID70051 The controller is not available at /127.0.0.1:9,999
          Ramesh Reddy Master

          Did you add the management user? You need to use "add-user.sh" or "add-user.bat" script in the <jboss-as>/bin" directory. This will add the management user and password that you can use in the above admin createAdmin call.

           

          Ramesh..

          • 2. Re: TEIID70051 The controller is not available at /127.0.0.1:9,999
            Rakesh Balguri Expert

            I tried this and still I get the same error.

             

            Ramesh, can you please give us some pointers to this error so that we can try debugging and fix this issue.

             

            Thanks

            Rakesh.

            • 3. Re: TEIID70051 The controller is not available at /127.0.0.1:9,999
              Ramesh Reddy Master

              Rakesh,

               

              Is your started at address '127.0.0.1" and management port is configured as 9999? It will be in the server.log pls check.

               

              Ramesh..

              • 4. Re: TEIID70051 The controller is not available at /127.0.0.1:9,999
                Rakesh Balguri Expert

                Yes. I tried changing the port to other value and host to the systems IP address through the jboss.bind.address.management and port to a different value by passing through the jboss.management.native.port values.

                 

                For example If I change the value to 126.123.5.125 and port to 7878 then I get the error TEIID70051 The controller is not available at /126.123.5.125:7,878

                 

                Thanks

                Rakesh.

                • 5. Re: TEIID70051 The controller is not available at /127.0.0.1:9,999
                  Ramesh Reddy Master

                  What does your logs say about the management port?

                   

                  Also, in the bin directory, you can execute "jboss-cli.bat" or "jboss-cli.sh" depending upon your environment, then issue a "connect" command. If you do that can you connect to the JBoss AS instance? Teiid Admin connection is nothing but a simple wrapper over the JBoss AS's CLI.

                   

                  Ramesh..

                  • 6. Re: TEIID70051 The controller is not available at /127.0.0.1:9,999
                    gaurav singhal Newbie

                    Is there a way to create a teiid admin connection with going through ports and hostname, just a direct "local" connection? Because we are trying to create a connection using the java teiid admin api from within the same jvm in which teiid is brought up so if we could get around using host name and port it might help.

                    • 7. Re: TEIID70051 The controller is not available at /127.0.0.1:9,999
                      Ramesh Reddy Master

                      Yes, you can. However for that you need to write JBoss AS service and write a dependency on the "ModelController" class.  For an example take look at "VDBDeployer.java" class, and find the line

                       

                      {code}

                      vdbService.addDependency(Services.JBOSS_SERVER_CONTROLLER, ModelController.class, vdb.controllerValue);

                      {code}

                       

                      and follow from there. Once you have the ModelController class, you can call the  adminFactory.createAdmin(controllerValue.getValue()) to create the admin object.

                       

                      Ramesh..

                      • 8. Re: TEIID70051 The controller is not available at /127.0.0.1:9,999
                        Rakesh Balguri Expert

                        Hi Ramesh,

                         

                        By JBoss Service do you mean creating a new JBoss Extension or creating a SAR file?

                        We are not sure of creating a JBoss AS Service. Can you please help us in pointing to the document for creating a JBoss AS Service.

                         

                        Your help would be highly appriciated

                         

                        Thanks,

                        Rakesh.

                        • 9. Re: TEIID70051 The controller is not available at /127.0.0.1:9,999
                          Ramesh Reddy Master

                          Rakesh,

                           

                          For extending the JBoss AS7, please see this document https://docs.jboss.org/author/display/AS71/Extending+JBoss+AS+7#ExtendingJBossAS7-IntegratewithJBossAS7

                           

                          If you want, you can write Simple service (any class that extends org.jboss.msc.service.Service<T>) and add to your Teiid subsystem code. There is specific way you would need to register the service and and provide the lifecycle methods. Teiid sub system has many such services, so I suggest you take a look at the code.

                           

                          For ex: http://anonsvn.jboss.org/repos/teiid/trunk/jboss-integration/src/main/java/org/teiid/jboss/VDBService.java

                          http://anonsvn.jboss.org/repos/teiid/trunk/jboss-integration/src/main/java/org/teiid/jboss/BufferManagerService.java

                           

                          The above example uses the said uses ModelController class, see how it id defined and how its dependencies are declared etc.

                           

                          Ramesh..

                          • 10. Re: TEIID70051 The controller is not available at /127.0.0.1:9,999
                            Rakesh Balguri Expert

                            Hi Ramesh,

                             

                            Thanks for your reply.

                            I had gone through the code and I created a Service and added my jar file to the Teiid Subsystem Code i.e. to the module \org\jboss\teiid\main.

                            And I am trying to create the Admin object as follows:

                             

                            ChorusVDBAdminService service = new ChorusVDBAdminService();

                            final Admin testAdmin = adminFactory.createAdmin(service.getControllerValue().getValue());

                             

                            I am getting the following exception. Looks like I am not getting the InjectedValue of the ModelControllerClient.

                             

                            java.lang.IllegalStateException

                             

                            at org.jboss.msc.value.InjectedValue.getValue(InjectedValue.java:47)

                             

                            The following is my  Service

                             

                            public class ChorusVDBAdminService implements Service<ChorusVDBAdminService> {

                             

                            protected final InjectedValue<ModelControllerClient> controllerValue = new InjectedValue<ModelControllerClient>();

                             

                                public InjectedValue<ModelControllerClient> getControllerValue() {

                                   return controllerValue;

                                }

                             

                                public ChorusVDBAdminService() {

                                        }

                             

                                @Override

                                public ChorusVDBAdminService getValue() throws IllegalStateException, IllegalArgumentException {

                                    return this;

                                }

                             

                                @Override

                                public void start(StartContext context) throws StartException

                                {       

                                    System.out.println("Starting ChorusVDBAdminService...");

                                }

                             

                                @Override

                                public void stop(StopContext context) {

                                }

                             

                                public static ServiceName createServiceName(String suffix) {

                                    return ServiceName.JBOSS.append("ChorusVDBAdminService", suffix);

                                }

                             

                            I added the Service using the following code:

                             

                                    ChorusVDBAdminService vdbAdminService = new ChorusVDBAdminService();

                                    ServiceName adminName = ChorusVDBAdminService.createServiceName(suffix);

                                    ServiceController<ChorusVDBAdminService> vdbController = context

                                            .getServiceTarget().addService(adminName, vdbAdminService)

                                            .addListener(verificationHandler).setInitialMode(Mode.ACTIVE)

                                            .install();

                                    newControllers.add(vdbController);

                             

                            Can you please take a look and let me know if I missed anything.

                             

                            Thanks

                            Rakesh.

                            • 11. Re: TEIID70051 The controller is not available at /127.0.0.1:9,999
                              Ramesh Reddy Master

                              Look at the VDBService example I pointed above, it does exactly what you are trying to do. Look at how dependencies for VDBService is defined by looking for its references.

                               

                              Ramesh..

                              • 12. Re: TEIID70051 The controller is not available at /127.0.0.1:9,999
                                Rakesh Balguri Expert

                                Hi Ramesh,

                                 

                                Thanks for the information. Sorry for bothering you again. I am not completly understanding the implementation

                                I googled for the exact steps but could not find anything related to implementing the Service and plugging it into JBoss.

                                 

                                The following are the steps in order which I am thinking will solve my problem. Please suggest if any changes are required.

                                 

                                1. Create a class which implements the org.jboss.msc.service.Service interface.

                                    Do we also extend the class AbstractVDBDeployer as we have done in VDBService Example?

                                    Do we use the VDBService example or VDBDeployer example?

                                2. Register this service using the following from VDBDeployer.java:

                                    final ServiceBuilder<RuntimeVDB> vdbService = context.getServiceTarget().addService(TeiidServiceNames.vdbServiceName(deployment.getName(), deployment.getVersion()), vdb);

                                    vdbService.addDependency(Services.JBOSS_SERVER_CONTROLLER, ModelController.class, vdb.controllerValue);

                                3. Package this as a jar file and copy to the module \org\jboss\teiid\main

                                4. Start JBoss and get the Admin object.

                                 

                                Also can we extend the VDBService class to use this as our service and use this for creating the Admin object?

                                • 13. Re: TEIID70051 The controller is not available at /127.0.0.1:9,999
                                  Ramesh Reddy Master
                                  // service class
                                  class AdminProvider implements Service<Admin> {
                                      protected final InjectedValue<ModelController> controllerValue = new InjectedValue<ModelController>();
                                      protected final InjectedValue<Executor> executorInjector = new InjectedValue<Executor>();
                                      private Admin admin;
                                  
                                      @Override
                                      public void start(StartContext context) throws StartException {
                                          this.admin = AdminFactory.getInstance().createAdmin(controllerValue.getValue().createClient(executorInjector.getValue()));
                                  
                                          // do whatever you need to do here..
                                      }
                                  
                                      @Override
                                      public void stop(StopContext context) {
                                          this.admin = null;
                                      }
                                  
                                      @Override
                                      public Admin getValue() throws IllegalStateException,IllegalArgumentException {
                                          return this.admin;
                                      }
                                  }
                                  
                                  // Add the following to the bootstrap the service in some class like TeiidAdd.java or in your subsystem in the performRuntime method.
                                  AdminProvider adminProvider = new AdminProvider();
                                  adminProvider.addDependency(TeiidServiceNames.executorServiceName(this.asyncThreadPoolName), Executor.class,  adminProvider.executorInjector);
                                  adminProvider.addDependency(Services.JBOSS_SERVER_CONTROLLER, ModelController.class, adminProvider.controllerValue);
                                  ServiceBuilder<AdminProvider> adminService = context.getServiceTarget().addService(ServiceName.JBOSS.append("teiid", "admin"), adminProvider);
                                  newControllers.add(adminService.install());
                                  

                                   

                                   

                                   

                                   

                                  Ramesh..

                                  • 14. Re: TEIID70051 The controller is not available at /127.0.0.1:9,999
                                    Rakesh Balguri Expert

                                    Hi Ramesh,

                                     

                                    Thanks for the code snippet. Sorry for bothering you again

                                    I had created the created the service and registered the Service in my Subsystem.

                                     

                                    But while starting JBoss I am getting the following error:

                                     

                                     

                                    JBAS014775:New missing/unsatisfied dependencies:

                                    service jboss.thread.executor.async-thread-pool (missing) dependents: [service jboss.teiid.admin]

                                     

                                    Looks like the Service is not getting registered and not being started.

                                     

                                    The following is the code for registering the service:

                                     

                                    ChorusVDBAdminProvider adminService = new ChorusVDBAdminProvider();

                                            ServiceBuilder<Admin> adminServiceBinder = context.getServiceTarget().addService(ServiceName.JBOSS.append("teiid", "admin"), adminService);

                                            adminServiceBinder.addDependency(TeiidServiceNames.executorServiceName("async-thread-pool"), Executor.class,  adminService.executorInjector);

                                            adminServiceBinder.addDependency(Services.JBOSS_SERVER_CONTROLLER, ModelController.class, adminService.controllerValue);

                                             newControllers.add(adminServiceBinder.install());

                                     

                                    I tried adding the dependencies to the teiid admin but still I get the same error.

                                    Can we add the Service registration code in TeiidAdd.java class ?

                                    Please suggest.

                                     

                                    Thanks

                                    Rakesh

                                    1 2 Previous Next