NullPointerException

Started by Invalid, February 03, 2016, 12:49:59 AM

Previous topic - Next topic

Invalid

Hey,

Ich hab grad meinen Rootserver neu aufgesetzt und nun wollte ich den Bot neu einrichten.
Ich hab OpenJDK-7-JRE installiert und bekomme bei der Ausführung der Java-Datei folgende Fehlermeldung:
Exception in thread "main" java.lang.NullPointerException
        at de.stefan1200.jts3servermod.f.f(Unknown Source)
        at de.stefan1200.jts3servermod.f.<init>(Unknown Source)
        at de.stefan1200.jts3servermod.JTS3ServerMod.main(Unknown Source)

Fehlt mir ne Bibliothek?^^

Verstehe n bisschen von Java aber ohne Code kann ich natürlich nix machen.

Stefan1200

Wie hast du den JTS3ServerMod gestartet? Diese Fehlermeldung ist mir unbekannt.

Invalid


Kofi

I have the same problem :/

java version "1.8.0_60"
Java(TM) SE Runtime Environment (build 1.8.0_60-b27)
Java HotSpot(TM) 64-Bit Server VM (build 25.60-b23, mixed mode)

Invalid

#4
I wrote a little program in java to test my environment and guess what: It works on my windows client but not on my server running ubuntu with OpenJDK 7 JRE. Installing OpenJDK 8 JRE now and see how it works.

Update:
With OpenJDK 8 my test works, gonna test something more complicated.
Bot still throws same exception.

Update 2:
Thought the files might be damaged so downloaded it again and unzipped it, still same error. With OpenJDK 8 all my tests worked fine.

Stefan1200

But the JTS3ServerMod 6.0 beta versions was running fine? It was the same compiler, weird...

I have to setup a Debian testing environment, might need a day until I can test it.

Invalid

didnt test the beta on linux, just ran it on dev setup on windows so I dont know.

Stefan1200

I finished my tests with the new Debian testing environment.

My first guess was, that the new protected JTS3ServerMod is incompatible with OpenJDK on Linux. Now I installed Debian 8.3.0 with OpenJDK, more detailed:
java version "1.7.0_95"
OpenJDK Runtime Environment (IcedTea 2.6.4) (7u95-2.6.4-1~deb8u1)
OpenJDK 64-Bit Server VM (build 24.95-b01, mixed mode)


Downloaded the JTS3ServerMod Hosting Edition with the official download link and started the bot after unpacking, and this is the result:
root@debian:~/JTS3ServerMod_HostingEdition# java -jar JTS3ServerMod.jar
JTS3ServerMod 6.0 (24.01.2016) Instance Manager started...
Successfully connected to MySQL server for logging!
MySQL mode enabled!
Licence key is valid! Thank you very much for your support, Stefan1200!
Telnet interface started on port 5873!


I also tried some possible mistakes like starting the bot from the wrong directory, missing licence key and stuff like that. I never got the NullPointerException. So I have no idea whats the cause for the NullPointerException. Maybe, if it's okay for "Invalid", I want to look at it using Teamviewer on your server directly (while we are talking on a Teamspeak 3 server). Maybe tomorrow afternoon (around 17:00)?

Invalid

#8
Sorry, I had some work to do.
If you managed to get it going, Ill try to solve it.
If that doenst work, Ill message you and you can check it out next week. Im free next week for most time so Ill be flexible on that.


Edit:
I redownloaded it, I run OpenJDK 8 and I still get the exception. If I dont insert any license, it quits because of that but if I enter my license, I get the Nullpointerexception.
Maybe its about the license?
I sent you my license via PN, you can put it into your testing enviroment and see if it works.
Can you imagine what throws the exception?
If you have time next week, we can have a look together.

Edit 2: Same for OpenJDK 7.

Edit 3: Tested with Oracle Java 8 SDK on Windows 10 and got the same error.

Stefan1200

Please send me the full JTS3ServerMod_InstanceManager.log file (should be not that much, just post it here)

Invalid

as expected:
2016-02-05 17:17:45     START_MANAGER   JTS3ServerMod 6.0 (24.01.2016) Instance Manager started...
2016-02-05 17:17:45     CONFIG  Bot chat command !exec is disabled!
2016-02-05 17:17:45     CONFIG  Multi IP Mode disabled!
2016-02-05 17:17:45     CONFIG  Telnet server disabled!
2016-02-05 17:17:45     CONFIG  MySQL mode disabled!
2016-02-05 17:17:46     LICENCE_CHECK   Licence key is valid! Thank you very much for your support, Invalid!

Stefan1200

Quote from: Invalid on February 05, 2016, 07:09:40 PM
2016-02-05 17:17:45     CONFIG  Telnet server disabled!
2016-02-05 17:17:45     CONFIG  MySQL mode disabled!


Why? And the NullPointerException is not in the log file?

Invalid

#12
Because its not set up yet.
And if the java runtime throws an exception, your program crashed, thats why there is no log entry.
What did you expect? You didnt catch it allthough it wouldnt through the Exception.

Ill set up the Telnet Server and the MySQL and will start the service again. Ill post the result here.

Edit: Ok, after setting up the MySQL Connection, it works.

Stefan1200

Quote from: Invalid on February 06, 2016, 12:57:47 AM
And if the java runtime throws an exception, your program crashed, thats why there is no log entry.
What did you expect? You didnt catch it allthough it wouldnt through the Exception.

Hey, you never wrote where you got the exception, so of course I thought that it would be catched from my code. And in fact almost everything is catched, that's why I surprised too.

And I also thought that you use the same configuration files on Windows and Linux. Because I found the bug now, you get this NullPointerException also on Windows, you just have to disable MySQL. Bug is fixed in version 6.0.1, will be released in a minute at the known place.