Skip to main content

Unable to find the driver com.mysql.jdbc.Driver. Register the driver in the Databases tab

This happened when you tried to create an entity from a database. I am currently using Wildfly 8.1.0, and MySQL 5.1.30 on NetBeans 8.0.

To resolve this issue, open the standalone-full.xml of JBOSS.
Under the datasources > drivers > driver, make sure the driver name is the same as the datasource > driver.

For example, make sure the text highlighted in the following code block is the same:


<subsystem xmlns="urn:jboss:domain:datasources:2.0">
    <datasources>
        <datasource jta="false" jndi-name="java:jboss/mysql" pool-name="mysql" enabled="true" use-ccm="false">
            <connection-url>jdbc:mysql://localhost:3306/client</connection-url>
            <driver-class>com.mysql.jdbc.Driver</driver-class>
            <driver>mysql</driver>
        </datasource>
        <drivers>
            <driver name="mysql" module="com.mysql">
                <driver-class>com.mysql.jdbc.Driver</driver-class>
            </driver>
        </drivers>
    </datasources>
</subsystem>

Comments

Popular posts from this blog

Fix HTTP error code 513 on Wildfly

The Mysterious Case of TIME_WAIT and IDLE Connections Have you ever encountered a network issue where your server is consistently showing a high number of connections in the TIME_WAIT and IDLE states? This phenomenon can be frustrating, especially when it indicates that the connections are not being closed properly by the server or client. In our investigation, we found that the culprit behind this issue was an HTTP error code 513 being sent to clients from servers. This error code indicates that the server is overloaded and cannot handle more requests. Furthermore, the client was logging a socket close event, which meant it was terminating the connection prematurely. To replicate this issue, we used JMeter and found that the max concurrent connection limit was reached, resulting in an HTTP error code 513. The allowed queue was also full, contributing to the problem. So, what are the consequences of this issue? Performance degradation and resource wastage on both servers and clients ca...

Catch persistence java.sql.sqlintegrityconstraintviolationexception

Handling SQL Integrity Constraint Violation Exceptions This tutorial will guide you through handling `SQLIntegrityConstraintViolationException` when persisting objects that violate database constraints. Step 1: Catch the EJB Exception Catch a `javax.ejb.EJBException` which wraps the underlying exception. try {     // persistence transactions } catch (Exception e) {     if (e instanceof javax.ejb.EJBException) {         logger.debug("Exception instance of javax.ejb.EjbException");     } } Step 2: Get the Underlying Exception Get the underlying exception from the `EJBException` using `e.getCause()`. try {     // persistence transactions } catch (Exception e) {     if (e instanceof javax.ejb.EJBException) {         logger.debug("Exception instance of javax.ejb.EjbException");         Throwable cause = e.getCause();         if (cause != null) {     ...

AutoCAD® freezes During Startup.

If you are using AutoCAD-based products on isolated networks, you might experience a problem where the program freezes after it starts up. This usually happens after the AutoCAD screen appears, but before any tool palettes show up. To fix this problem, you have to change your Internet Options settings. Note: This procedure might be risky if your computer is connected to the Internet. These are the steps you need to follow: Go to the Start menu (Windows) > Settings > Control Panel. In Control Panel, find and open Internet Options. In the Internet Properties window, go to the Advanced tab. On the Advanced tab, look for the Security section under Settings. In the Security section, uncheck the Publisher’s Certificate Revocation box. Click Apply, and then click OK. Restart your computer, and then launch the program. I hope this works for you. If it does, please share the solution with others. Further Reading http://usa.autodesk.com/adsk/servlet/ps/dl/item?siteID=123112&id=4366058...