ViewObject line getAttribute returns null when I know that the data is there.

Hi all

I have a simple piece of code in my implementation of the Application Module class to define a binding on a view variable and return the results to my REST Web Service project.

    public ListItem[] returnListForCategory(String category) {
        ListItem[] result =  null;
        Row row = null;
                
        ViewObjectImpl voi = getListForCategoryVO1();
        voi.setNamedWhereClauseParam("Category", category);
        int rows = (int) voi.getEstimatedRowCount();
        int idx = 0;
        result = new ListItem[rows];

        while (voi.hasNext()) {
            row = voi.next();
            ListItem item = new ListItem();
            
            System.out.println("returnListForCategory: code: " + (String)row.getAttribute("Code"));
            System.out.println("returnListForCategory: codeDescription: " + (String)row.getAttribute(1));
            item.setCode((String)row.getAttribute("Code"));
            item.setCodeDescription((String)row.getAttribute("CodeDescription"));
            
            result[idx] = item;
            idx++;
        }        
        
        return result;
    }

When I run the debugger Houston (right click on the Module of the Application and select Debugging), the point of view getListForCategoryVO works as expected: three lines, with data in the fields.

When I deploy this on WLS, and run via the WS REST I get three rows, but all the attributes ('Code' and 'Code') have the value null.

Here's the REST WS code that calls it (in case it is relevant).

    private static final String amDef = "model.am.LookupListsAM";
    private static final String config = "LookupListsAMLocal";

    @GET
    @Path("/{category}")
    public ListItems getList(@PathParam("category") String category) {
        ListItems result = new ListItems();
        ApplicationModule am = Configuration.createRootApplicationModule(amDef, config);

        LookupListsAMImpl llami = (LookupListsAMImpl)am;
        model.dto.ListItem[] items = llami.returnListForCategory(category);
        
        for (model.dto.ListItem item : items) {
            ListItem newItem = new ListItem();
            newItem.setCode(item.getCode());
            newItem.setCodeDescription(item.getCodeDescription());
            result.addListItem(newItem);
        }
        Configuration.releaseRootApplicationModule(am, true);
        return result;
    }

Do you have any idea what I am doing wrong, or it could be the cause?

TIA

You use libraries remains part or a third party provider of jax - rs? (this may be a problem with the classpath)

Dario

Tags: Java

Similar Questions

Maybe you are looking for

  • Don't see no SyncServices on my MAC

    Hello I have a MAC Mini 2009 Intel Core 2 Duo 2.26 GHz, 8 GB RAM, OS X 10.10.5 and Office 365. I can't make 365 Outlook to use everyone on OS X Contacts App. read tons of forums, I saw I have enabled this option in SyncServices. But I now see SyncSer

  • Keyboard HP Pavilion dm1-3216au operation

    Hi I have a HP Pavilion dm1-3216au and I have a problem with the way that behave the f1 - f12 keys, these keys are double operation, for example the f2 key is for the brightness of the screen down, my problem is that pressing f2 that is normall opera

  • I need the BIOS for my gateway T - 63 Lap Top series.

    I have a gateway T - 63 Lap Top series. The part of the motherboard is #: ACEH-40GAB1700-F605.The serial number is: V94DM03707. I tried to contact the bridge, but the information (serial number) that the system is requested to attend my request are s

  • Lenovo solutions Center

    I just decided to install the latest update to the centre of Lenovo solution and ran a diagnotics and I get 2 fails, I never had any forecheck, but the Chipset Test and Test PCI/PCI-e show failed, while running the test it says not valid for these tw

  • How to change the MOB OpenManage integration for vCenter Server registration

    A few months back, I've updated our installation of the vCenter for v2 plugin, now called OpenManage integration for vCenter Server. When you perform the upgrade, we have kept the old base done vs a new installation. During the upgrade process, we de