<html>
  <head>
    <meta content="text/html; charset=windows-1252"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <div class="moz-cite-prefix">Not sure if this is Wildfly issue or
      Keycloak issue. Maybe it can be handled somehow in our subsystem,
      so you will be able to declare that infinispan CacheManager (or
      JGroups Channel) is dependent on datasource "java:/MySQLDS" ,
      which should then ensure that infinispan/jgroups will be shoutdown
      first and then the MySQLDS datasource afterwards.<br>
      <br>
      Maybe we can handle our subsystem should be more "flexible" and
      support somehow to easily declare dependencies on additional
      components (maybe it supports it already, I don't know...)<br>
      <br>
      Maybe you can create JIRA and investigate this deeper. I suggest
      you investigate by yourself as we probably won't have time to look
      at it. The JGroups channel with JDBC_PING is probably not very big
      priority for us...<br>
      <br>
      Marek<br>
      <br>
      On 11/07/16 02:59, Sarp Kaya wrote:<br>
    </div>
    <blockquote cite="mid:D3A92C8F.B0B5%25akaya@expedia.com" type="cite">
      <meta http-equiv="Content-Type" content="text/html;
        charset=windows-1252">
      <div>Hello,</div>
      <div><br>
      </div>
      <div>For the caching if we are using infinispan with JDBC_PING
        then JDBC connection is closed before infinispan stops its
        caching related stuff. This causes an exception to be thrown and
        therefore it does not really shut infinispan gracefully.</div>
      <div><br>
      </div>
      <div>Logs:</div>
      <div>
        <div>2016-07-11 00:53:48,330 INFO  [org.jboss.as.server]
          (Thread-2) WFLYSRV0220: Server shutdown has been requested.</div>
        <div>2016-07-11 00:53:48,385 INFO
           [org.jboss.as.connector.subsystems.datasources] (MSC service
          thread 1-2) WFLYJCA0010: Unbound data source [java:/MySQLDS]</div>
        <div>2016-07-11 00:53:48,394 INFO
           [org.infinispan.remoting.transport.jgroups.JGroupsTransport]
          (MSC service thread 1-2) ISPN000080: Disconnecting JGroups
          channel web</div>
        <div>2016-07-11 00:53:48,396 INFO
           [org.infinispan.remoting.transport.jgroups.JGroupsTransport]
          (MSC service thread 1-1) ISPN000080: Disconnecting JGroups
          channel server</div>
        <div>2016-07-11 00:53:48,395 INFO
           [org.wildfly.extension.undertow] (ServerService Thread Pool
          -- 60) WFLYUT0022: Unregistered web context: /auth</div>
        <div>2016-07-11 00:53:48,397 INFO
           [org.infinispan.remoting.transport.jgroups.JGroupsTransport]
          (MSC service thread 1-2) ISPN000082: Stopping the
          RpcDispatcher for channel web</div>
        <div>2016-07-11 00:53:48,398 INFO
           [org.infinispan.remoting.transport.jgroups.JGroupsTransport]
          (MSC service thread 1-1) ISPN000082: Stopping the
          RpcDispatcher for channel server</div>
        <div>2016-07-11 00:53:48,403 INFO
           [org.infinispan.remoting.transport.jgroups.JGroupsTransport]
          (MSC service thread 1-1) ISPN000080: Disconnecting JGroups
          channel hibernate</div>
        <div>2016-07-11 00:53:48,408 INFO
           [org.infinispan.remoting.transport.jgroups.JGroupsTransport]
          (MSC service thread 1-1) ISPN000082: Stopping the
          RpcDispatcher for channel hibernate</div>
        <div>2016-07-11 00:53:48,407 INFO
           [org.infinispan.remoting.transport.jgroups.JGroupsTransport]
          (MSC service thread 1-2) ISPN000080: Disconnecting JGroups
          channel ejb</div>
        <div>2016-07-11 00:53:48,411 INFO
           [org.infinispan.remoting.transport.jgroups.JGroupsTransport]
          (MSC service thread 1-2) ISPN000082: Stopping the
          RpcDispatcher for channel ejb</div>
        <div>2016-07-11 00:53:48,414 INFO
           [org.wildfly.extension.undertow] (MSC service thread 1-2)
          WFLYUT0008: Undertow HTTPS listener https suspending</div>
        <div>2016-07-11 00:53:48,416 WARN
           [org.jboss.jca.core.connectionmanager.pool.strategy.OnePool]
          (ServerService Thread Pool -- 59) IJ000615: Destroying active
          connection in pool: MySQLDS
          (org.jboss.jca.adapters.jdbc.local.LocalManagedConnection@57e067d0)</div>
        <div>2016-07-11 00:53:48,423 INFO
           [org.wildfly.extension.undertow] (MSC service thread 1-2)
          WFLYUT0007: Undertow HTTPS listener https stopped, was bound
          to 0.0.0.0:8443</div>
        <div>2016-07-11 00:53:48,429 INFO
           [org.jboss.as.connector.deployers.jdbc] (MSC service thread
          1-1) WFLYJCA0019: Stopped Driver service with driver-name =
          mysql</div>
        <div>2016-07-11 00:53:48,434 INFO
           [org.wildfly.extension.undertow] (MSC service thread 1-1)
          WFLYUT0019: Host default-host stopping</div>
        <div>2016-07-11 00:53:48,448 INFO
           [org.jboss.as.connector.subsystems.datasources] (MSC service
          thread 1-1) WFLYJCA0010: Unbound data source
          [java:jboss/datasources/ExampleDS]</div>
        <div>2016-07-11 00:53:48,467 INFO
           [org.jboss.as.clustering.infinispan] (ServerService Thread
          Pool -- 59) WFLYCLINF0003: Stopped sessions cache from
          keycloak container</div>
        <div>2016-07-11 00:53:48,472 INFO
           [org.jboss.as.clustering.infinispan] (ServerService Thread
          Pool -- 60) WFLYCLINF0003: Stopped realms cache from keycloak
          container</div>
        <div>2016-07-11 00:53:48,475 INFO
           [org.jboss.as.clustering.infinispan] (ServerService Thread
          Pool -- 60) WFLYCLINF0003: Stopped loginFailures cache from
          keycloak container</div>
        <div>2016-07-11 00:53:48,477 INFO
           [org.jboss.as.clustering.infinispan] (ServerService Thread
          Pool -- 59) WFLYCLINF0003: Stopped offlineSessions cache from
          keycloak container</div>
        <div>2016-07-11 00:53:48,487 INFO
           [org.jboss.as.connector.deployers.jdbc] (MSC service thread
          1-1) WFLYJCA0019: Stopped Driver service with driver-name = h2</div>
        <div>2016-07-11 00:53:48,489 INFO
           [org.jboss.as.clustering.infinispan] (ServerService Thread
          Pool -- 63) WFLYCLINF0003: Stopped users cache from keycloak
          container</div>
        <div>2016-07-11 00:53:48,492 INFO
           [org.wildfly.extension.undertow] (MSC service thread 1-2)
          WFLYUT0008: Undertow AJP listener ajp suspending</div>
        <div>2016-07-11 00:53:48,496 INFO
           [org.jboss.as.clustering.infinispan] (ServerService Thread
          Pool -- 62) WFLYCLINF0003: Stopped realmVersions cache from
          keycloak container</div>
        <div>2016-07-11 00:53:48,497 INFO
           [org.wildfly.extension.undertow] (MSC service thread 1-2)
          WFLYUT0007: Undertow AJP listener ajp stopped, was bound to
          0.0.0.0:8009</div>
        <div>2016-07-11 00:53:48,500 INFO
           [org.jboss.as.clustering.infinispan] (ServerService Thread
          Pool -- 64) WFLYCLINF0003: Stopped work cache from keycloak
          container</div>
        <div>2016-07-11 00:53:48,499 INFO  [org.jboss.modcluster]
          (ServerService Thread Pool -- 65) MODCLUSTER000002: Initiating
          mod_cluster shutdown</div>
        <div>2016-07-11 00:53:48,506 INFO
           [org.jboss.as.server.deployment] (MSC service thread 1-2)
          WFLYSRV0028: Stopped deployment keycloak-server.war
          (runtime-name: keycloak-server.war) in 138ms</div>
        <div>2016-07-11 00:53:48,499 INFO
           [org.wildfly.extension.undertow] (MSC service thread 1-1)
          WFLYUT0008: Undertow HTTP listener default suspending</div>
        <div>2016-07-11 00:53:48,508 INFO
           [org.wildfly.extension.undertow] (MSC service thread 1-1)
          WFLYUT0007: Undertow HTTP listener default stopped, was bound
          to 0.0.0.0:8080</div>
        <div>2016-07-11 00:53:48,516 INFO
           [org.jboss.as.clustering.infinispan] (MSC service thread 1-2)
          WFLYCLINF0003: Stopped authorization cache from keycloak
          container</div>
        <div>2016-07-11 00:53:48,517 INFO
           [org.wildfly.extension.undertow] (MSC service thread 1-1)
          WFLYUT0004: Undertow 1.3.15.Final stopping</div>
        <div>2016-07-11 00:53:48,542 INFO
           [org.infinispan.remoting.transport.jgroups.JGroupsTransport]
          (MSC service thread 1-2) ISPN000080: Disconnecting JGroups
          channel keycloak</div>
        <div>2016-07-11 00:53:48,543 INFO
           [org.infinispan.remoting.transport.jgroups.JGroupsTransport]
          (MSC service thread 1-2) ISPN000082: Stopping the
          RpcDispatcher for channel keycloak</div>
        <div>2016-07-11 00:53:48,553 ERROR
          [org.jgroups.protocols.JDBC_PING] (MSC service thread 1-1)
          Could not open connection to database: java.sql.SQLException:
          javax.resource.ResourceException: IJ000470: You are trying to
          use a connection factory that has been shut down:
          java:/MySQLDS</div>
        <div>        at
org.jboss.jca.adapters.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:146)</div>
        <div>        at
