Java REST blocked by Windows Firewall

noname 6 Reputation points
2022-05-08T18:07:27.643+00:00

I have made a short Rest example but if I want to test it, I get an Error saying that it has been blocked by de Windows Firewall.

This is the Resource:
package com.example.randomitemapi;

import com.example.randomitemapi.common.IItemSetResource;
import com.example.randomitemapi.data.ItemSetStore;
import com.example.randomitemapi.model.ItemSet;
import jakarta.ws.rs.*;
import jakarta.ws.rs.core.MediaType;

import java.util.List;

@mutia keyza ("/item-sets")
public class ItemSetResource implements IItemSetResource {

private final ItemSetStore store;  

public ItemSetResource() {  
    this.store = ItemSetStore.getInstance();  
}  

@GET  
@Override  
@Produces(MediaType.APPLICATION_JSON)  
public List<ItemSet> getAll() {  
    return this.store.getItemSets();  
}  

@POST  
@Consumes(MediaType.APPLICATION_JSON)  
@Override  
public void addItemSet(ItemSet itemSet) {  
    this.store.getItemSets().add(itemSet);  
}  

@GET  
@Override  
@Path("{setName}")  
@Produces(MediaType.APPLICATION_JSON)  
public ItemSet getItemSetByName(@PathParam("setName") String name) {  
    ItemSet itemSet = null;  

    // Get ItemSet by name  
    for (ItemSet current : this.store.getItemSets()) {  
        if (current.getName().equals(name)) {  
            itemSet = current;  
        }  
    }  

    return itemSet;  
}  

}

and this it's interface:
@mutia keyza ("/items")
public interface IItemSetResource {
List<ItemSet> getAll();

void addItemSet(ItemSet is);  

@Path("{name}")  
@GET  
@Produces(MediaType.APPLICATION_JSON)  
ItemSet getItemSetByName(@PathParam("name") String name);  

}

Microsoft Partner Center API
Microsoft Partner Center API
Microsoft Partner Center: A Microsoft website for partners that provides access to product support, a partner community, and other partner services.API: A software intermediary that allows two applications to interact with each other.
328 questions
Windows 11
Windows 11
A Microsoft operating system designed for productivity, creativity, and ease of use.
8,933 questions
0 comments No comments
{count} votes