I'm attempting to add a REST endpoint to my extension. As a starting point,
I wanted to see if I could get a simple GET request working, but I'm
running into trouble.

I copied the quickconnect extension as reference point. My UserContext
class implements the getResource() method:

     @Override
>      public Object getResource() throws GuacamoleException {
>          return new WorkspaceREST(this.connectionDirectory);
>      }


The REST class looks like this:

@Produces(MediaType.APPLICATION_JSON)
> public class WorkspaceREST {
>     private final WorkspaceDirectory directory;
>
>     public WorkspaceREST(WorkspaceDirectory directory) {
>         this.directory = directory;
>     }
>
>     @GET
>     @Path("test")
>     public Map<String, String> test() {
>        logger.info("REST test");
>        return Collections.singletonMap("success", "true");
>     }
> }


My authenticationProvider's identifier is "boldidea-workspaces", so I tried
the following url (after logging in and inspecting my token):

/guacamole/api/session/ext/boldidea-workspaces/test?token=XXXXX

I get a 500 response, with the tomcat logs showing the following error:

com.sun.jersey.api.NotFoundException: null for uri:
> http://localhost:8080/guacamole/api/session/ext/boldidea-workspaces/test/?token=XXXXX


What's the best way to troubleshoot this?

Ben Davis

*Education Director*

*214-442-1635  | https://boldidea.org/ <http://boldidea.org/>*


* <https://boldidea.org/donate>*

Reply via email to