web3j icon indicating copy to clipboard operation
web3j copied to clipboard

' Modules utils and core export package org.web3j.crypto to module contracts' error when adding mysql jdbc driver

Open stefanofornari opened this issue 1 year ago • 1 comments

'Modules utils and core export package org.web3j.crypto to module contracts' erorr when adding mysql jdbc driver

I have created an application using web3j; it works all good unless I put mysql-connector-j-8.0.32.jar in the class path. Without even using it, when I start the jvm, I get the following error;

Error occurred during initialization of boot layer java.lang.module.ResolutionException: Modules utils and core export package org.web3j.crypto to module contracts

Here the dependencies I use:

<dependency>
    <groupId>org.web3j</groupId>
    <artifactId>core</artifactId>
    <version>4.9.7</version>
</dependency>
<dependency>
    <groupId>org.web3j</groupId>
    <artifactId>contracts</artifactId>
    <version>4.9.7</version>
</dependency>

<dependency>
    <groupId>mysql</groupId>
    <artifactId>mysql-connector-java</artifactId>
    <version>8.0.32</version>
    <scope>runtime</scope>
</dependency>

Any idea?

stefanofornari avatar Apr 08 '23 08:04 stefanofornari

I have deleted mysql jar and ran java with the arguments --show-module-resolution --validate-modules; it gives the following output:

file:///home/ste/Projects/EasyWallet/target/EasyWallet-0.0-SNAPSHOT/lib/core-4.9.7.jar core automatic
    contains org.web3j.crypto conflicts with module crypto
file:///home/ste/Projects/EasyWallet/target/EasyWallet-0.0-SNAPSHOT/lib/utils-4.9.7.jar utils automatic
    contains org.web3j.crypto conflicts with module crypto
    contains org.web3j.utils conflicts with module core
Error occurred during initialization of boot layer
java.lang.RuntimeException: Validation of module path failed

It doesn't look good does it?

stefanofornari avatar Apr 08 '23 13:04 stefanofornari