Comments (9)
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.
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.
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.
I tested Log4J without the JRakNet dependency and it works great:
But if I add a JRakNet dependency, then even my code without using JRakNet will throw that error:
Maybe this will help somehow.
from jraknet.
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.
I have already tried doing this. Did not help.
from jraknet.
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:
This also works with code without using JRakNet:
from jraknet.
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.
Okay. Good luck!
from jraknet.
Related Issues (20)
- CONNECTION_REPLY_2 incorrectly encoding and decoding
- CONNECTION_REQUEST_1 maximum transfer unit decoding broken.
- Memory leak in discovery system HOT 1
- Local server not assigned as external when added as external in discovery system
- Can't connect to some servers HOT 6
- Error | java.lang.IllegalArgumentException: bufferSize: 0
- MinecraftIdentifier does not properly work HOT 3
- Server not showing up in "Friends" tab HOT 2
- Can't communicate with BDS HOT 1
- Meaningless checks and always true conditional statements. HOT 1
- Incorrect reading of ConnectionRequestAccepted HOT 1
- Dosse-upnp missing HOT 8
- read/write String is broken for Minecraft: Bedrock Edition packets.
- Unnecessary log prints.
- implement readSlice method for Packet.java.
- implement read/write ascii string.
- add createEncapsulatedPacket(Packet) method.
- encryption support.
- SplitSize(maybe not an issue) HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jraknet.