Giter VIP home page Giter VIP logo

Comments (9)

whirvis avatar whirvis commented on August 24, 2024 1

Alrighty! Thanks so much for the heads up, I really appreciate it. I'll leave the issue open as it feels like something that could be better fixed.

If you have any questions how to use JRakNet, feel free to open a new issue or DM me on Discord at Whirvis#0001

from jraknet.

whirvis avatar whirvis commented on August 24, 2024

This looks like an issue with the Log4J dependencies. Could you try removing the dependencies for Log4J and see if it runs then?

from jraknet.

KocTu4eK avatar KocTu4eK commented on August 24, 2024

Okay, I removed the Log4J dependencies:

<dependencies>
    <dependency>
        <groupId>com.whirvis</groupId>
        <artifactId>jraknet</artifactId>
        <version>2.12.3</version>
    </dependency>
</dependencies>

But it did not help. Now, as I understand it, it requires the Log4J library to be installed. Full log:

[INFO] 
[INFO] --- exec-maven-plugin:3.0.0:java (default-cli) @ raktest ---
[WARNING] 
java.lang.NoClassDefFoundError: org/apache/logging/log4j/spi/LoggerContextShutdownAware
    at java.lang.ClassLoader.defineClass1 (Native Method)
    at java.lang.ClassLoader.defineClass (ClassLoader.java:1013)
    at java.security.SecureClassLoader.defineClass (SecureClassLoader.java:150)
    at java.net.URLClassLoader.defineClass (URLClassLoader.java:524)
    at java.net.URLClassLoader$1.run (URLClassLoader.java:427)
    at java.net.URLClassLoader$1.run (URLClassLoader.java:421)
    at java.security.AccessController.doPrivileged (AccessController.java:712)
    at java.net.URLClassLoader.findClass (URLClassLoader.java:420)
    at java.lang.ClassLoader.loadClass (ClassLoader.java:588)
    at java.lang.ClassLoader.loadClass (ClassLoader.java:521)
    at org.apache.logging.log4j.core.impl.Log4jContextFactory.createContextSelector (Log4jContextFactory.java:106)
    at org.apache.logging.log4j.core.impl.Log4jContextFactory.<init> (Log4jContextFactory.java:59)
    at jdk.internal.reflect.DirectConstructorHandleAccessor.newInstance (DirectConstructorHandleAccessor.java:67)
    at java.lang.reflect.Constructor.newInstanceWithCaller (Constructor.java:499)
    at java.lang.reflect.ReflectAccess.newInstance (ReflectAccess.java:128)
    at jdk.internal.reflect.ReflectionFactory.newInstance (ReflectionFactory.java:341)
    at java.lang.Class.newInstance (Class.java:677)
    at org.apache.logging.log4j.LogManager.<clinit> (LogManager.java:94)
    at com.whirvis.jraknet.server.RakNetServer.<init> (RakNetServer.java:174)
    at com.whirvis.jraknet.server.RakNetServer.<init> (RakNetServer.java:595)
    at com.whirvis.jraknet.server.RakNetServer.<init> (RakNetServer.java:653)
    at com.whirvis.jraknet.server.RakNetServer.<init> (RakNetServer.java:672)
    at ru.koctu4ek.Main.main (Main.java:9)
    at org.codehaus.mojo.exec.ExecJavaMojo$1.run (ExecJavaMojo.java:254)
    at java.lang.Thread.run (Thread.java:833)
Caused by: java.lang.ClassNotFoundException: org.apache.logging.log4j.spi.LoggerContextShutdownAware
    at java.net.URLClassLoader.findClass (URLClassLoader.java:445)
    at java.lang.ClassLoader.loadClass (ClassLoader.java:588)
    at java.lang.ClassLoader.loadClass (ClassLoader.java:521)
    at java.lang.ClassLoader.defineClass1 (Native Method)
    at java.lang.ClassLoader.defineClass (ClassLoader.java:1013)
    at java.security.SecureClassLoader.defineClass (SecureClassLoader.java:150)
    at java.net.URLClassLoader.defineClass (URLClassLoader.java:524)
    at java.net.URLClassLoader$1.run (URLClassLoader.java:427)
    at java.net.URLClassLoader$1.run (URLClassLoader.java:421)
    at java.security.AccessController.doPrivileged (AccessController.java:712)
    at java.net.URLClassLoader.findClass (URLClassLoader.java:420)
    at java.lang.ClassLoader.loadClass (ClassLoader.java:588)
    at java.lang.ClassLoader.loadClass (ClassLoader.java:521)
    at org.apache.logging.log4j.core.impl.Log4jContextFactory.createContextSelector (Log4jContextFactory.java:106)
    at org.apache.logging.log4j.core.impl.Log4jContextFactory.<init> (Log4jContextFactory.java:59)
    at jdk.internal.reflect.DirectConstructorHandleAccessor.newInstance (DirectConstructorHandleAccessor.java:67)
    at java.lang.reflect.Constructor.newInstanceWithCaller (Constructor.java:499)
    at java.lang.reflect.ReflectAccess.newInstance (ReflectAccess.java:128)
    at jdk.internal.reflect.ReflectionFactory.newInstance (ReflectionFactory.java:341)
    at java.lang.Class.newInstance (Class.java:677)
    at org.apache.logging.log4j.LogManager.<clinit> (LogManager.java:94)
    at com.whirvis.jraknet.server.RakNetServer.<init> (RakNetServer.java:174)
    at com.whirvis.jraknet.server.RakNetServer.<init> (RakNetServer.java:595)
    at com.whirvis.jraknet.server.RakNetServer.<init> (RakNetServer.java:653)
    at com.whirvis.jraknet.server.RakNetServer.<init> (RakNetServer.java:672)
    at ru.koctu4ek.Main.main (Main.java:9)
    at org.codehaus.mojo.exec.ExecJavaMojo$1.run (ExecJavaMojo.java:254)
    at java.lang.Thread.run (Thread.java:833)

from jraknet.

KocTu4eK avatar KocTu4eK commented on August 24, 2024

I tested Log4J without the JRakNet dependency and it works great:
image

But if I add a JRakNet dependency, then even my code without using JRakNet will throw that error:
image

Maybe this will help somehow.

from jraknet.

whirvis avatar whirvis commented on August 24, 2024

Yes, this info is very helpful! Thank you. Try changing the version of Log4J from 2.17.2 to 2.17.1, and see if that helps.

<!-- Logging interface -->
<dependency>
	<groupId>org.apache.logging.log4j</groupId>
	<artifactId>log4j-api</artifactId>
	<version>2.17.1</version>
</dependency>

<!-- Logging implementation -->
<dependency>
	<groupId>org.apache.logging.log4j</groupId>
	<artifactId>log4j-core</artifactId>
	<version>2.17.1</version>
</dependency>

from jraknet.

KocTu4eK avatar KocTu4eK commented on August 24, 2024

I have already tried doing this. Did not help.

from jraknet.

KocTu4eK avatar KocTu4eK commented on August 24, 2024

I was able to find a solution to the problem! (Changing Log4J version from 2.17.2 to 2.17.1 did not help.)

If the JRakNet dependency is added after the Log4J dependencies, then the error will disappear:
image
image

This also works with code without using JRakNet:
image

from jraknet.

KocTu4eK avatar KocTu4eK commented on August 24, 2024

Thanks for trying to help. Issue can be closed. But it would be nice if you could fix this problem or report a possible solution in the README or somewhere else.

from jraknet.

KocTu4eK avatar KocTu4eK commented on August 24, 2024

Okay. Good luck!

from jraknet.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.