1 Reply Latest reply on Apr 4, 2014 8:08 AM by Stefano Maestri

    can't enable datasource both via console or CLI

    sndaemon Newbie

      Version:wildfly-8.0.0.Final

       

      Create a MySQL datasource via CLI:

      /profile=front-ha/subsystem=datasources/data-source=testmysql:add\
      (driver-name=com.mysql,jndi-name=java:jboss/datasources/mysql,\
      connection-url=jdbc:mysql://192.168.1.100:3306/udmp,\
      max-pool-size=100,min-pool-size=10,user-name=aaaa,password=bbbb,enabled=false)
      

       

      And then enable it via console,but the lable of enabled didn't turn to √(enabled).

      Check the domain.xml,the value of enabled is still false.

       

      Enable it again whether via CLI or console,error log print:

       

      Response  
      Internal Server Error
       {
       "outcome" => "failed",
       "result" => undefined,
       "failure-description" => "JBAS010839: Operation failed or was rolled back on all servers.",
       "rolled-back" => true,
       "server-groups" => {"front-group1" => {"host" => {"master" => {"fserver1" => {"response" => {
       "outcome" => "failed",
       "failure-description" => "JBAS014749: Operation handler failed: Service jboss.data-source-config.testmysql is already registered",
       "rolled-back" => true
       }}}}}}
       }
      [Server:fserver1] 16:45:48,888 ERROR [org.jboss.as.controller.management-operation] (host-controller-connection-threads - 10) JBAS014612: Operation ("enable") failed - address: ([
       [Server:fserver1]  ("subsystem" => "datasources"),
       [Server:fserver1]  ("data-source" => "testmysql")
       [Server:fserver1] ]): org.jboss.msc.service.DuplicateServiceException: Service jboss.data-source-config.testmysql is already registered
       [Server:fserver1]  at org.jboss.msc.service.ServiceRegistrationImpl.setInstance(ServiceRegistrationImpl.java:158) [jboss-msc-1.2.0.Final.jar:1.2.0.Final]
       [Server:fserver1]  at org.jboss.msc.service.ServiceControllerImpl.startInstallation(ServiceControllerImpl.java:235) [jboss-msc-1.2.0.Final.jar:1.2.0.Final]
       [Server:fserver1]  at org.jboss.msc.service.ServiceContainerImpl.install(ServiceContainerImpl.java:767) [jboss-msc-1.2.0.Final.jar:1.2.0.Final]
       [Server:fserver1]  at org.jboss.msc.service.ServiceTargetImpl.install(ServiceTargetImpl.java:223) [jboss-msc-1.2.0.Final.jar:1.2.0.Final]
       [Server:fserver1]  at org.jboss.msc.service.ServiceControllerImpl$ChildServiceTarget.install(ServiceControllerImpl.java:2401) [jboss-msc-1.2.0.Final.jar:1.2.0.Final]
       [Server:fserver1]  at org.jboss.msc.service.ServiceBuilderImpl.install(ServiceBuilderImpl.java:317) [jboss-msc-1.2.0.Final.jar:1.2.0.Final]
       [Server:fserver1]  at org.jboss.as.controller.OperationContextImpl$ContextServiceBuilder.install(OperationContextImpl.java:1418) [wildfly-controller-8.0.0.Final.jar:8.0.0.Final]
       [Server:fserver1]  at org.jboss.as.connector.subsystems.datasources.DataSourceEnable.addServices(DataSourceEnable.java:188)
       [Server:fserver1]  at org.jboss.as.connector.subsystems.datasources.DataSourceEnable$1.execute(DataSourceEnable.java:84)
       [Server:fserver1]  at org.jboss.as.controller.AbstractOperationContext.executeStep(AbstractOperationContext.java:591) [wildfly-controller-8.0.0.Final.jar:8.0.0.Final]
       [Server:fserver1]  at org.jboss.as.controller.AbstractOperationContext.doCompleteStep(AbstractOperationContext.java:469) [wildfly-controller-8.0.0.Final.jar:8.0.0.Final]
       [Server:fserver1]  at org.jboss.as.controller.AbstractOperationContext.completeStepInternal(AbstractOperationContext.java:273) [wildfly-controller-8.0.0.Final.jar:8.0.0.Final]
       [Server:fserver1]  at org.jboss.as.controller.AbstractOperationContext.executeOperation(AbstractOperationContext.java:268) [wildfly-controller-8.0.0.Final.jar:8.0.0.Final]
       [Server:fserver1]  at org.jboss.as.controller.ModelControllerImpl.internalExecute(ModelControllerImpl.java:272) [wildfly-controller-8.0.0.Final.jar:8.0.0.Final]
       [Server:fserver1]  at org.jboss.as.controller.ModelControllerImpl.execute(ModelControllerImpl.java:146) [wildfly-controller-8.0.0.Final.jar:8.0.0.Final]
       [Server:fserver1]  at org.jboss.as.controller.remote.TransactionalProtocolOperationHandler.internalExecute(TransactionalProtocolOperationHandler.java:179) [wildfly-controller-8.0.0.Final.jar:8.0.0.Final]
       [Server:fserver1]  at org.jboss.as.controller.remote.TransactionalProtocolOperationHandler$ExecuteRequestHandler.doExecute(TransactionalProtocolOperationHandler.java:149) [wildfly-controller-8.0.0.Final.jar:8.0.0.Final]
       [Server:fserver1]  at org.jboss.as.controller.remote.TransactionalProtocolOperationHandler$ExecuteRequestHandler$1.run(TransactionalProtocolOperationHandler.java:113) [wildfly-controller-8.0.0.Final.jar:8.0.0.Final]
       [Server:fserver1]  at org.jboss.as.controller.remote.TransactionalProtocolOperationHandler$ExecuteRequestHandler$1.run(TransactionalProtocolOperationHandler.java:109) [wildfly-controller-8.0.0.Final.jar:8.0.0.Final]
       [Server:fserver1]  at java.security.AccessController.doPrivileged(Native Method) [rt.jar:1.7.0_25]
       [Server:fserver1]  at javax.security.auth.Subject.doAs(Subject.java:356) [rt.jar:1.7.0_25]
       [Server:fserver1]  at org.jboss.as.controller.AccessAuditContext.doAs(AccessAuditContext.java:83) [wildfly-controller-8.0.0.Final.jar:8.0.0.Final]
       [Server:fserver1]  at org.jboss.as.controller.remote.TransactionalProtocolOperationHandler$ExecuteRequestHandler$2$1.run(TransactionalProtocolOperationHandler.java:129) [wildfly-controller-8.0.0.Final.jar:8.0.0.Final]
       [Server:fserver1]  at org.jboss.as.controller.remote.TransactionalProtocolOperationHandler$ExecuteRequestHandler$2$1.run(TransactionalProtocolOperationHandler.java:125) [wildfly-controller-8.0.0.Final.jar:8.0.0.Final]
       [Server:fserver1]  at java.security.AccessController.doPrivileged(Native Method) [rt.jar:1.7.0_25]
       [Server:fserver1]  at org.jboss.as.controller.remote.TransactionalProtocolOperationHandler$ExecuteRequestHandler$2.execute(TransactionalProtocolOperationHandler.java:125) [wildfly-controller-8.0.0.Final.jar:8.0.0.Final]
       [Server:fserver1]  at org.jboss.as.protocol.mgmt.AbstractMessageHandler$2$1.doExecute(AbstractMessageHandler.java:283) [wildfly-protocol-8.0.0.Final.jar:8.0.0.Final]
       [Server:fserver1]  at org.jboss.as.protocol.mgmt.AbstractMessageHandler$AsyncTaskRunner.run(AbstractMessageHandler.java:504) [wildfly-protocol-8.0.0.Final.jar:8.0.0.Final]
       [Server:fserver1]  at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_25]
       [Server:fserver1]  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_25]
       [Server:fserver1]  at java.lang.Thread.run(Thread.java:724) [rt.jar:1.7.0_25]
       [Server:fserver1]  at org.jboss.threads.JBossThread.run(JBossThread.java:122) [jboss-threads-2.1.1.Final.jar:2.1.1.Final]
       [Server:fserver1]
      

       

      I tried with the standalone mode and AS7,it was OK.

      So,I opened a jira issue to this problem:[WFLY-3166] can't enable datasource both via console or CLI with cluster mode(can't persist to domain.xml) - JBoss Issue…