RemoteAPI SelectRowsCommand CommandException: Not Found

LabKey Support Forum (Inactive)
RemoteAPI SelectRowsCommand CommandException: Not Found bront  2016-03-31 15:20
Status: Closed
 
hi,

I am running into a problem with this simple command. I have a project called "Testing," and within that project in the lists schema there is a list called "gender." When I run the command, however, I get: org.labkey.remoteapi.CommandException: Not Found

What am I missing?

thanks,

bront


            Connection cn = new Connection("https://ourdevserver.edu, "xxx", "yyy");
        SelectRowsCommand cmd = new SelectRowsCommand("lists", "gender");

        try
        {
            SelectRowsResponse response = cmd.execute(cn, "/Testing");

        } catch (IOException | CommandException e)
        {
            e.printStackTrace();
        }
 
 
Jon (LabKey DevOps) responded:  2016-03-31 20:08
Hi Bront,

Can you send us the full code? The code itself looks okay, but are you also importing classes too?

Regards,

Jon
 
bront responded:  2016-04-01 06:28
Jon,

I think I have all the necessary classes... maybe.

I am running it from my local machine hitting a remote dev server, would that matter?

thanks,

bront

package edu.uky.kcr.ctrp;

import java.io.IOException;
import java.util.Map;
import org.labkey.remoteapi.CommandException;
import org.labkey.remoteapi.Connection;
import org.labkey.remoteapi.query.GetQueriesCommand;
import org.labkey.remoteapi.query.GetQueriesResponse;
import org.labkey.remoteapi.query.SelectRowsCommand;
import org.labkey.remoteapi.query.SelectRowsResponse;

public class LabKeyFiles {

    public static void queryFiles()
    {

        Connection cn = new Connection("https://ourdevserver.edu, "xxx", "yyy");
        SelectRowsCommand cmd = new SelectRowsCommand("labkey", "list.gender");

        try
        {
            SelectRowsResponse response = cmd.execute(cn, "/Testing/");

        } catch (IOException | CommandException e)
        {
            e.printStackTrace();
        }
    }
}
 
Andy Straw responded:  2016-04-01 06:56
I believe the issue is that the schema name is "lists" not "list".
 
bront responded:  2016-04-01 07:04
I have tried a number of different formulations.

SelectRowsCommand cmd = new SelectRowsCommand("lists", "gender");

This still returns: org.labkey.remoteapi.CommandException: Not Found

Thanks,

bront
 
Andy Straw responded:  2016-04-01 07:13
Not sure this applies to your configuration, but for our server, we would use "https://ourdevserver.edu/labkey" ("/labkey" added). When I remove "/labkey" on our server I get:

Exception in thread "main" org.labkey.remoteapi.CommandException: Not Found
    at org.labkey.remoteapi.Command.throwError(Command.java:355)
    at org.labkey.remoteapi.Command._execute(Command.java:321)
    at org.labkey.remoteapi.Command.execute(Command.java:202)

which sounds like your error.
 
bront responded:  2016-04-01 07:30
That was it. Thank you so much.

cheers,

bront