2 Replies Latest reply on Sep 24, 2018 3:35 AM by Bhavesh Kharwa

    Wildfly-14 : JDBC_PING error: Could not lookup datasource java:jboss/jgroups/JGroupsDS

    Bhavesh Kharwa Newbie

      Hi,

       

      I have configured wildfly-14 in domain mode. I have used JDBC_PING and also create XA_DATASOURCE. Following are the configuration for JDBC_PING and XA_DATASOURCE.

       

      JDBC_PING:

      <subsystem xmlns="urn:jboss:domain:jgroups:6.0">
                      <channels default="ee">
                          <channel name="ee" stack="tcp" cluster="ejb"/>
                      </channels>
                      <stacks>
                          <stack name="udp">
                              <transport type="UDP" socket-binding="jgroups-udp"/>
                              ...
                          </stack>
                          <stack name="tcp">
                              <transport type="TCP" socket-binding="jgroups-tcp"/>
                              <protocol type="org.jgroups.protocols.JDBC_PING">
                                  <property name="datasource_jndi_name">
                                      java:/jdbc/jgroups/JGroupsDS
                                  </property>
                              </protocol>
                             ...
                          </stack>
                      </stacks>
       </subsystem>
      
       <deployments>
              <deployment name="postgresql-9.4-1201-jdbc41.jar" runtime-name="postgresql-9.4-1201-jdbc41.jar">
                  <content sha1="870b0e689b514304461a9c1aba11920dc5de4321"/>
              </deployment>
          </deployments>
      

       

       

      XA_DATASOURCE Configuration:

      <xa-datasource jndi-name="java:/jdbc/jgroups/JGroupsDS" pool-name="JGroupsDS" enabled="true">
                              <xa-datasource-property name="PortNumber">
                                  5432
                              </xa-datasource-property>
                              <xa-datasource-property name="ServerName">
                                  <<database_server_ip>>
                              </xa-datasource-property>
                              <xa-datasource-property name="DatabaseName">
                                  jgroups
                              </xa-datasource-property>
                              <xa-datasource-class>org.postgresql.xa.PGXADataSource</xa-datasource-class>
                              <driver>postgresql-9.4-1201-jdbc41.jar</driver>
                              <security>
                                  <user-name>jgroups</user-name>
                                  <password>jgroups</password>
                              </security>
       </xa-datasource>

       

      Also I have deployed postgresql-9.4-1201-jdbc41.jar thru wildfly admin console.

       

      I have configured only one server "app1" as of now.

      When I start app1 , it gives following error.

      2018-09-21 07:11:01,957 INFO  [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-4) WFLYJCA0010: Unbound data source [java:jboss/jgroups/JGroupsDS]2018-09-21 07:11:03,341 ERROR [org.jboss.msc.service.fail] (ServerService Thread Pool -- 81) MSC000001: Failed to start service org.wildfly.clustering.jgroups.channel.ee: org.jboss.msc.service.StartException in service org.wildfly.clustering.jgroups.channel.ee: java.lang.IllegalStateException: java.lang.IllegalArgumentException: Could not lookup datasource java:jboss/jgroups/JGroupsDS
              at org.wildfly.clustering.service.FunctionalService.start(FunctionalService.java:70)
              at org.wildfly.clustering.service.AsyncServiceConfigurator$AsyncService.lambda$start$0(AsyncServiceConfigurator.java:117)
              at org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35)
              at org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:1985)
              at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1487)
              at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1378)
              at java.lang.Thread.run(Thread.java:745)
              at org.jboss.threads.JBossThread.run(JBossThread.java:485)
      Caused by: java.lang.IllegalStateException: java.lang.IllegalArgumentException: Could not lookup datasource java:jboss/jgroups/JGroupsDS
              at org.jboss.as.clustering.jgroups.subsystem.ChannelServiceConfigurator.get(ChannelServiceConfigurator.java:116)
              at org.jboss.as.clustering.jgroups.subsystem.ChannelServiceConfigurator.get(ChannelServiceConfigurator.java:58)
              at org.wildfly.clustering.service.FunctionalService.start(FunctionalService.java:67)
              ... 7 more
      Caused by: java.lang.IllegalArgumentException: Could not lookup datasource java:jboss/jgroups/JGroupsDS
              at org.jgroups.protocols.JDBC_PING.getDataSourceFromJNDI(JDBC_PING.java:402)
              at org.jgroups.protocols.JDBC_PING.init(JDBC_PING.java:108)
              at org.jgroups.stack.ProtocolStack.initProtocolStack(ProtocolStack.java:840)
              at org.jgroups.stack.ProtocolStack.init(ProtocolStack.java:830)
              at org.jgroups.JChannel.<init>(JChannel.java:200)
              at org.jboss.as.clustering.jgroups.JChannelFactory.createChannel(JChannelFactory.java:116)
              at org.jboss.as.clustering.jgroups.subsystem.ChannelServiceConfigurator.get(ChannelServiceConfigurator.java:96)
              ... 9 more
      Caused by: javax.naming.NameNotFoundException: jgroups/JGroupsDS [Root exception is java.lang.IllegalStateException]
              at org.jboss.as.naming.ServiceBasedNamingStore.lookup(ServiceBasedNamingStore.java:153)
              at org.jboss.as.naming.ServiceBasedNamingStore.lookup(ServiceBasedNamingStore.java:83)
              at org.jboss.as.naming.NamingContext.lookup(NamingContext.java:207)
              at org.jboss.as.naming.NamingContext.lookup(NamingContext.java:184)
              at org.jboss.as.naming.InitialContext$DefaultInitialContext.lookup(InitialContext.java:239)
              at org.jboss.as.naming.NamingContext.lookup(NamingContext.java:193)
              at org.jboss.as.naming.NamingContext.lookup(NamingContext.java:189)
              at javax.naming.InitialContext.lookup(InitialContext.java:417)
              at javax.naming.InitialContext.lookup(InitialContext.java:417)
              at org.jgroups.protocols.JDBC_PING.getDataSourceFromJNDI(JDBC_PING.java:393)
              ... 15 more
      Caused by: java.lang.IllegalStateException
              at org.jboss.msc.value.InjectedValue.getValue(InjectedValue.java:50)
              at org.jboss.as.naming.service.BinderService.getValue(BinderService.java:148)
              at org.jboss.as.naming.service.BinderService.getValue(BinderService.java:46)
              at org.jboss.msc.service.ServiceControllerImpl.getValue(ServiceControllerImpl.java:1110)
              at org.jboss.as.naming.ServiceBasedNamingStore.lookup(ServiceBasedNamingStore.java:131)
              ... 24 more
      
      2018-09-21 07:11:04,056 INFO  [org.jboss.as.connector.deployers.jdbc] (MSC service thread 1-4) WFLYJCA0018: Started Driver service with driver-name = postgresql-9.4-1201-jdbc41.jar
      2018-09-21 07:11:04,105 INFO  [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-1) WFLYJCA0001: Bound data source [java:jboss/jgroups/JGroupsDS]
      
      

       

      In wildfly 13, it is working fine but in wildfly-14 why subsystem bound data source after JDBC_PING. What is wrong with configuration?