7 Replies Latest reply on Mar 29, 2013 11:20 AM by Aleksandar Kostadinov

    Using CLI how do I remove JDBC Module, Driver and JNDI mapping.

    techsjs2012 Newbie

      Using CLI how do I remove JDBC Module, Driver and JNDI mapping.

       

      It looks like everything works in my following script but the "module remove". Below is my script.

       

      Can you please tell me how to change it so it will remove the module

       

      #

      #

      connect

       

      module remove --name=com.mysql.jdbc

      data-source disable --name=mysql

      /subsystem=datasources/jdbc-driver=mysql:remove

      /subsystem=datasources/data-source=mysql:remove

       

      If I comment out the "module remove --name=com.mysql.jdbc" everything works but what if I would like to remove the module?

        • 1. Re: Using CLI how do I remove JDBC Module, Driver and JNDI mapping.
          Aleksandar Kostadinov Novice

          UPDATE: I hit this issue only if jdbc driver is created faulty. Creating the driver correctly made the problem disappear. I think there is still a bug in there though: https://bugzilla.redhat.com/show_bug.cgi?id=928979

           

          Old post:

          Anybody knows? I try to remove a module to redefine it but I fail:

           

          [standalone@localhost:9999 /] /subsystem=datasources/jdbc-driver=sqlite:remove
           {
               "outcome" => "failed",
               "failure-description" => "JBAS014749: Operation handler failed: null",
               "rolled-back" => true
           }
          

           

          In server log I see this at the same time:

          23:35:19,243 ERROR [org.jboss.as.controller.management-operation] (management-handler-thread - 24) JBAS014612: Operation ("remove") failed - address: ([
              ("subsystem" => "datasources"),
              ("jdbc-driver" => "sqlite")
          ]): java.lang.NullPointerException
              at org.jboss.as.controller.OperationContextImpl.doRemove(OperationContextImpl.java:305) [jboss-as-controller-7.1.3.Final-redhat-4.jar:7.1.3.Final-redhat-4]
              at org.jboss.as.controller.OperationContextImpl.removeService(OperationContextImpl.java:300) [jboss-as-controller-7.1.3.Final-redhat-4.jar:7.1.3.Final-redhat-4]
              at org.jboss.as.connector.subsystems.datasources.JdbcDriverRemove.performRuntime(JdbcDriverRemove.java:66)
              at org.jboss.as.controller.AbstractRemoveStepHandler$1.execute(AbstractRemoveStepHandler.java:50) [jboss-as-controller-7.1.3.Final-redhat-4.jar:7.1.3.Final-redhat-4]
              at org.jboss.as.controller.AbstractOperationContext.executeStep(AbstractOperationContext.java:397) [jboss-as-controller-7.1.3.Final-redhat-4.jar:7.1.3.Final-redhat-4]
              at org.jboss.as.controller.AbstractOperationContext.doCompleteStep(AbstractOperationContext.java:284) [jboss-as-controller-7.1.3.Final-redhat-4.jar:7.1.3.Final-redhat-4]
              at org.jboss.as.controller.AbstractOperationContext.completeStep(AbstractOperationContext.java:211) [jboss-as-controller-7.1.3.Final-redhat-4.jar:7.1.3.Final-redhat-4]
              at org.jboss.as.controller.ModelControllerImpl$DefaultPrepareStepHandler.execute(ModelControllerImpl.java:473) [jboss-as-controller-7.1.3.Final-redhat-4.jar:7.1.3.Final-redhat-4]
              at org.jboss.as.controller.AbstractOperationContext.executeStep(AbstractOperationContext.java:397) [jboss-as-controller-7.1.3.Final-redhat-4.jar:7.1.3.Final-redhat-4]
              at org.jboss.as.controller.AbstractOperationContext.doCompleteStep(AbstractOperationContext.java:284) [jboss-as-controller-7.1.3.Final-redhat-4.jar:7.1.3.Final-redhat-4]
              at org.jboss.as.controller.AbstractOperationContext.completeStep(AbstractOperationContext.java:211) [jboss-as-controller-7.1.3.Final-redhat-4.jar:7.1.3.Final-redhat-4]
              at org.jboss.as.controller.ModelControllerImpl.internalExecute(ModelControllerImpl.java:126) [jboss-as-controller-7.1.3.Final-redhat-4.jar:7.1.3.Final-redhat-4]
              at org.jboss.as.controller.ModelControllerImpl.execute(ModelControllerImpl.java:111) [jboss-as-controller-7.1.3.Final-redhat-4.jar:7.1.3.Final-redhat-4]
              at org.jboss.as.controller.remote.ModelControllerClientOperationHandler$ExecuteRequestHandler.doExecute(ModelControllerClientOperationHandler.java:139) [jboss-as-controller-7.1.3.Final-redhat-4.jar:7.1.3.Final-redhat-4]
              at org.jboss.as.controller.remote.ModelControllerClientOperationHandler$ExecuteRequestHandler$1.execute(ModelControllerClientOperationHandler.java:108) [jboss-as-controller-7.1.3.Final-redhat-4.jar:7.1.3.Final-redhat-4]
              at org.jboss.as.protocol.mgmt.AbstractMessageHandler$2$1.doExecute(AbstractMessageHandler.java:296) [jboss-as-protocol-7.1.3.Final-redhat-4.jar:7.1.3.Final-redhat-4]
              at org.jboss.as.protocol.mgmt.AbstractMessageHandler$AsyncTaskRunner.run(AbstractMessageHandler.java:518) [jboss-as-protocol-7.1.3.Final-redhat-4.jar:7.1.3.Final-redhat-4]
              at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_09-icedtea]
              at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_09-icedtea]
              at java.lang.Thread.run(Thread.java:722) [rt.jar:1.7.0_09-icedtea]
              at org.jboss.threads.JBossThread.run(JBossThread.java:122) [jboss-threads-2.0.0.GA-redhat-2.jar:2.0.0.GA-redhat-2]
          

           

          Am I doing something wrong or is this a bug? And to make sure is actually exists here is what I get trying to define again:

          [standalone@localhost:9999 /] /subsystem=datasources/jdbc-driver=sqlite:add(driver-name="sqlite",driver-module-name="org.xerial",driver-class-name=org.sqlite.JDBC)
          {
              "outcome" => "failed",
              "failure-description" => "JBAS014803: Duplicate resource [
              (\"subsystem\" => \"datasources\"),
              (\"jdbc-driver\" => \"sqlite\")
          ]",
              "rolled-back" => true
          }
          
          • 2. Re: Using CLI how do I remove JDBC Module, Driver and JNDI mapping.
            Steven Boscarine Apprentice

            Is module remove local or remote?  I know that 'module add' won't work against remote servers as of EAP 6.0.1

            • 3. Re: Using CLI how do I remove JDBC Module, Driver and JNDI mapping.
              jaikiran pai Master

              Is that NPE still reproducible against latest nightly build? If so, please create a JIRA in the AS7 project under "domain management" category. I am not sure if anyone has noticed that bugzilla issue since it looks like it's been assigned to a wrong owner.

              • 5. Re: Using CLI how do I remove JDBC Module, Driver and JNDI mapping.
                jaikiran pai Master

                Aleksandar Kostadinov wrote:

                 

                is https://ci.jboss.org/hudson/job/JBoss-AS-latest-master/ down?

                Looks like it's down. I'll check with the team which manages this.

                • 6. Re: Using CLI how do I remove JDBC Module, Driver and JNDI mapping.
                  jaikiran pai Master

                  jaikiran pai wrote:

                   

                  Aleksandar Kostadinov wrote:

                   

                  is https://ci.jboss.org/hudson/job/JBoss-AS-latest-master/ down?

                  Looks like it's down. I'll check with the team which manages this.

                  It's up now.

                  • 7. Re: Using CLI how do I remove JDBC Module, Driver and JNDI mapping.
                    Aleksandar Kostadinov Novice

                    I tried latest AS8 build from 27th and I am seeing. The driver can be inserted without specifying class name and creation of data-source fails but at least the driver module can easily be removed later unlike EAP 6.0.1. So I consider it fixed in AS8.

                     

                    I see another problem though. Trying to create a module from non-existing directory results in:

                    [standalone@localhost:9999 /] /subsystem=datasources/jdbc-driver=sqlite:add(driver-name="sqlite",driver-module-name="org.xerial",driver-class-name=org.sqlite.JDBC)
                    {
                        "outcome" => "failed",
                        "failure-description" => "JBAS010441: Failed to load module for driver [org.xerial]",
                        "rolled-back" => true
                    }
                    

                     

                    There is nothing in server log or elsewhere to help what the problem is. I just had a typo in my directory name and needed to spend some time until I fugured out that. Perhaps this error message can be made more descriptive?

                     

                    Thanks.