Unable to create connection.

26 views
Skip to first unread message

Cezar Apulchro

unread,
Jul 3, 2024, 5:50:15 PM (4 days ago) Jul 3
to WildFly
I have configured in my domain.xml the following:
----------------------------------
<datasource jndi-name="java:/jboss/datasources/MedicalDS" pool-name="MedicalDS">
                        <connection-url>jdbc:mysql://ipaddress:3306/db_medical?zeroDateTimeBehavior=CONVERT_TO_NULL</connection-url>
                        <driver-class>com.mysql.cj.jdbc.Driver</driver-class>
                        <driver>mysql</driver>
                        <security user-name="root" password="passwd"/>
                        <validation>
                            <valid-connection-checker class-name="org.jboss.jca.adapters.jdbc.extensions.mysql.MySQLValidConnectionChecker"/>
                            <validate-on-match>true</validate-on-match>
                            <exception-sorter class-name="org.jboss.jca.adapters.jdbc.extensions.mysql.MySQLExceptionSorter"/>
                        </validation>
                    </datasource>
<driver name="mysql" module="com.mysql">
                            <xa-datasource-class>com.mysql.cj.jdbc.MysqlXADataSource</xa-datasource-class>
                        </driver>
----------------------
My module in mysql directory:
 <?xml version="1.0" encoding="UTF-8"?>
<!--
  ~ Copyright The WildFly Authors
  ~ SPDX-License-Identifier: Apache-2.0
  -->
<module name="com.mysql" xmlns="urn:jboss:module:1.9">

    <resources>
        <resource-root path="mysql-connector-j-8.0.32.jar"/>
    </resources>

    <dependencies>
        <module name="java.compiler"/>
        <module name="java.desktop"/>
        <module name="java.instrument"/>
        <module name="java.logging"/>
        <module name="java.management"/>
        <module name="java.naming"/>
        <module name="java.scripting"/>
        <module name="java.sql"/>
        <module name="java.transaction.xa"/>
        <module name="org.slf4j"/>
    </dependencies>
</module>
--------------------
but when I click in runtime tab > drop down list hosts > itcmedbr(Host) > itcmedbr-server(Server) > datasources(Monitor) > MedicalDS(Datasource) > Test option I am receiving an error:
Caused by: java.lang.NoClassDefFoundError: javax/security/sasl/SaslException
        at com....@8.0.32//com.mysql.cj.protocol.a.NativeAuthenticationProvider.loadAuthenticationPlugins(NativeAuthenticationProvider.java:257)
        at com....@8.0.32//com.mysql.cj.protocol.a.NativeAuthenticationProvider.proceedHandshakeWithPluggableAuthentication(NativeAuthenticationProvider.java:378)
        at com....@8.0.32//com.mysql.cj.protocol.a.NativeAuthenticationProvider.connect(NativeAuthenticationProvider.java:212)
        at com....@8.0.32//com.mysql.cj.protocol.a.NativeProtocol.connect(NativeProtocol.java:1429)
        at com....@8.0.32//com.mysql.cj.NativeSession.connect(NativeSession.java:133)
        at com....@8.0.32//com.mysql.cj.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:944)
        at com....@8.0.32//com.mysql.cj.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:814)
        at com....@8.0.32//com.mysql.cj.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:444)
        at com....@8.0.32//com.mysql.cj.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:237)
        at com....@8.0.32//com.mysql.cj.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:198)
        at org.jboss.ironjac...@3.0.9.Final//org.jboss.jca.adapters.jdbc.local.LocalManagedConnectionFactory.createLocalManagedConnection(LocalManagedConnectionFactory.java:335)
        ... 38 more
Caused by: java.lang.ClassNotFoundException: javax.security.sasl.SaslException from [Module "com.mysql" version 8.0.32 from local module loader @781f10f2 (finder: local module finder @2a79d4b1 (roots: /opt/wildfly/modules,/opt/wildfly/modules/system/layers/base))]
        at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:200)
        at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:408)
        at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:396)
        at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:115)
        ... 49 more

 ERROR [org.jboss.as.controller.management-operation] (ServerService Thread Pool -- 20) WFLYCTL0013: Operation ("test-connection-in-pool") failed - address: ([
    ("subsystem" => "datasources"),
    ("data-source" => "MedicalDS")
]) - failure description: "WFLYJCA0040: failed to invoke operation: java.lang.IllegalStateException: WFLYJCA0047: Connection is not valid Caused by: jakarta.resource.ResourceException: jakarta.resource.ResourceException: IJ031084: Unable to create connection Caused by: jakarta.resource.ResourceException: IJ031084: Unable to create connection Caused by: java.lang.NoClassDefFoundError: javax/security/sasl/SaslException Caused by: java.lang.ClassNotFoundException: javax.security.sasl.SaslException from [Module \"com.mysql\" version 8.0.32 from local module loader @781f10f2 (finder: local module finder @2a79d4b1 (roots:/opt/wildfly/modules,/opt/wildfly/modules/system/layers/base))]"
 INFO  [org.jboss.as.repository] (ServerService Thread Pool -- 2) WFLYDR0009: Content /opt/wildfly/domain/servers/itcmedbr-server/data/content/e6/143ee5855072d25d4f146ffbedf9233263d3e2 is obsolete and will be removed
 INFO  [org.jboss.as.repository] (ServerService Thread Pool -- 2) WFLYDR0002: Content removed from location /opt/wildfly/domain/servers/itcmedbr-server/data/content/e6/143ee5855072d25d4f146ffbedf9233263d3e2/content
