Deserializing problem

51 views
Skip to first unread message

Marco Demartino

unread,
Feb 15, 2021, 4:18:25 AM2/15/21
to SnakeYAML
Hi,
I am serializing a class, saving it to file and right after it I am loading and deserializing it. In theory, it should work fine, but it outputs an error. It says, that it can't found the class where the YAML file will be deserialized, but I can't understand why, as the class is in the jar in the right place.
The code is available on GitHub https://github.com/SuperMarcomen/SuperLib.
Here is the error: https://pastebin.com/3s3RRbpZ  

Even tough there is an error during the serialization, the deserialization works fine, but I would like to change the output a bit, but I can't understand how to do it.


!!it.marcodemartino.superlib.Config
location: {serializedLocation: 'world:0.0:0.0:0.0:0.0:0.0'}
pirla: test


The class superlib.Config contains the field SerializableLocation (called "location"), which is a wrapper of a class called Location from the Spigot API. I just want to save some fields of the class Location, so I decided to create a wrapper that returns a string from a given Location.
What I would like to have is to simply put the String value directly after the field "location" in the config, like this: "location: 'world...' ", and I don't want to also have the name of the field "serializedLocation" saved in a map at "location".

Uday Bhaskar Sarma Seetamraju

unread,
Feb 16, 2021, 2:36:18 AM2/16/21
to snakeya...@googlegroups.com
You could have copied and pasted the error message, and saved everyone a TON of time.
You did NOT.

I had to download the code, read thru EVERY SINGLE line of it, to ensure no malware was hiding in it.. run it on your behalf.
And .. (based on the following) the conclusion is that .. this issue of yours has NOTHING to do with SnakeYAML.

# mvn package

..

..


# java -jar target/SuperLib-1.0.jar 

Error: Could not find or load main class it.marcodemartino.superlib.SuperLib

Caused by: java.lang.NoClassDefFoundError: org/bukkit/plugin/java/JavaPlugin


jar -tvf target/SuperLib-1.0.jar | grep -i bukkit

<None found>


Make sure to add the appropriate RUNTIME dependencies to your pom.xml

--
You received this message because you are subscribed to the Google Groups "SnakeYAML" group.
To unsubscribe from this group and stop receiving emails from it, send an email to snakeyaml-cor...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/snakeyaml-core/89f325ab-b8bd-48f8-a1f9-62b0386c4c01n%40googlegroups.com.

Marco Demartino

unread,
Feb 16, 2021, 3:39:24 AM2/16/21
to SnakeYAML
I don't like the tone of your answer, you are being very impolite.
The error is literally uploaded at pastebin.com, why did you have to download the code and run it?

By the way thanks for your contribution, I will close this discussion as I have found another solution that doesn't use this library and doesn't require this questionable support.

Marco Demartino

unread,
Feb 16, 2021, 3:44:22 AM2/16/21
to SnakeYAML
Now that I take a better look at the error you posted, I noticed that you tried to run my jar. Well, I'm sorry but I didn't say to you that I was developing a Spigot plugin. That explains the NoClassDefFoundError you got.
TL;DR your error isn't even the SAME as the one I UPLOADED.

tos...@gmail.com schrieb am Dienstag, 16. Februar 2021 um 08:36:18 UTC+1:

Joachim Durchholz

unread,
Feb 16, 2021, 1:14:07 PM2/16/21
to snakeya...@googlegroups.com
Am 16.02.21 um 09:39 schrieb Marco Demartino:
> I don't like the tone of your answer, you are being very impolite.

You aren't being more polite yourself.

> The error is literally uploaded at pastebin.com, why did you have to
> download the code and run it?

Reproducing a problem is usually the only way to understand the issue.
Reading code takes a *lot* more time.

> By the way thanks for your contribution, I will close this discussion as
> I have found another solution that doesn't use this library and doesn't
> require this questionable support.

Well, making demands but not offering anything in exchange is pretty
questionable in itself.

I did hold in your favor that you reported the actual cause.
Unfortunately, the second paragraph overcompensated, you were trying to
push the responsibility away from us.

TL;DR: If you wish the level you get from paid support, order paid support.
SnakeYaml is mostly or entirely volunteer-driven. It's obviously not the
right choice for your expectations.

Regards,
Jo

P.S.: I'm posting this in public because it's a recurring theme, and
this exchange is the classic one: Problem reported, somebody goes to
great lengths to even find out what happened, complainer is dissatisfied
and frustrated and vents it.
I believe such things happen mostly because of expectation mismatch, not
because of ill will on any side.
Reply all
Reply to author
Forward
0 new messages