thingsboard / tbmq

Open-source, scalable, and fault-tolerant MQTT broker able to handle 4M+ concurrent client connections, supporting at least 3M messages per second throughput per single cluster node with low latency delivery. The cluster mode supports more than 100M concurrently connected clients.
https://thingsboard.io/products/mqtt-broker/
Apache License 2.0
572 stars 46 forks source link

[Bug] Error executing Maven. #51

Closed mahmutsalman closed 1 year ago

mahmutsalman commented 1 year ago

When I try to build from sources using mvn clean install -DskipTests command it gives :

ERROR] Error executing Maven. [ERROR] java.lang.IllegalStateException: Unable to load cache item [ERROR] Caused by: Unable to load cache item [ERROR] Caused by: Could not initialize class com.google.inject.internal.cglib.core.$MethodWrapper [ERROR] Caused by: Exception com.google.inject.internal.cglib.core.$CodeGenerationException: java.lang.reflect.InaccessibleObjectException-->Unable to make protected final java.lang.Class java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int,java.security.ProtectionDomain) throws java.lang.ClassFormatError accessible: module java.base does not "opens java.lang" to unnamed module @69a10787 [in thread "main"]

I already set Java 17 for environment variables. I also double-checked Maven to see which Java version it uses. echo $JAVA_HOME
/usr/lib/jvm/java-17-openjdk-amd64

java --version openjdk 17.0.7 2023-04-18 OpenJDK Runtime Environment (build 17.0.7+7-Ubuntu-0ubuntu120.04) OpenJDK 64-Bit Server VM (build 17.0.7+7-Ubuntu-0ubuntu120.04, mixed mode, sharing)

Environment: Linux Ubuntu 20.0.4

Thanks in advance

dmytro-landiak commented 1 year ago

hi @mahmutsalman,

it seems to me there is some problem with the versions. Could you pls let me know what Maven version are you using?

mvn -v

I could recommend checking some of the links below: https://askubuntu.com/questions/1367854/when-compiling-a-project-maven-throws-an-error https://medium.com/ci-cd-devops/error-error-executing-maven-error-java-lang-illegalstateexception-unable-to-load-cache-item-39e886a67216

mahmutsalman commented 1 year ago

Thank you. The error is resolved after I changed .profile file and add the correct java jdk path there and reboot.

dmytro-landiak commented 1 year ago

@mahmutsalman, good to hear you resolved the issue!

I am closing the issue as resolved, pls reopen it if you have any more issues regarding this topic.