Can't find bundle for base name com.mysql.cj.LocalizedErrorMessages locale pt_BR

67 views Asked by At

I'm trying to generate a repetition of my JavaFX application, as it uses some Maven dependencies, I'm using the Gluonfx library to generate the repetition, as it can "encapsulate" all dependencies in a single file.

The point is, when I run the command mvn gluonfx:nativerun in the console and execute the action from the home screen that has a connection to the database I get the following error:

[seg. dez. 18 14:50:57 BRT 2023][INFO] [SUB] Caused by: java.lang.RuntimeException: Can't load resource bundle due to underlying exception java.util.MissingResourceException: Can't find bundle for base name com.mysql.cj.LocalizedErrorMessages, locale pt_BR
[seg. dez. 18 14:50:57 BRT 2023][INFO] [SUB]    at com.mysql.cj.Messages.<clinit>(Messages.java:60)
[seg. dez. 18 14:50:57 BRT 2023][INFO] [SUB]    ... 64 more
[seg. dez. 18 14:50:57 BRT 2023][INFO] [SUB] Caused by: java.util.MissingResourceException: Can't find bundle for base name com.mysql.cj.LocalizedErrorMessages, locale pt_BR
[seg. dez. 18 14:50:57 BRT 2023][INFO] [SUB]    at [email protected]/java.util.ResourceBundle.throwMissingResourceException(ResourceBundle.java:2045)
[seg. dez. 18 14:50:57 BRT 2023][INFO] [SUB]    at [email protected]/java.util.ResourceBundle.getBundleImpl(ResourceBundle.java:1683)
[seg. dez. 18 14:50:57 BRT 2023][INFO] [SUB]    at [email protected]/java.util.ResourceBundle.getBundleImpl(ResourceBundle.java:1586)
[seg. dez. 18 14:50:57 BRT 2023][INFO] [SUB]    at [email protected]/java.util.ResourceBundle.getBundleImpl(ResourceBundle.java:1549)
[seg. dez. 18 14:50:57 BRT 2023][INFO] [SUB]    at [email protected]/java.util.ResourceBundle.getBundle(ResourceBundle.java:858)
[seg. dez. 18 14:50:57 BRT 2023][INFO] [SUB]    at com.mysql.cj.Messages.<clinit>(Messages.java:58)
[seg. dez. 18 14:50:57 BRT 2023][INFO] [SUB]    ... 64 more
[seg. dez. 18 14:55:59 BRT 2023][FINE] Result for run until end: 0

Searching, I saw that the error indicates that it was not possible to find a file LocalizedErrorMessages_pt_BR.properties in the path com.mysql.cj, but this file does not exist natively in the mysql-connector-j library, and cannot be created since the library cannot be edited.

I've tried everything, changing properties like <default-locale>, changing the VM's locale settings, nothing worked.

For context, I'll leave my project's pom.xml file:

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>com.projetos.skymaster</groupId>
    <artifactId>SkyMasterGerenteSobras</artifactId>
    <version>1.0-SNAPSHOT</version>
    <name>SkyMasterGerenteSobras</name>

    <properties>
        <junit.version>5.9.2</junit.version>
    </properties>

    <dependencies>
        <dependency>
            <groupId>com.mysql</groupId>
            <artifactId>mysql-connector-j</artifactId>
            <version>8.0.33</version>
        </dependency>
        <dependency>
            <groupId>com.itextpdf</groupId>
            <artifactId>itextpdf</artifactId>
            <version>5.5.13.3</version>
        </dependency>
        <dependency>
            <groupId>org.openjfx</groupId>
            <artifactId>javafx-controls</artifactId>
            <version>17.0.6</version>
        </dependency>
        <dependency>
            <groupId>org.openjfx</groupId>
            <artifactId>javafx-fxml</artifactId>
            <version>17.0.6</version>
        </dependency>
        <dependency>
            <groupId>org.controlsfx</groupId>
            <artifactId>controlsfx</artifactId>
            <version>11.1.2</version>
        </dependency>
        <dependency>
            <groupId>org.kordamp.ikonli</groupId>
            <artifactId>ikonli-javafx</artifactId>
            <version>12.3.1</version>
        </dependency>
        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter-api</artifactId>
            <version>${junit.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter-engine</artifactId>
            <version>${junit.version}</version>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.11.0</version>
                <configuration>
                    <source>17</source>
                    <target>17</target>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.openjfx</groupId>
                <artifactId>javafx-maven-plugin</artifactId>
                <version>0.0.8</version>
                <executions>
                    <execution>
                        <!-- Default configuration for running with: mvn clean javafx:run -->
                        <id>default-cli</id>
                        <configuration>
                            <mainClass>com.projetos.skymaster.skymastergerentesobras.Main</mainClass>
                            <launcher>app</launcher>
                            <jlinkZipName>app</jlinkZipName>
                            <jlinkImageName>app</jlinkImageName>
                            <noManPages>true</noManPages>
                            <stripDebug>true</stripDebug>
                            <noHeaderFiles>true</noHeaderFiles>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>com.gluonhq</groupId>
                <artifactId>gluonfx-maven-plugin</artifactId>
                <version>1.0.22</version>
                <configuration>
                    <mainClass>com.projetos.skymaster.skymastergerentesobras.Main</mainClass>
                    <reflectionList>
                        <item>com.projetos.skymaster.skymastergerentesobras.controllers.LoginController</item>
                    </reflectionList>
                    <linkerArgs>
                        <arg>management_ext.lib</arg>
                        <arg>psapi.lib</arg>
                    </linkerArgs>
                </configuration>
            </plugin>
        </plugins>
    </build>
</project>

I don't know if it is related to the version of my mysql-connector-j, or some other configuration.

0

There are 0 answers