org.jboss.as.connector.subsystems.datasources.WildFlyDataSource.getConnection(WildFlyDataSource.java:66)</div>
        <div>        at
          org.jgroups.protocols.JDBC_PING.getConnection(JDBC_PING.java:348)</div>
        <div>        at
          org.jgroups.protocols.JDBC_PING.delete(JDBC_PING.java:379)</div>
        <div>        at
          org.jgroups.protocols.JDBC_PING.deleteSelf(JDBC_PING.java:395)</div>
        <div>        at
          org.jgroups.protocols.JDBC_PING.stop(JDBC_PING.java:144)</div>
        <div>        at
          org.jgroups.stack.ProtocolStack.stopStack(ProtocolStack.java:1015)</div>
        <div>        at
          org.jgroups.JChannel.stopStack(JChannel.java:1002)</div>
        <div>        at
          org.jgroups.JChannel.disconnect(JChannel.java:373)</div>
        <div>        at
org.wildfly.clustering.jgroups.spi.service.ChannelConnectorBuilder.stop(ChannelConnectorBuilder.java:103)</div>
        <div>        at
org.jboss.msc.service.ServiceControllerImpl$StopTask.stopService(ServiceControllerImpl.java:2056)</div>
        <div>        at
org.jboss.msc.service.ServiceControllerImpl$StopTask.run(ServiceControllerImpl.java:2017)</div>
        <div>        at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)</div>
        <div>        at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)</div>
        <div>        at java.lang.Thread.run(Thread.java:745)</div>
        <div>Caused by: javax.resource.ResourceException: IJ000470: You
          are trying to use a connection factory that has been shut
          down: java:/MySQLDS</div>
        <div>        at
