1 2 Previous Next 16 Replies Latest reply on Sep 20, 2012 11:46 AM by rakeshsagar

    Getting issues while undeploying VDB with Teiid 8.1.0 Final

    manoj.m.agarwal

      Hi,

       

      I am deploying vdb using Admin.deploy() and its getting deployed without any issue. But when i try to undeploy the VDB using Admin.undeploy() i  face these issues...

       

       

      1. If VDB is already deployed and then calling Admin.undeploy()  results in NullPointerException

       

       

      class java.lang.NullPointerException: java.lang.NullPointerException

      18:33:11,037 INFO  [stdout] (pool-11-thread-1) java.lang.NullPointerException

      18:33:11,047 INFO  [stdout] (pool-11-thread-1)     at org.teiid.adminapi.AdminFactory$AdminImpl.execute(AdminFactory.java:437)

      18:33:11,047 INFO  [stdout] (pool-11-thread-1)     at org.teiid.adminapi.AdminFactory$AdminImpl.undeploy(AdminFactory.java:525)

      18:33:11,057 INFO  [stdout] (pool-11-thread-1)     at com.abc.xyz.server.teiid.bootstrap.TeiidBootstrap$4.apply(TeiidBootstrap.java:233)

      18:33:11,057 INFO  [stdout] (pool-11-thread-1)     at com.abc.xyz.server.teiid.bootstrap.TeiidBootstrap$4.apply(TeiidBootstrap.java:226)

      18:33:11,067 INFO  [stdout] (pool-11-thread-1)     at com.abc.xyz.server.teiid.bootstrap.Closure.exec(Closure.java:41)

      18:33:11,077 INFO  [stdout] (pool-11-thread-1)     at com.abc.xyz.server.teiid.bootstrap.TeiidBootstrap.withTeiidAdmin(TeiidBootstrap.java:453)

      18:33:11,077 INFO  [stdout] (pool-11-thread-1)     at com.abc.xyz.server.teiid.bootstrap.TeiidBootstrap.undeployVDB(TeiidBootstrap.java:225)

      18:33:11,077 INFO  [stdout] (pool-11-thread-1)     at com.abc.xyz.server.teiid.bootstrap.TeiidBootstrap.generateViewsFromVDB(TeiidBootstrap.java:394)

      18:33:11,077 INFO  [stdout] (pool-11-thread-1)     at com.abc.xyz.server.teiid.bootstrap.TeiidBootstrap.run(TeiidBootstrap.java:284)

      18:33:11,077 INFO  [stdout] (pool-11-thread-1)     at com.abc.xyz.extension.ServiceStarter.call(ServiceStarter.java:104)

       

       

       

      2. If VDB is not deployed and still i call Admin.undeploy() just to make sure that before deploying my VDB i want to undeploy it(Even if VDB is not deployed i expect this method not to throw any error..Please correct me if i am wrong), i get this error...

       

       

      java.lang.RuntimeException: org.teiid.adminapi.AdminProcessingException: TEIID70006 {"JBAS014653: Composite operation failed and was rolled back. Steps that failed:" => {"Operation step-1" => "JBAS014807: Management resource '[(\"deployment\" => \"XYZ\")]' not found"}}

      18:19:21,426 INFO  [stdout] (pool-11-thread-1) java.lang.RuntimeException: org.teiid.adminapi.AdminProcessingException: TEIID70006 {"JBAS014653: Composite operation failed and was rolled back. Steps that failed:" => {"Operation step-1" => "JBAS014807: Management resource '[(\"deployment\" => \"XYZ\")]' not found"}}

      18:19:21,426 INFO  [stdout] (pool-11-thread-1)     at com.abc.xyz.server.teiid.bootstrap.TeiidBootstrap$4.apply(TeiidBootstrap.java:243)

      18:19:21,426 INFO  [stdout] (pool-11-thread-1)     at com.abc.xyz.server.teiid.bootstrap.TeiidBootstrap$4.apply(TeiidBootstrap.java:226)

      18:19:21,426 INFO  [stdout] (pool-11-thread-1)     at com.abc.xyz.server.teiid.bootstrap.Closure.exec(Closure.java:41)

      18:19:21,426 INFO  [stdout] (pool-11-thread-1)     at com.abc.xyz.server.teiid.bootstrap.TeiidBootstrap.withTeiidAdmin(TeiidBootstrap.java:453)

      18:19:21,426 INFO  [stdout] (pool-11-thread-1)     at com.abc.xyz.server.teiid.bootstrap.TeiidBootstrap.undeployVDB(TeiidBootstrap.java:225)

      18:19:21,436 INFO  [stdout] (pool-11-thread-1)     at com.abc.xyz.server.teiid.bootstrap.TeiidBootstrap.generateViewsFromVDB(TeiidBootstrap.java:354)

      18:19:21,436 INFO  [stdout] (pool-11-thread-1)     at com.abc.xyz.server.teiid.bootstrap.TeiidBootstrap.run(TeiidBootstrap.java:284)

      18:19:21,436 INFO  [stdout] (pool-11-thread-1)     at com.abc.xyz.extension.ServiceStarter.call(ServiceStarter.java:104)

      18:19:21,436 INFO  [stdout] (pool-11-thread-1)     at com.abc.xyz.server.startup.XyzPrimordialJbossBean$1.call(XyzPrimordialJbossBean.java:121)

      18:19:21,446 INFO  [stdout] (pool-11-thread-1)     at com.abc.xyz.server.startup.XyzPrimordialJbossBean$1.call(XyzPrimordialJbossBean.java:117)

       

      I am not sure if it's a bug. Please take a look into this.

       

      Thanks a lot in advance !

      -Manoj

        • 1. Re: Getting issues while undeploying VDB with Teiid 8.1.0 Final
          rareddy

          Manoj,

           

          1) Seems to have null connection. Did you connect successfully?

           

          2) deploy and undeploy are not specific to just VDBs, they can be used for other artifacts. No undeploying a non-existent artifact would result in error. If you want to know if there is a VDB, use "getVDBs" call and check first.

           

          Ramesh..

          • 2. Re: Getting issues while undeploying VDB with Teiid 8.1.0 Final
            manoj.m.agarwal

            Hi Ramesh,

             

            1) Seems to have null connection. Did you connect successfully?

             

            It seems to have issue with connection only. Not sure why connection is null in AdminImpl, i don't see any connection related error.

             

            2) deploy and undeploy are not specific to just VDBs, they can be used for other artifacts. No undeploying a non-existent artifact would result in error. If you want to know if there is a VDB, use "getVDBs" call and check first.

             

            I am fine with your answer for item #2

             

             

            Thanks !

            Manoj

            • 3. Re: Getting issues while undeploying VDB with Teiid 8.1.0 Final
              rareddy

              The question is how you are creating the connection? Are you using the AdminFactory.createAdmin(host, port, user, passwd) method? Or creating the in VM connection? You can walk your code in debug into Teiid code to see what is going on.


              Ramesh..

              • 4. Re: Getting issues while undeploying VDB with Teiid 8.1.0 Final
                rakeshsagar

                Hi Ramesh,

                 

                We are creating the Admin object using the JBoss Service as below

                 

                Admin admin = AdminFactory.getInstance().createAdmin(controllerValue.getValue().createClient(executorInjector.getValue()));

                 

                Thanks

                Rakesh

                • 5. Re: Getting issues while undeploying VDB with Teiid 8.1.0 Final
                  rakeshsagar

                  Hi Ramesh,

                   

                  Can you please help us in solving this issue.

                   

                  Thanks

                  Rakesh.

                  • 6. Re: Getting issues while undeploying VDB with Teiid 8.1.0 Final
                    rareddy

                    Rakesh,

                     

                    I have already mentioned that the connection object was null. You should walk the code in debugger and see why your connection code  with above method is returning you a null connection.

                     

                    Ramesh..

                    • 7. Re: Getting issues while undeploying VDB with Teiid 8.1.0 Final
                      manoj.m.agarwal

                      Hi Ramesh,

                       

                      For the same admin object when we call deploy() method it get the connection object but when we call undeploy() it doesn't get connection object. Even debugging doesn't help much.

                       

                      If i don't get connection object while calling deploy() method on admin object at first time then it make sence becaue it means to me that connection object was never created but after deploying the VDB successfuly and then calling undeploy() on the same object if the connection is getting null then its lil confusing.

                       

                      Please correct me if i am wrong or if i can try something else ?

                       

                      Thanks !

                      Manoj

                      • 8. Re: Getting issues while undeploying VDB with Teiid 8.1.0 Final
                        rareddy

                        Are you creating the admin object every time or you create once and keep it as instance somewhere? Note that the controllerValue gets injected once to your service before "start" call on it, and removes it during "stop".

                         

                        Ramesh..

                        • 9. Re: Getting issues while undeploying VDB with Teiid 8.1.0 Final
                          rakeshsagar

                          Hi Ramesh,

                           

                          We are creating the Admin object only once. The Admin object is a static variable so it gets created only once.

                          We are just reusing it.

                           

                          Thanks,

                          Rakesh

                          • 10. Re: Getting issues while undeploying VDB with Teiid 8.1.0 Final
                            rareddy

                            You should not use as static variable. When using as a static varible you are assiging to the life of the VM/classloader. Here it is scoped only to the life span of the controller value. In your code you should access the admin service you created and then get get admin object from it.

                            • 11. Re: Getting issues while undeploying VDB with Teiid 8.1.0 Final
                              rakeshsagar

                              Hi Ramesh,

                               

                               

                              I removed the static variable and tried using the following to get the admin object.

                              I am creating a new admin object when ever we are creating a new instance of the Service. If we do not do that we get the admin object as null.

                               

                               

                              ChorusVDBAdminProvider adminProvider = new ChorusVDBAdminProvider();

                              Admin admin = adminProvider.getValue();

                               

                              When I do this, I am getting the following error. Can you please help me in solving this issue. Resolving this is important to me . Please help me.

                               

                              java.lang.IllegalStateException
                              at org.jboss.msc.value.InjectedValue.getValue(InjectedValue.java:47)
                              at org.teiid.jboss.ChorusVDBAdminProvider.createAdmin(ChorusVDBAdminProvider.java:48)
                              at org.teiid.jboss.ChorusVDBAdminProvider.getValue(ChorusVDBAdminProvider.java:40)
                              at com.ca.chorus.server.teiid.bootstrap.TeiidBootstrap.withTeiidAdmin(TeiidBootstrap.java:470)
                              at com.ca.chorus.server.teiid.bootstrap.TeiidBootstrap.deployVDB(TeiidBootstrap.java:190)
                              at com.ca.chorus.server.teiid.bootstrap.TeiidBootstrap.generateViewsFromVDB(TeiidBootstrap.java:416)
                              at com.ca.chorus.server.teiid.bootstrap.TeiidBootstrap.run(TeiidBootstrap.java:282)
                              at com.ca.chorus.extension.ServiceStarter.call(ServiceStarter.java:104)
                              at com.ca.chorus.server.startup.ChorusPrimordialJbossBean$1.call(ChorusPrimordialJbossBean.java:121)
                              at com.ca.chorus.server.startup.ChorusPrimordialJbossBean$1.call(ChorusPrimordialJbossBean.java:117)
                              at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
                              at java.util.concurrent.FutureTask.run(FutureTask.java:166)
                              at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:178)
                              at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:292)
                              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)

                               

                              Thanks,

                              Rakesh.

                              • 12. Re: Getting issues while undeploying VDB with Teiid 8.1.0 Final
                                rakeshsagar

                                Hi Ramesh/Steve,

                                 

                                Can you please help me in solving this.

                                 

                                Thanks

                                Rakesh

                                • 13. Re: Getting issues while undeploying VDB with Teiid 8.1.0 Final
                                  rareddy

                                  Rakesh,

                                   

                                  The problem is in your service initialization, only after the "start" method is called by the AS, the injected values are available, anytime before you do not have reference to the injected value. As I said before, while running in the server in the debug mode, you can clearly see, you are using the admin object before or after the start call. The injected value is available *only* until the service it came from is active. The way you can make your service be in sync by depending on it.

                                   

                                  Now, I know I have given the code and explicit directions before as to how to achieve that, if you have any bug somewhere, I would not know without looking at the code. So, my advise is either post the code, or read up on AS7 and its services. I know there is no clear documentation for this from AS7 as these are internals, but you can learn from the sample code in AS7. Without those I am sorry there isn't much I help I can provide.

                                   

                                  Ramesh..

                                  • 14. Re: Getting issues while undeploying VDB with Teiid 8.1.0 Final
                                    rakeshsagar

                                    Hi Ramesh,

                                     

                                    Thanks for your reply. The following is the code.

                                     

                                    public class ChorusVDBAdminProvider 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 {
                                            admin = AdminFactory.getInstance().createAdmin(controllerValue.getValue().createClient(executorInjector.getValue()));

                                     

                                        }

                                     

                                        @Override
                                        public void stop(StopContext context) {
                                            admin = null;
                                        }

                                     

                                        @Override
                                        public Admin getValue() throws IllegalStateException,IllegalArgumentException {
                                            return admin;
                                        }

                                    }

                                     

                                    I am registering the service in TeiidAdd.java as follows:

                                     

                                      ChorusVDBAdminProvider adminService = new ChorusVDBAdminProvider();
                                      ServiceBuilder<Admin> adminServiceBinder = context.getServiceTarget().addService(ServiceName.JBOSS.append("teiid", "admin"), adminService);
                                      adminServiceBinder.addDependency(TeiidServiceNames.executorServiceName(asyncThreadPoolName), Executor.class,  adminService.executorInjector);
                                      adminServiceBinder.addDependency(Services.JBOSS_SERVER_CONTROLLER, ModelController.class, adminService.controllerValue);
                                     
                                      newControllers.add(adminServiceBinder.install());

                                     

                                    My code is being called after the start() method of the service is called.

                                    I am getting the AdminObject as follows in our code:

                                     

                                    ChorusVDBAdminProvider adminProvider = new ChorusVDBAdminProvider();
                                    Admin admin = adminProvider.getValue();

                                     

                                    Problems:

                                     

                                    1. If I try to create a new instance of the ChorusVDBAdminProvider and get the admin object as above, I was getting the admin object as null.

                                        So, I tried to make the Admin instance as static and now I am getting the admin object.

                                       

                                    2. If I try to use the same admin object multiple times and call the deploy() method, I get a NullPointerException at

                                           org.teiid.adminapi.AdminFactory$AdminImpl.execute(AdminFactory.java:437)

                                    3. I tried creating and passing the injectors from my code to the Service but I get a java.lang.IllegalStateException. This might be because these injectors are available only

                                        after the start method is called as you have mentioned.

                                     

                                    Is there a way to call the start method multiple times so that each time I get a new Admin object with the correct injected values so that

                                    I do not end up in a NullPointerException in execute() of AdminImpl.

                                    What I need is to get the Admin object multiple times and use it to call and deploy() and undeploy() methods.

                                     

                                    Please let me know if you need any additional details.

                                     

                                    Thanks

                                    Rakesh.

                                     

                                     

                                     

                                     

                                     

                                     

                                     

                                     

                                     

                                     

                                     

                                     

                                     

                                    1 2 Previous Next