1 Reply Latest reply on May 7, 2019 4:41 AM by Wolfgang Mayer

    Wildfly 16 can't connect datasource: invalid connection

    yassin Fourka Newbie

      I'm trying to connect my database in Wildfly to jJva. Unfortunately I get an error sayign the connection and login failed. How do I solve this?

      When I try to test my connection in wildfly management, I get error:

      WFLYJCA0040: failed to invoke operation: WFLYJCA0047: Connection is not valid

       

      standalone-full.xml

      <datasource jndi-name="java:jboss/datasources/kundeDS" pool-name="kundeDS">

                          <connection-url>jdbc:mysql://localhost:3306/kunde</connection-url>

                          <driver>mysql</driver>

                          <security>

                              <user-name>test</user-name>

                              <password>1234</password>

                          </security>

                          <validation>

                              <valid-connection-checker class-name="org.jboss.jca.adapters.jdbc.extensions.mysql.MySQLValidConnectionChecker"/>

                              <background-validation>true</background-validation>

                              <exception-sorter class-name="org.jboss.jca.adapters.jdbc.extensions.mysql.MySQLExceptionSorter"/>

                          </validation>

                      </datasource>

                      <drivers>

                          <driver name="h2" module="com.h2database.h2">

                              <xa-datasource-class>org.h2.jdbcx.JdbcDataSource</xa-datasource-class>

                          </driver>

                          <driver name="mysql" module="com.mysql">

                              <driver-class>com.mysql.cj.jdbc.Driver</driver-class>

                              <xa-datasource-class>com.mysql.cj.jdbc.MysqlXADataSource</xa-datasource-class>

                          </driver>

                      </drivers>

                  </datasources>