Web-API [v4] - AdminPanel & RESTful web server [now with screenshots!]

Sure ! Here you are : package serializers;import com.fasterxml.jackson.core.JsonGenerator;import - Pastebin.com

There are both serializer and log in this pastebin.

I am going to try the new version and edit this post as soon as possible.

Edit : same error “package does not exist”

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:

package serializers;

import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.databind.SerializerProvider;
import org.spongepowered.api.event.block.InteractBlockEvent;
import valandur.webapi.json.serializers.WebAPISerializer;

import java.io.IOException;

public class InteractEventSerializer extends WebAPISerializer<InteractBlockEvent> {
    @Override
    public void serialize(InteractBlockEvent value, JsonGenerator gen, SerializerProvider provider) throws IOException {
        gen.writeStartObject();
        gen.writeObjectField("cause", value.getCause());
        gen.writeObjectField("block", value.getTargetBlock());
        gen.writeEndObject();
    }
}

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.

Is that with WebAPI version 3.1.1?

Yes it was, I am going to try with API 6 instead of API 5 as a stable build is released.

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 :

Console part :
[11:52:07] [main/INFO] [mixin]: SpongePowered MIXIN Subsystem Version=0.6.8 Source=file:/home/royalkeut/server/spongevanilla-1.11.2-6.1.0-BETA-3.jar Env=UNKNOWN [...] [11:52:40] [Server thread/INFO] [webapi]: Web-API v3.1.1-S6.1 is starting... [11:52:40] [Server thread/INFO] [webapi]: Setting up jetty logger [11:52:41] [Server thread/INFO] [webapi]: Logging initialized @35184ms to valandur.webapi.misc.JettyLogger [11:52:41] [Server thread/INFO] [webapi]: Loading configuration... [11:52:41] [Server thread/INFO] [webapi]: Loading additional serializers... [11:52:41] [Server thread/INFO] [webapi]: Found 1 serializer files in /home/royalkeut/server/webapi [11:52:41] [Server thread/INFO] [webapi]: - InteractEventSerializer.java [11:52:42] [Server thread/ERROR] [webapi]: Compilation failed. See the log file at /home/royalkeut/server/webapi/serializers/InteractEventSerializer.log for details [11:52:42] [Server thread/INFO] [webapi]: Done loading additional serializers [11:52:42] [Server thread/INFO] [webapi]: Registering commands... [11:52:45] [Server thread/INFO] [webapi]: Web-API ready

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.

A new version has been released for Web-API, it is available for download here.


  • Add block update operations
  • Fix config file typo
  • Fix errors with serializers

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.*

1 Like

Did you find the error about location in custom hooks ?

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.

1 Like

A new version has been released for Web-API, it is available for download here.


  • Added InteractBlockEvent web hook
  • Fixed errors with cached entity inventories
1 Like

A new version has been released for Web-API, it is available for download here.


  • Add web hooks responses that can send messages to players
  • Add documentation for WebHooks
  • Fix adding serializers for existing classes not working
  • Fix empty permission nodes causing errors
2 Likes

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.

A new version has been released for Web-API, it is available for download here.


  • Add interactive messages
  • Add WebHook filters
  • Improve method execution on objects
  • Support text formatting on WebHook responses
  • Add & update lots of documentation
  • Fix block volumes throwing errors
  • Improve class endpoint performance
  • Improve method execution performance
2 Likes

A new version has been released for Web-API, it is available for download here.


  • Fix players not being serialized properly
  • Fix inventories for tile-entities and entities not working properly
  • Fix options requests not being handled properly, and add CORS headers to all requests

This plugins can apply to webshop for buy item and money and etc in website ?

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!

2 Likes