// Call method2
Map<String, String> map = new HashMap<String, String>();
map.put("hello", "world");
map.put("great", "ejb3");
remote.method2("Remote method2 called", map);
System.out.println("Remote method2 called");
}
finally
{
// instead of typecasting, you can use a helper class that does everything for you.