software-challenge / backend

Server, Client und Spiel-Plugins der Software-Challenge Germany
https://www.software-challenge.de
11 stars 10 forks source link

Incompatible with Java 17 #410

Open xeruf opened 2 years ago

xeruf commented 2 years ago

As reported in Discord, when starting a client the following error occurs:

17:48:33 INFO   sc.networking.clients.XStreamClient - Creating TCP Network for localhost:13050
Security framework of XStream not explicitly initialized, using predefined black list on your own risk.
17:48:33 WARN   sc.networking.clients.XStreamClient - LobbyClient@68dc098b disconnected (Cause: PROTOCOL_ERROR, Exception: {})
com.thoughtworks.xstream.converters.ConversionException: 
---- Debugging information ----
cause-exception     : java.lang.NullPointerException
cause-message       : Cannot invoke "Object.toString()" because the return value of "java.util.Map$Entry.getValue()" is null
class               : sc.plugin2022.GameState
required-type       : sc.plugin2022.GameState
converter-type      : com.thoughtworks.xstream.converters.reflection.ReflectionConverter
line number         : 78
class[1]            : sc.protocol.room.MementoMessage
required-type[1]    : sc.protocol.room.MementoMessage
class[2]            : sc.protocol.room.RoomPacket
required-type[2]    : sc.protocol.room.RoomPacket
version             : 1.4.17
-------------------------------
        at com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:77)
        at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:66)
        at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.unmarshallField(AbstractReflectionConverter.java:499)
        at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.doUnmarshal(AbstractReflectionConverter.java:425)
        at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.unmarshal(AbstractReflectionConverter.java:277)
        at com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:72)
        at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:66)
        at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.unmarshallField(AbstractReflectionConverter.java:499)
        at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.doUnmarshal(AbstractReflectionConverter.java:425)
        at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.unmarshal(AbstractReflectionConverter.java:277)
        at com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:72)
        at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:66)
        at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:50)
        at com.thoughtworks.xstream.core.TreeUnmarshaller.start(TreeUnmarshaller.java:134)
        at com.thoughtworks.xstream.core.AbstractTreeMarshallingStrategy.unmarshal(AbstractTreeMarshallingStrategy.java:32)
        at com.thoughtworks.xstream.XStream.unmarshal(XStream.java:1431)
        at com.thoughtworks.xstream.XStream$4.readFromStream(XStream.java:2105)
        at com.thoughtworks.xstream.core.util.CustomObjectInputStream.readObjectOverride(CustomObjectInputStream.java:123)
        at java.base/java.io.ObjectInputStream.readObject(ObjectInputStream.java:505)
        at java.base/java.io.ObjectInputStream.readObject(ObjectInputStream.java:472)
        at sc.networking.clients.XStreamClient.receiveThread(XStreamClient.java:102)
        at sc.networking.clients.XStreamClient$1.run(XStreamClient.java:79)
        at java.base/java.lang.Thread.run(Thread.java:833)
Caused by: java.lang.NullPointerException: Cannot invoke "Object.toString()" because the return value of "java.util.Map$Entry.getValue()" is null
        at com.thoughtworks.xstream.core.DefaultConverterLookup.lookupConverterForType(DefaultConverterLookup.java:96)
        at com.thoughtworks.xstream.XStream$1.lookupConverterForType(XStream.java:485)
        at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:56)
        at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.unmarshallField(AbstractReflectionConverter.java:499)
        at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.doUnmarshal(AbstractReflectionConverter.java:425)
        at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.unmarshal(AbstractReflectionConverter.java:277)
        at com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:72)
        ... 22 common frames omitted
17:48:33 INFO   sc.networking.clients.XStreamClient - Stopping XStream-Receive id:13 of LobbyClient@68dc098b
17:48:33 WARN   sc.networking.clients.XStreamClient - ReceiveThread is stopping itself

See also #406 and and https://github.com/x-stream/xstream/issues/262