JDBC_PING on infinispan server not working

I am in a phase of experimenting with an infinispan server and I have a problem setting up an infinite cluster on my local machine. Configuration files: I am modifying the cluster.xml config file by changing part of the jgroup stack with udp stack and jdbc_ping detection.

 <subsystem xmlns="urn:infinispan:server:jgroups:7.0" default-stack="${jboss.default.jgroups.stack:udp-jdbc}">
        <stack name="udp-jdbc">
            <transport type="UDP" socket-binding="jgroups-udp">
                <property name="ip_mcast">false</property>
    </transport>
            <protocol type="JDBC_PING">
                <property name="connection_url">jdbc:mysql://localhost/jgroups</property>
                <property name="connection_username">root</property>
                <property name="connection_password">root</property>            
                <property name="connection_driver">com.mysql.jdbc.Driver</property>
    </protocol>                
            <protocol type="FD_SOCK" socket-binding="jgroups-udp-fd"/>
            <protocol type="FD_ALL"/>
            <protocol type="VERIFY_SUSPECT"/>
            <protocol type="pbcast.NAKACK2"/>
            <protocol type="UNICAST3"/>
            <protocol type="pbcast.STABLE"/>
            <protocol type="pbcast.GMS"/>
            <protocol type="UFC"/>
            <protocol type="MFC"/>
            <protocol type="FRAG2"/>
            <protocol type="RSVP"/>
        </stack>

      

I put the mysql driver in standalone / deploy folders, started the server and this is what I have as output

20:13:15,389 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-8) JBAS015876: Starting deployment of "mysql-connector-java-5.1.34-bin.jar" (runtime-name: "mysql-connector-java-5.1.34-bin.jar")
20:13:15,461 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-1) MSC000001: Failed to start service jboss.jgroups.channel.clustered: org.jboss.msc.service.StartException in service jboss.jgroups.channel.clustered: java.lang.IllegalArgumentException: JDBC Driver required for JDBC_PING protocol could not be loaded: 'com.mysql.jdbc.Driver'
    at org.jboss.as.clustering.jgroups.subsystem.ChannelService.start(ChannelService.java:74)
    at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1948) [jboss-msc-1.2.2.Final.jar:1.2.2.Final]
    at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1881) [jboss-msc-1.2.2.Final.jar:1.2.2.Final]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [rt.jar:1.8.0_25]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [rt.jar:1.8.0_25]
    at java.lang.Thread.run(Thread.java:745) [rt.jar:1.8.0_25]
Caused by: java.lang.IllegalArgumentException: JDBC Driver required for JDBC_PING protocol could not be loaded: 'com.mysql.jdbc.Driver'
    at org.jgroups.protocols.JDBC_PING.loadDriver(JDBC_PING.java:267)
    at org.jgroups.protocols.JDBC_PING.init(JDBC_PING.java:93)
    at org.jgroups.stack.ProtocolStack.initProtocolStack(ProtocolStack.java:860)
    at org.jgroups.stack.ProtocolStack.setup(ProtocolStack.java:481)
    at org.jgroups.JChannel.init(JChannel.java:848)
    at org.jgroups.JChannel.<init>(JChannel.java:159)
    at org.jboss.as.clustering.jgroups.JChannelFactory.createChannel(JChannelFactory.java:87)
    at org.jboss.as.clustering.jgroups.subsystem.ChannelService.start(ChannelService.java:69)
    ... 5 more

20:13:15,559 INFO  [org.jboss.as.connector.deployers.jdbc] (MSC service thread 1-3) JBAS010404: Deploying non-JDBC-compliant driver class com.mysql.jdbc.Driver (version 5.1)
20:13:15,561 INFO  [org.jboss.as.connector.deployers.jdbc] (MSC service thread 1-3) JBAS010404: Deploying non-JDBC-compliant driver class com.mysql.fabric.jdbc.FabricMySQLDriver (version 5.1)
20:13:15,563 INFO  [org.jboss.as.connector.deployers.jdbc] (MSC service thread 1-7) JBAS010417: Started Driver service with driver-name = mysql-connector-java-5.1.34-bin.jar_com.mysql.jdbc.Driver_5_1
20:13:15,564 INFO  [org.jboss.as.connector.deployers.jdbc] (MSC service thread 1-5) JBAS010417: Started Driver service with driver-name = mysql-connector-java-5.1.34-bin.jar_com.mysql.fabric.jdbc.FabricMySQLDriver_5_1
20:13:15,597 INFO  [org.jboss.as.server] (ServerService Thread Pool -- 18) JBAS018559: Deployed "mysql-connector-java-5.1.34-bin.jar" (runtime-name : "mysql-connector-java-5.1.34-bin.jar")
20:13:15,599 INFO  [org.jboss.as.controller] (Controller Boot Thread) JBAS014774: Service status report
JBAS014777:   Services which failed to start:      service jboss.jgroups.channel.clustered: org.jboss.msc.service.StartException in service jboss.jgroups.channel.clustered: java.lang.IllegalArgumentException: JDBC Driver required for JDBC_PING protocol could not be loaded: 'com.mysql.jdbc.Driver'

      

As you can see from the jboss log, the infinispan: server: jgroups subsystem failed to start because the JDBC driver was not loaded (JDBC_PING required), but after this step the infinispan server successfully deployed the mysql jdbc driver. This same error occurs under conditions when I work with a data source. Is there a way to tell that the infinispan: server: jgroups subsystem is started before the driver is loaded or before the jndi names are generated? Or any workaround that helps

Thank you in advance

+3


source to share


1 answer


To use JDBC directly, you need to allow the JGroups module to load the JDBC driver module. To do this, install the JDBC driver jar as a module, then open modules/system/layers/base/org/jgroups/main/module.xml

, add the JDBC driver module in the dependencies section.



For looking up datasource with EAGER caches, I think it is currently impossible to guarantee that the datasource is available before JGroups try to use it. The order in which services are loaded is controlled by software dependencies, but there is no way to declare dependencies through configuration files, so JGroups do not wait for a data source.

+3


source







All Articles