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

how to send Map object by using client library

Hi

I'm trying to extend "HelloJazz"

https://jazz.net/learn/LearnItem.jsp?href=content/docs/hello-jazz/index.html

to be able to send Map<String, Object> object as well as String.
(">" is expressed to ">" in following sentences)

To achieve this, I added interface and impl to each package as follows.

- common package

Map<String, Object> sendMap(Map<String, Object> map) throws TeamRepositoryException;

- client package
Map<String, Object> sendMap(Map<String, Object> map) throws TeamRepositoryException;

- client internal package
public Map<String, Object> sendMap(Map<String, Object> map) throws TeamRepositoryException{
Map<String, Object> newMap = getService().sendMap(map);
return newMap;
}

- service package
public Map<String, Object> sendMap(Map<String, Object> map) throws TeamRepositoryException{
Iterator<String> iter = map.keySet().iterator();
while(iter.hasNext()){
String key = iter.next();
String value = (String)map.get(key);
System.out.println("key:" + key+ ",value:" + value);
}
return map;
}

however I met this error by running these code...

com.ibm.team.repository.common.transport.ServiceMethodInvocationError: java.lang.ClassCastException: java.util.HashMap incompatible with org.eclipse.emf.ecore.EObject
at com.ibm.team.repository.transport.client.RemoteTeamService.getAppropriateException(RemoteTeamService.java:571)
at com.ibm.team.repository.transport.client.RemoteTeamService.executeMethod(RemoteTeamService.java:474)
at com.ibm.team.repository.transport.client.RemoteTeamService.invoke(RemoteTeamService.java:184)
at com.ibm.team.repository.transport.client.ServiceInvocationHandler.invoke(ServiceInvocationHandler.java:43)
...

This means complicated object(such as Map) cannot be sended in raw condition from client library to server side,
and some marshal steps are needed ?

If so, do we have to write marshaling methods by myself or some methods are prepared for this purpose ?

These 2 are my questions.

Thanks

Ken

0 votes


Be the first one to answer this question!

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,952

Question asked: Apr 06 '09, 11:08 a.m.

Question was seen: 4,544 times

Last updated: Apr 06 '09, 11:08 a.m.

Confirmation Cancel Confirm