org.jboss.jca.core.connectionmanager.AbstractConnectionManager.allocateConnection(AbstractConnectionManager.java:735)</div>
        <div>        at
org.jboss.jca.adapters.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:138)</div>
        <div>        ... 14 more</div>
        <div><br>
        </div>
        <div>2016-07-11 00:53:48,559 ERROR
          [org.jgroups.protocols.JDBC_PING] (MSC service thread 1-1)
          Failed to delete PingData in database</div>
        <div>2016-07-11 00:53:51,576 INFO  [org.jboss.as] (MSC service
          thread 1-1) WFLYSRV0050: Keycloak 2.0.0.Final (WildFly Core
          2.0.10.Final) stopped in 3208ms</div>
      </div>
      <div><br>
      </div>
      <div><br>
      </div>
      <div>Kind Regards,</div>
      <div>Sarp Kaya</div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
keycloak-user mailing list
<a class="moz-txt-link-abbreviated" href="mailto:keycloak-user@lists.jboss.org">keycloak-user@lists.jboss.org</a>
<a class="moz-txt-link-freetext" href="https://lists.jboss.org/mailman/listinfo/keycloak-user">https://lists.jboss.org/mailman/listinfo/keycloak-user</a></pre>
    </blockquote>
    <br>
  </body>
</html>