It's all about the answers!

Ask a question

Problem while nvoking services from browser


vinay reddy (171205) | asked Feb 27 '09, 11:50 a.m.
Can some one tell what the problem is with respect to the following code? I do not find any compilation errors but could not succeed in invoking getNewMessage() from the browser (it says internal server error). However, I could invoke the other method getAllMessages().

public Message[] getAllMessages() throws TeamRepositoryException {




IQueryService queryService = getService(IQueryService.class);

MessageQueryModel queryModel = BaseMessageQueryModel.MessageQueryModel.ROOT;
IItemQuery itemQuery = IItemQuery.FACTORY.newInstance(queryModel);

IItemQueryPage itemQueryPage = queryService.queryItems(itemQuery,
IQueryService.EMPTY_PARAMETERS, IQueryService.ITEM_QUERY_MAX_PAGE_SIZE);

IRepositoryItemService repositoryItemService = getService(IRepositoryItemService.class);
IItem[] items = repositoryItemService.fetchItems(itemQueryPage.handlesAsArray(), null);

ArrayList<Message> messages = new ArrayList<Message>();

for (IItem item : items) {
if (item instanceof Message) {
messages.add((Message) item);

}
}

return (Message[]) messages.toArray(new Message);




}

public Message getNewMessage()
throws TeamRepositoryException {
IRepositoryItemService repositoryItemService = getService(IRepositoryItemService.class);
Message message = (Message) getMessageItemType().createItem();
message.setText("hello");
message.setTest("hi");

message = (Message) repositoryItemService.saveItem(message);
return message;
}


static IItemType getMessageItemType() {
return IItemType.IRegistry.INSTANCE
.getItemType(JazztalkPackage.eINSTANCE.getMessage().getName(), JazztalkPackage.eNS_URI);
}

These are the related warnings on console. Why they are being raised for only of these methods "getNewMessage()" and not for the other?

21:59:04,687 WARN ory.servlet.internal.ModelledRestServiceMethodInfo - CRJAZ1177I Unable to find matching method for $Proxy76, GET, newmessage
22:00:52,578 WARN ory.servlet.internal.ModelledRestServiceMethodInfo - CRJAZ1177I Unable to find matching method for $Proxy76, GET, newmessage

2 answers



permanent link
Brian Hickman (51) | answered Jul 23 '10, 5:32 p.m.
I am also getting the error in my jazz.log:

16:25:43,547 WARN ory.servlet.internal.ModelledRestServiceMethodInfo - CRJAZ1177I Unable to find matching method for $Proxy361, GET, executeQuery

permanent link
Curtis d'Entremont (1.3k3) | answered Jul 26 '10, 10:59 a.m.
FORUM MODERATOR / JAZZ DEVELOPER
The error message is saying it can't figure out which method you're trying to call based on the URL.

From what I've seen, to get the path you need to drop the get/post then make the first char lowercase, e.g. getNewMessage -> newMessage. I notice your error message has "newmessage" all lowercase.. try "newMessage"..

Your answer


Register or to post your answer.