Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

Problem while nvoking services from browser

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

0 votes



2 answers

Permanent link
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

0 votes


Permanent link
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"..

0 votes

Your answer

Register or log in to post your answer.

Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 10,927

Question asked: Feb 27 '09, 11:50 a.m.

Question was seen: 8,536 times

Last updated: Feb 27 '09, 11:50 a.m.

Confirmation Cancel Confirm