---------------------
The user and passwd is right are the same to log into mysql in my linux.

Ken Wills

unread,
Jul 4, 2024, 10:00:58 AM (3 days ago) Jul 4
to Cezar Apulchro, WildFly

--
You received this message because you are subscribed to the Google Groups "WildFly" group.
To unsubscribe from this group and stop receiving emails from it, send an email to wildfly+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/wildfly/d3a7d649-1421-4f45-a8e9-eebf2a49b128n%40googlegroups.com.

Emmanuel Hugonnet

unread,
Jul 4, 2024, 10:40:38 AM (3 days ago) Jul 4
to WildFly

Cezar Apulchro

unread,
Jul 5, 2024, 7:45:35 AM (2 days ago) Jul 5
to WildFly
Hi guys, yes Ken I have installed MySql Connector/J, Emmanuel after to change module.xml now this result when is restarted wildfly.service is:
------------------------------------
2024-07-05 08:33:31,284 ERROR [org.jboss.as.controller.management-operation] (ServerService Thread Pool -- 70) WFLYCTL0013: Operation ("add") failed - address: ([

    ("subsystem" => "datasources"),
    ("jdbc-driver" => "mysql")
]) - failure description: "WFLYJCA0115: Module for driver [com.mysql] or one of it dependencies is missing: [javax.security.sasl]"
2024-07-05 08:33:31,423 INFO  [org.jboss.as.connector.deployers.jdbc] (MSC service thread 1-2) WFLYJCA0018: Started Driver service with driver-name = h2
2024-07-05 08:33:31,424 INFO  [org.jboss.as.naming] (MSC service thread 1-2) WFLYNAM0003: Starting Naming Service
2024-07-05 08:33:31,609 INFO  [org.jboss.as.mail.extension] (MSC service thread 1-4) WFLYMAIL0001: Bound mail session [java:jboss/mail/Default]
2024-07-05 08:33:31,775 WARN  [org.wildfly.extension.elytron] (MSC service thread 1-1) WFLYELY00023: KeyStore file '/opt/wildfly/domain/configuration/application.keystore' does not exist. Used blank.
2024-07-05 08:33:31,873 INFO  [org.jboss.as.ejb3] (MSC service thread 1-2) WFLYEJB0482: Strict pool mdb-strict-max-pool is using a max instance size of 8 (per class), which is derived from the number of CPUs on this host.
2024-07-05 08:33:31,875 INFO  [org.jboss.as.ejb3] (MSC service thread 1-4) WFLYEJB0481: Strict pool slsb-strict-max-pool is using a max instance size of 32 (per class), which is derived from thread worker pool sizing.
2024-07-05 08:33:31,894 WARN  [org.wildfly.extension.elytron] (MSC service thread 1-2) WFLYELY01084: KeyStore /opt/wildfly/domain/configuration/application.keystore not found, it will be auto-generated on first use with a self-signed certificate for host localhost
2024-07-05 08:33:31,934 INFO  [org.wildfly.extension.undertow] (MSC service thread 1-1) WFLYUT0012: Started server default-server.
2024-07-05 08:33:32,224 INFO  [org.wildfly.extension.undertow] (MSC service thread 1-1) Queuing requests.
2024-07-05 08:33:32,226 INFO  [org.wildfly.extension.undertow] (MSC service thread 1-1) WFLYUT0018: Host default-host starting
2024-07-05 08:33:32,830 INFO  [org.wildfly.iiop.openjdk] (MSC service thread 1-2) WFLYIIOP0009: CORBA ORB Service started
2024-07-05 08:33:32,989 INFO  [org.wildfly.extension.undertow] (MSC service thread 1-3) WFLYUT0006: Undertow HTTP listener default listening on xxx.xxx.xx.xxx:8230
2024-07-05 08:33:32,996 INFO  [org.jboss.as.ejb3] (MSC service thread 1-4) WFLYEJB0493: Jakarta Enterprise Beans subsystem suspension complete
2024-07-05 08:33:33,002 INFO  [org.wildfly.extension.undertow] (MSC service thread 1-1) WFLYUT0006: Undertow HTTPS listener https listening on xxx.xxx.xx.xxx:8593
2024-07-05 08:33:33,337 INFO  [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-2) WFLYJCA0001: Bound data source [java:jboss/datasources/ExampleDS]
2024-07-05 08:33:33,406 INFO  [org.jboss.ws.common.management] (MSC service thread 1-3) JBWS022052: Starting JBossWS 7.1.0.Final (Apache CXF 4.0.4)
2024-07-05 08:33:33,456 INFO  [org.apache.activemq.artemis.core.server] (ServerService Thread Pool -- 74) AMQ221000: primary Message Broker is starting with configuration Broker Configuration (clustered=false,journalDirectory=/opt/wildfly/domain/servers/itcmedbr-server/data/activemq/journal,bindingsDirectory=/opt/wildfly/domain/servers/itcmedbr-server/data/activemq/bindings,largeMessagesDirectory=/opt/wildfly/domain/servers/itcmedbr-server/data/activemq/largemessages,pagingDirectory=/opt/wildfly/domain/servers/itcmedbr-server/data/activemq/paging)
2024-07-05 08:33:33,570 INFO  [org.apache.activemq.artemis.core.server] (ServerService Thread Pool -- 74) AMQ221012: Using AIO Journal
2024-07-05 08:33:33,972 INFO  [org.apache.activemq.artemis.core.server] (ServerService Thread Pool -- 74) AMQ221043: Protocol module found: [artemis-server]. Adding protocol support for: CORE
2024-07-05 08:33:33,973 INFO  [org.apache.activemq.artemis.core.server] (ServerService Thread Pool -- 74) AMQ221043: Protocol module found: [artemis-amqp-protocol]. Adding protocol support for: AMQP
2024-07-05 08:33:33,973 INFO  [org.apache.activemq.artemis.core.server] (ServerService Thread Pool -- 74) AMQ221043: Protocol module found: [artemis-hornetq-protocol]. Adding protocol support for: HORNETQ
2024-07-05 08:33:33,973 INFO  [org.apache.activemq.artemis.core.server] (ServerService Thread Pool -- 74) AMQ221043: Protocol module found: [artemis-stomp-protocol]. Adding protocol support for: STOMP
2024-07-05 08:33:34,046 INFO  [org.apache.activemq.artemis.core.server] (ServerService Thread Pool -- 74) AMQ221034: Waiting indefinitely to obtain primary lock
2024-07-05 08:33:34,046 INFO  [org.apache.activemq.artemis.core.server] (ServerService Thread Pool -- 74) AMQ221035: Primary Server Obtained primary lock
2024-07-05 08:33:34,715 INFO  [org.apache.activemq.artemis.core.server] (ServerService Thread Pool -- 74) AMQ221003: Deploying ANYCAST queue jms.queue.ExpiryQueue on address jms.queue.ExpiryQueue
2024-07-05 08:33:34,720 INFO  [org.apache.activemq.artemis.core.server] (ServerService Thread Pool -- 74) AMQ221003: Deploying ANYCAST queue jms.queue.DLQ on address jms.queue.DLQ
2024-07-05 08:33:34,817 INFO  [org.wildfly.extension.messaging-activemq] (MSC service thread 1-1) WFLYMSGAMQ0016: Registered HTTP upgrade for activemq-remoting protocol handled by http-acceptor acceptor
2024-07-05 08:33:34,818 INFO  [org.wildfly.extension.messaging-activemq] (MSC service thread 1-2) WFLYMSGAMQ0016: Registered HTTP upgrade for activemq-remoting protocol handled by http-acceptor acceptor
2024-07-05 08:33:34,819 INFO  [org.wildfly.extension.messaging-activemq] (MSC service thread 1-4) WFLYMSGAMQ0016: Registered HTTP upgrade for activemq-remoting protocol handled by http-acceptor-throughput acceptor
2024-07-05 08:33:34,819 INFO  [org.wildfly.extension.messaging-activemq] (MSC service thread 1-3) WFLYMSGAMQ0016: Registered HTTP upgrade for activemq-remoting protocol handled by http-acceptor-throughput acceptor
2024-07-05 08:33:35,163 INFO  [org.apache.activemq.artemis.core.server] (ServerService Thread Pool -- 74) AMQ221007: Server is now active
2024-07-05 08:33:35,164 INFO  [org.apache.activemq.artemis.core.server] (ServerService Thread Pool -- 74) AMQ221001: Apache ActiveMQ Artemis Message Broker version 2.32.0 [default, nodeID=c4f254e5-35ab-11ef-a645-eeb834f45b20]
2024-07-05 08:33:35,326 INFO  [org.wildfly.extension.messaging-activemq] (ServerService Thread Pool -- 77) WFLYMSGAMQ0002: Bound messaging object to jndi name java:jboss/exported/jms/RemoteConnectionFactory
2024-07-05 08:33:35,327 INFO  [org.wildfly.extension.messaging-activemq] (ServerService Thread Pool -- 76) WFLYMSGAMQ0002: Bound messaging object to jndi name java:/ConnectionFactory
2024-07-05 08:33:35,749 INFO  [org.jboss.as.connector.deployment] (MSC service thread 1-3) WFLYJCA0007: Registered connection factory java:/JmsXA
2024-07-05 08:33:35,928 INFO  [org.apache.activemq.artemis.ra.ActiveMQRALogger] (MSC service thread 1-3) AMQ151007: Resource adaptor started
2024-07-05 08:33:35,929 INFO  [org.jboss.as.connector.services.resourceadapters.ResourceAdapterActivatorService$ResourceAdapterActivator] (MSC service thread 1-3) IJ020002: Deployed: file://RaActivatoractivemq-ra
2024-07-05 08:33:35,941 INFO  [org.jboss.as.connector.deployment] (MSC service thread 1-4) WFLYJCA0002: Bound Jakarta Connectors ConnectionFactory [java:/JmsXA]
2024-07-05 08:33:35,942 INFO  [org.jboss.as.connector.deployment] (MSC service thread 1-2) WFLYJCA0118: Binding connection factory named java:/JmsXA to alias java:jboss/DefaultJMSConnectionFactory
2024-07-05 08:33:35,993 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) WFLYCTL0013: Operation ("add") failed - address: ([

    ("subsystem" => "datasources"),
    ("data-source" => "MedicalDS")
]) - failure description: {
    "WFLYCTL0412: Required services that are not installed:" => ["jboss.jdbc-driver.mysql"],
    "WFLYCTL0180: Services with missing/unavailable dependencies" => [
        "service jboss.data-source.\"jboss.naming.context.java.jboss.datasources.MedicalDS\" is missing [jboss.jdbc-driver.mysql]",
        "service jboss.driver-demander.java:/jboss/datasources/MedicalDS is missing [jboss.jdbc-driver.mysql]"
    ]
}
2024-07-05 08:33:36,000 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) WFLYCTL0013: Operation ("add") failed - address: ([

    ("subsystem" => "datasources"),
    ("data-source" => "MedicalDS")
]) - failure description: {
    "WFLYCTL0412: Required services that are not installed:" => [
        "jboss.jdbc-driver.mysql",
        "jboss.jdbc-driver.mysql"
    ],
    "WFLYCTL0180: Services with missing/unavailable dependencies" => [
        "service jboss.data-source.\"jboss.naming.context.java.jboss.datasources.MedicalDS\" is missing [jboss.jdbc-driver.mysql]",
        "service jboss.driver-demander.java:/jboss/datasources/MedicalDS is missing [jboss.jdbc-driver.mysql]",
        "service jboss.data-source.\"jboss.naming.context.java.jboss.datasources.MedicalDS\" is missing [jboss.jdbc-driver.mysql]"
    ]
}
2024-07-05 08:33:36,229 INFO  [org.jboss.as.controller] (Controller Boot Thread) WFLYCTL0183: Service status report
WFLYCTL0184:    New missing/unsatisfied dependencies:
      service jboss.jdbc-driver.mysql (missing) dependents: [service jboss.data-source."jboss.naming.context.java.jboss.datasources.MedicalDS", service jboss.driver-demander.java:/jboss/datasources/MedicalDS]
WFLYCTL0448: 2 additional services are down due to their dependencies being missing or failed
2024-07-05 08:33:36,309 INFO  [org.jboss.as.server] (Controller Boot Thread) WFLYSRV0212: Resuming server
2024-07-05 08:33:36,353 ERROR [org.jboss.as] (Controller Boot Thread) WFLYSRV0026: WildFly Full 32.0.1.Final (WildFly Core 24.0.1.Final) started (with errors) in 12868ms - Started 308 of 590 services (4 services failed or missing dependencies, 372 services are lazy, passive or on-demand)
--------------------------
Thanks.

Reply all
Reply to author
Forward
0 new messages