Ok this is my bad, I really need to write some better docs for the serializers. So it needs to extend WebAPISerializer<EventClass>, so in your case that would be WebAPISerializer<InteractBlockEvent>. You need the pointy brackets <> because it’s a generic class.
When using the writeObjectField and the other write methods on the JsonGenerator the first argument is a string which will be the property name.
Btw: You can use sponge plugins reload to reload all the serializers while running the server. This will also recompile all of them which makes it easier to find errors.
I posted your modified code which worked for me below, and would be very glad if you could copy & paste that to try it:
I pasted your code in the serializer and here is what I get :
[NOTE] SpongePowered MIXIN Annotation Processor Version=0.6.8 [ERROR] Line 3:34 | package com.fasterxml.jackson.core does not exist [ERROR] Line 4:38 | package com.fasterxml.jackson.databind does not exist [ERROR] Line 5:41 | package org.spongepowered.api.event.block does not exist [ERROR] Line 6:40 | package valandur.webapi.json.serializers does not exist [ERROR] Line 10:46 | cannot find symbol symbol: class WebAPISerializer [ERROR] Line 10:63 | cannot find symbol symbol: class InteractBlockEvent [ERROR] Line 12:27 | cannot find symbol symbol: class InteractBlockEvent location: class serializers.InteractEventSerializer [ERROR] Line 12:53 | cannot find symbol symbol: class JsonGenerator location: class serializers.InteractEventSerializer [ERROR] Line 12:72 | cannot find symbol symbol: class SerializerProvider location: class serializers.InteractEventSerializer
Same error and I have JDK 1.8.0_131 installed, not JRE.
It took some time, sorry for that. Same trouble with API 6 for 1.11.2 :
[NOTE] SpongePowered MIXIN Annotation Processor Version=0.6.8 [ERROR] Line 3:34 | package com.fasterxml.jackson.core does not exist [ERROR] Line 4:38 | package com.fasterxml.jackson.databind does not exist [ERROR] Line 5:41 | package org.spongepowered.api.event.block does not exist [ERROR] Line 6:40 | package valandur.webapi.json.serializers does not exist [ERROR] Line 10:46 | cannot find symbol symbol: class WebAPISerializer [ERROR] Line 10:63 | cannot find symbol symbol: class InteractBlockEvent [ERROR] Line 12:27 | cannot find symbol symbol: class InteractBlockEvent location: class serializers.InteractEventSerializer [ERROR] Line 12:53 | cannot find symbol symbol: class JsonGenerator location: class serializers.InteractEventSerializer [ERROR] Line 12:72 | cannot find symbol symbol: class SerializerProvider location: class serializers.InteractEventSerializer
How did you make your test ? By running a server a within your IDE ?
Edit : I tried to upload the whole stuff on my dedicated server with openjdk8-jdk and I still have this issue :
Log part : [NOTE] SpongePowered MIXIN Annotation Processor Version=0.6.8 [NOTE] ObfuscationServiceMCP supports type: "searge" [NOTE] ObfuscationServiceMCP supports type: "notch" [ERROR] Line 3:34 | package com.fasterxml.jackson.core does not exist [ERROR] Line 4:38 | package com.fasterxml.jackson.databind does not exist [ERROR] Line 5:41 | package org.spongepowered.api.event.block does not exist [ERROR] Line 6:40 | package valandur.webapi.json.serializers does not exist [ERROR] Line 10:46 | cannot find symbol symbol: class WebAPISerializer [ERROR] Line 10:63 | cannot find symbol symbol: class InteractBlockEvent [ERROR] Line 12:27 | cannot find symbol symbol: class InteractBlockEvent location: class serializers.InteractEventSerializer [ERROR] Line 12:53 | cannot find symbol symbol: class JsonGenerator location: class serializers.InteractEventSerializer [ERROR] Line 12:72 | cannot find symbol symbol: class SerializerProvider location: class serializers.InteractEventSerializer
Ok so I think this has either to do with a mistake I made while compiling the new version, or in the config files.
If you could check the config.conf file in the config directory, and make sure the devMode variable is set to false.
I believe right now it is set to "false;" (I added the semicolon on accident, so it parsed it as a string, when converting to a boolean this might be converted to true)
Tell me if that fixes it, otherwise I’ll edit this comment with something else you could try.
EDIT: @Keuterio I tested in my IDE and standalone. I think the problem you’re having is because it’s not rewriting the import statements like it’s supposed to.
You were right for the typo, I updated to 3.2.0 as well but it keeps failing on compilation.
Console : [23:29:58 INFO] [webapi]: Web-API v3.2.0-S6.1 is starting... [23:29:58 INFO] [webapi]: Setting up jetty logger [23:29:58 INFO] [webapi]: Logging initialized @21599ms to valandur.webapi.misc.JettyLogger [23:29:58 INFO] [webapi]: Loading configuration... [23:29:58 INFO] [webapi]: New configuration version '3' for config.conf [23:29:59 INFO] [webapi]: Loading additional serializers... [23:29:59 INFO] [webapi]: Found 1 serializer files in C:\Users\Administrateur.DESKTOP-AG15HPJ\Documents\Minecraft\test server\webapi [23:29:59 INFO] [webapi]: - InteractEventSerializer.java [23:29:59 ERROR] [webapi]: Compilation failed. See the log file at C:\Users\Administrateur.DESKTOP-AG15HPJ\Documents\Minecraft\test server\webapi\serializers\InteractEventSerializer.log for details [23:30:00 INFO] [webapi]: Done loading additional serializers [23:30:00 INFO] [webapi]: Registering commands... [23:30:01 INFO] [webapi]: Web-API ready
Log : [NOTE] SpongePowered MIXIN Annotation Processor Version=0.6.8 [NOTE] ObfuscationServiceMCP supports type: "searge" [NOTE] ObfuscationServiceMCP supports type: "notch" [ERROR] Line 3:53 | package valandur.webapi.shadow.fasterxml.jackson.core does not exist [ERROR] Line 4:57 | package valandur.webapi.shadow.fasterxml.jackson.databind does not exist [ERROR] Line 5:41 | package org.spongepowered.api.event.block does not exist [ERROR] Line 6:40 | package valandur.webapi.json.serializers does not exist [ERROR] Line 10:46 | cannot find symbol symbol: class WebAPISerializer [ERROR] Line 10:63 | cannot find symbol symbol: class InteractBlockEvent [ERROR] Line 12:27 | cannot find symbol symbol: class InteractBlockEvent location: class serializers.InteractEventSerializer [ERROR] Line 12:53 | cannot find symbol symbol: class JsonGenerator location: class serializers.InteractEventSerializer [ERROR] Line 12:72 | cannot find symbol symbol: class SerializerProvider location: class serializers.InteractEventSerializer
A new version has been released for Web-API, it is available for download here.
Fixed serializers not working on unix systems
Please note that permissions changed slightly since the 3.2 versions. Check the permissions.conf file, and make sure to change permissions like cmd to either cmd.get and cmd.post or cmd.*
Yes indeed I did. I’m currently working on an update to include more detailed permissions, as requested by this git issue, but i should be done by the end of the week.
You made so much improvements during the past weeks, congrats !
I was wondering if you could add an interactive message with feedback. As an example, “X sent you a present from the website, do you accept it ? [YES] [NO]” and the chosen answer is sent back.
Yes, it provides the bridge between server and website. You can make a small app which send command /give 11115 minecraft:diamond_sword after he voted 5 times.
Just wanted to let you guys know that i’m still working on this project (just in case you haven’t checked github) and am planning a rather big update sometime soon!